Merge branch 'dev' of https://github.com/redmatrix/hubzilla into help-content

This commit is contained in:
Andrew Manning 2016-04-27 05:56:19 -04:00
commit f975d9dfe4
23 changed files with 16305 additions and 15822 deletions

View File

@ -143,16 +143,11 @@ class Editblock extends \Zotlabs\Web\Controller {
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
'$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'),
'$upload' => t('Upload photo'),
'$writefiles' => (($mimetype == 'text/bbcode') ? perm_is_allowed($owner, get_observer_hash(), 'write_storage') : false),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
'$video' => t('Insert Vorbis [.ogg] video'),
'$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'),
'$noloc' => t('Clear browser location'),
'$wait' => t('Please wait'),
'$weblink' => (($mimetype == 'text/bbcode') ? t('Insert web link') : false),
'$setloc' => false,
'$noloc' => false,
'$permset' => t('Permission settings'),
'$ptyp' => $itm[0]['type'],
'$mimeselect' => $mimeselect,
@ -160,7 +155,7 @@ class Editblock extends \Zotlabs\Web\Controller {
'$post_id' => $post_id,
'$baseurl' => z_root(),
'$defloc' => $channel['channel_location'],
'$visitor' => false,
'$visitor' => true,
'$public' => t('Public post'),
'$jotnets' => $jotnets,
'$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
@ -177,8 +172,6 @@ class Editblock extends \Zotlabs\Web\Controller {
'$jotplugins' => $jotplugins,
'$sourceapp' => $itm[0]['app'],
'$defexpire' => '',
'$feature_expire' => false,
'$expires' => t('Set expiration date'),
'$bbcode' => (($mimetype == 'text/bbcode') ? true : false)
));

View File

@ -176,7 +176,7 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'$webpage' => ITEM_TYPE_WEBPAGE,
'$placeholdpagetitle' => t('Page link title'),
'$pagetitle' => $page_title,
'$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'),
'$writefiles' => (($mimetype == 'text/bbcode') ? perm_is_allowed($owner, get_observer_hash(), 'write_storage') : false),
'$action' => 'item',
'$share' => t('Edit'),
'$bold' => t('Bold'),
@ -184,15 +184,10 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
'$video' => t('Insert Vorbis [.ogg] video'),
'$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'),
'$noloc' => ((get_pconfig($uid, 'system', 'use_browser_location')) ? t('Clear browser location') : ''),
'$wait' => t('Please wait'),
'$weblink' => (($mimetype == 'text/bbcode') ? t('Insert web link') : false),
'$setloc' => false, //t('Set your location'),
'$noloc' => false, //((get_pconfig($uid, 'system', 'use_browser_location')) ? t('Clear browser location') : ''),
'$permset' => t('Permission settings'),
'$ptyp' => $itm[0]['type'],
'$content' => undo_post_tagging($itm[0]['body']),
@ -218,8 +213,6 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'$jotplugins' => $jotplugins,
'$sourceapp' => \App::$sourcename,
'$defexpire' => '',
'$feature_expire' => false,
'$expires' => t('Set expiration date'),
'$bbcode' => (($mimetype == 'text/bbcode') ? true : false)
));

View File

@ -47,7 +47,7 @@ require_once('include/account.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
define ( 'STD_VERSION', '1.4.3' );
define ( 'STD_VERSION', '1.4.4' );
define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1166 );
@ -1543,6 +1543,19 @@ function fix_system_urls($oldurl, $newurl) {
intval($c[0]['channel_id'])
);
$m = q("select abook_id, abook_instance from abook where abook_instance like '%s' and abook_channel = %d",
dbesc('%' . $oldurl . '%'),
intval($c[0]['channel_id'])
);
if($m) {
foreach($m as $mm) {
q("update abook set abook_instance = '%s' where abook_id = %d",
dbesc(str_replace($oldurl,$newurl,$mm['abook_instance'])),
intval($mm['abook_id'])
);
}
}
proc_run('php', 'include/notifier.php', 'refresh_all', $c[0]['channel_id']);
}
}

View File

@ -330,8 +330,19 @@ function bb_map_location($match) {
}
function bb_opentag($match) {
$openclose = (($match[2]) ? '<span class="bb-open" title="' . t('Click to open/close') . '">' . $match[1] . '</span>' : t('Click to open/close'));
$text = (($match[2]) ? $match[2] : $match[1]);
$rnd = mt_rand();
return "<br /><div onclick=\"openClose('opendiv-" . $rnd . "');return false;\" class=\"fakelink\">" . $match[1] . "</div><div id=\"opendiv-" . $rnd . "\" style=\"display: none;\">" . $match[2] . "</div>";
return '<div onclick="openClose(\'opendiv-' . $rnd . '\'); return false;" class="fakelink">' . $openclose . '</div><div id="opendiv-' . $rnd . '" style="display: none;">' . $text . '</div>';
}
function bb_spoilertag($match) {
$openclose = (($match[2]) ? '<span class="bb-spoiler" title="' . t('Click to open/close') . '">' . $match[1] . ' ' . t('spoiler') . '</span>' : t('Click to open/close'));
$text = (($match[2]) ? $match[2] : $match[1]);
$rnd = mt_rand();
return '<div onclick="openClose(\'opendiv-' . $rnd . '\'); return false;" class="fakelink">' . $openclose . '</div><blockquote id="opendiv-' . $rnd . '" style="display: none;">' . $text . '</blockquote>';
}
/**
@ -748,33 +759,34 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
$Text = preg_replace("/\[code\](.*?)\[\/code\]/ism", "$CodeLayout", $Text);
}
// Declare the format for [spoiler] layout
$SpoilerLayout = '<blockquote class="spoiler">$1</blockquote>';
// Check for [spoiler] text
// handle nested quotes
$endlessloop = 0;
while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20))
$Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism", "$SpoilerLayout", $Text);
while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) {
$Text = preg_replace_callback("/\[spoiler\](.*?)\[\/spoiler\]/ism", 'bb_spoilertag', $Text);
}
// Check for [spoiler=Author] text
$t_wrote = t('$1 spoiler');
// handle nested quotes
$endlessloop = 0;
while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20))
$Text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism",
"<br /><strong class=".'"spoiler"'.">" . $t_wrote . "</strong><blockquote class=".'"spoiler"'.">$2</blockquote>",
$Text);
while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20)) {
$Text = preg_replace_callback("/\[spoiler=(.*?)\](.*?)\[\/spoiler\]/ism", 'bb_spoilertag', $Text);
}
// Check for [open] text
$endlessloop = 0;
while ((strpos($Text, "[/open]")!== false) and (strpos($Text, "[open]") !== false) and (++$endlessloop < 20)) {
$Text = preg_replace_callback("/\[open\](.*?)\[\/open\]/ism", 'bb_opentag', $Text);
}
// Check for [open=Title] text
$endlessloop = 0;
while ((strpos($Text, "[/open]")!== false) and (strpos($Text, "[open=") !== false) and (++$endlessloop < 20)) {
$Text = preg_replace_callback("/\[open=(.*?)\](.*?)\[\/open\]/ism", 'bb_opentag', $Text);
}
// Declare the format for [quote] layout
$QuoteLayout = '<blockquote>$1</blockquote>';
@ -792,7 +804,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
$endlessloop = 0;
while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20))
$Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism",
"<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote>$2</blockquote>",
"<span class=".'"bb-quote"'.">" . $t_wrote . "</span><blockquote>$2</blockquote>",
$Text);
// Images

View File

@ -625,3 +625,160 @@ function del_abconfig($chash,$xhash,$family,$key) {
return $r;
}
function get_iconfig(&$item, $family, $key) {
$is_item = false;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
if(array_key_exists('item_id',$item))
$iid = $item['item_id'];
else
$iid = $item['id'];
}
elseif(intval($item))
$iid = $item;
if(! $iid)
return false;
if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) {
foreach($item['iconfig'] as $c) {
if($c['iid'] == $iid && $c['cat'] == $family && $c['k'] == $key)
return $c['v'];
}
}
$r = q("select * from iconfig where iid = %d and cat = '%s' and k = '%s' limit 1",
intval($iid),
dbesc($family),
dbesc($key)
);
if($r) {
$r[0]['v'] = ((preg_match('|^a:[0-9]+:{.*}$|s',$r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
if($is_item)
$item['iconfig'][] = $r[0];
return $r[0]['v'];
}
return false;
}
/**
* set_iconfig(&$item, $family, $key, $value, $sharing = false);
*
* $item - item array or item id. If passed an array the iconfig meta information is
* added to the item structure (which will need to be saved with item_store eventually).
* If passed an id, the DB is updated, but may not be federated and/or cloned.
* $family - namespace of meta variable
* $key - key of meta variable
* $value - value of meta variable
* $sharing - boolean (default false); if true the meta information is propagated with the item
* to other sites/channels, mostly useful when $item is an array and has not yet been stored/delivered.
* If the meta information is added after delivery and you wish it to be shared, it may be necessary to
* alter the item edited timestamp and invoke the delivery process on the updated item. The edited
* timestamp needs to be altered in order to trigger an item_store_update() at the receiving end.
*/
function set_iconfig(&$item, $family, $key, $value, $sharing = false) {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
elseif($item['iconfig']) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
$idx = $x;
}
}
}
$entry = array('cat' => $family, 'k' => $key, 'v' => $value, 'sharing' => $sharing);
if(is_null($idx))
$item['iconfig'][] = $entry;
else
$item['iconfig'][$idx] = $entry;
return $value;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
if(get_iconfig($item, $family, $key) === false) {
$r = q("insert into iconfig( iid, cat, k, v, sharing ) values ( %d, '%s', '%s', '%s', %d ) ",
intval($iid),
dbesc($family),
dbesc($key),
dbesc($dbvalue),
intval($sharing)
);
}
else {
$r = q("update iconfig set v = '%s', sharing = %d where iid = %d and cat = '%s' and k = '%s' ",
dbesc($dbvalue),
intval($sharing),
intval($iid),
dbesc($family),
dbesc($key)
);
}
if(! $r)
return false;
return $value;
}
function del_iconfig(&$item, $family, $key) {
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if(is_array($item['iconfig'])) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
unset($item['iconfig'][$x]);
}
}
}
return true;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
return q("delete from iconfig where iid = %d and cat = '%s' and k = '%s' ",
intval($iid),
dbesc($family),
dbesc($key)
);
}

View File

@ -4,20 +4,26 @@ require_once('include/dba/dba_driver.php');
class dba_mysqli extends dba_driver {
function connect($server, $port, $user,$pass,$db) {
function connect($server,$port,$user,$pass,$db) {
if($port)
$this->db = new mysqli($server,$user,$pass,$db, $port);
else
$this->db = new mysqli($server,$user,$pass,$db);
if(! mysqli_connect_errno()) {
$this->connected = true;
if($this->db->connect_error) {
$this->connected = false;
$this->error = $this->db->connect_error;
if(file_exists('dbfail.out')) {
file_put_contents('dbfail.out', datetime_convert() . "\nConnect: " . $this->error . "\n", FILE_APPEND);
}
return false;
}
if($this->connected) {
else {
$this->connected = true;
return true;
}
$this->error = $this->db->connect_error;
return false;
}
function q($sql) {

View File

@ -482,7 +482,7 @@ function sync_chatrooms($channel,$chatrooms) {
function import_items($channel,$items) {
function import_items($channel,$items,$sync = false) {
if($channel && $items) {
$allow_code = false;
@ -499,6 +499,7 @@ function import_items($channel,$items) {
$deliver = false; // Don't deliver any messages or notifications when importing
foreach($items as $i) {
$item_result = false;
$item = get_item_elements($i,$allow_code);
if(! $item)
continue;
@ -511,7 +512,13 @@ function import_items($channel,$items) {
if($item['edited'] > $r[0]['edited']) {
$item['id'] = $r[0]['id'];
$item['uid'] = $channel['channel_id'];
item_store_update($item,$allow_code,$deliver);
$item_result = item_store_update($item,$allow_code,$deliver);
if($sync && $item['item_wall']) {
// deliver singletons if we have any
if($item_result && $item_result['success']) {
proc_run('php','include/notifier.php','single_activity',$item_result['item_id']);
}
}
continue;
}
}
@ -520,13 +527,19 @@ function import_items($channel,$items) {
$item['uid'] = $channel['channel_id'];
$item_result = item_store($item,$allow_code,$deliver);
}
if($sync && $item['item_wall']) {
// deliver singletons if we have any
if($item_result && $item_result['success']) {
proc_run('php','include/notifier.php','single_activity',$item_result['item_id']);
}
}
}
}
}
function sync_items($channel,$items) {
import_items($channel,$items);
import_items($channel,$items,true);
}
@ -839,7 +852,7 @@ function import_conv($channel,$convs) {
function import_mail($channel,$mails) {
function import_mail($channel,$mails,$sync = false) {
if($channel && $mails) {
foreach($mails as $mail) {
if(array_key_exists('flags',$mail) && in_array('deleted',$mail['flags'])) {
@ -863,12 +876,17 @@ function import_mail($channel,$mails) {
$m['aid'] = $channel['channel_account_id'];
$m['uid'] = $channel['channel_id'];
mail_store($m);
$mail_id = mail_store($m);
if($sync && $mail_id) {
proc_run('php','include/notifier.php','single_mail',$mail_id);
}
}
}
}
function sync_mail($channel,$mails) {
import_mail($channel,$mails,true);
}
function sync_files($channel,$files) {

View File

@ -5616,158 +5616,3 @@ function send_profile_photo_activity($channel,$photo,$profile) {
}
function get_iconfig(&$item, $family, $key) {
$is_item = false;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
if(array_key_exists('item_id',$item))
$iid = $item['item_id'];
else
$iid = $item['id'];
}
elseif(intval($item))
$iid = $item;
if(! $iid)
return false;
if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) {
foreach($item['iconfig'] as $c) {
if($c['iid'] == $iid && $c['cat'] == $family && $c['k'] == $key)
return $c['v'];
}
}
$r = q("select * from iconfig where iid = %d and cat = '%s' and k = '%s' limit 1",
intval($iid),
dbesc($family),
dbesc($key)
);
if($r) {
$r[0]['v'] = ((preg_match('|^a:[0-9]+:{.*}$|s',$r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
if($is_item)
$item['iconfig'][] = $r[0];
return $r[0]['v'];
}
return false;
}
/**
* set_iconfig(&$item, $family, $key, $value, $sharing = false);
*
* $item - item array or item id. If passed an array the iconfig meta information is
* added to the item structure (which will need to be saved with item_store eventually).
* If passed an id, the DB is updated, but may not be federated and/or cloned.
* $family - namespace of meta variable
* $key - key of meta variable
* $value - value of meta variable
* $sharing - boolean (default false); if true the meta information is propagated with the item
* to other sites/channels, mostly useful when $item is an array and has not yet been stored/delivered.
* If the meta information is added after delivery and you wish it to be shared, it may be necessary to
* alter the item edited timestamp and invoke the delivery process on the updated item. The edited
* timestamp needs to be altered in order to trigger an item_store_update() at the receiving end.
*/
function set_iconfig(&$item, $family, $key, $value, $sharing = false) {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
elseif($item['iconfig']) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
$idx = $x;
}
}
}
$entry = array('cat' => $family, 'k' => $key, 'v' => $value, 'sharing' => $sharing);
if(is_null($idx))
$item['iconfig'][] = $entry;
else
$item['iconfig'][$idx] = $entry;
return $value;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
if(get_iconfig($item, $family, $key) === false) {
$r = q("insert into iconfig( iid, cat, k, v, sharing ) values ( %d, '%s', '%s', '%s', %d ) ",
intval($iid),
dbesc($family),
dbesc($key),
dbesc($dbvalue),
intval($sharing)
);
}
else {
$r = q("update iconfig set v = '%s', sharing = %d where iid = %d and cat = '%s' and k = '%s' ",
dbesc($dbvalue),
intval($sharing),
intval($iid),
dbesc($family),
dbesc($key)
);
}
if(! $r)
return false;
return $value;
}
function del_iconfig(&$item, $family, $key) {
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if(is_array($item['iconfig'])) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
unset($item['iconfig'][$x]);
}
}
}
return true;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
return q("delete from iconfig where iid = %d and cat = '%s' and k = '%s' ",
intval($iid),
dbesc($family),
dbesc($key)
);
}

View File

@ -2114,8 +2114,9 @@ function check_channelallowed($hash) {
return $retvalue;
}
function deliverable_singleton($xchan) {
$r = q("select abook_instance from abook where abook_xchan = '%s' limit 1",
function deliverable_singleton($channel_id,$xchan) {
$r = q("select abook_instance from abook where abook_channel = %d and abook_xchan = '%s' limit 1",
intval($channel_id),
dbesc($xchan['xchan_hash'])
);
if($r) {

View File

@ -118,7 +118,7 @@ function notifier_run($argv, $argc){
$normal_mode = true;
$packet_type = 'undefined';
if($cmd === 'mail') {
if($cmd === 'mail' || $cmd === 'single_mail') {
$normal_mode = false;
$mail = true;
$private = true;
@ -280,7 +280,7 @@ function notifier_run($argv, $argc){
logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG);
return;
}
if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed'])) {
if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) || intval($target_item['item_hidden'])) {
logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
return;
}
@ -454,6 +454,7 @@ function notifier_run($argv, $argc){
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false),
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
@ -550,6 +551,7 @@ function notifier_run($argv, $argc){
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false),
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
@ -568,6 +570,19 @@ function notifier_run($argv, $argc){
}
// singleton deliveries by definition 'not got zot'.
// Single deliveries are other federated networks (plugins) and we're essentially
// delivering only to those that have this site url in their abook_instance
// and only from within a sync operation. This means if you post from a clone,
// and a connection is connected to one of your other clones; assuming that hub
// is running it will receive a sync packet. On receipt of this sync packet it
// will invoke a delivery to those connections which are connected to just that
// hub instance.
if($cmd === 'single_mail' || $cmd === 'single_activity') {
continue;
}
// default: zot protocol
$hash = random_string();

View File

@ -1532,35 +1532,6 @@ function prepare_body(&$item,$attach = false) {
$s = sslify($s);
// Look for spoiler
$spoilersearch = '<blockquote class="spoiler">';
// Remove line breaks before the spoiler
while ((strpos($s, "\n".$spoilersearch) !== false))
$s = str_replace("\n".$spoilersearch, $spoilersearch, $s);
while ((strpos($s, "<br />".$spoilersearch) !== false))
$s = str_replace("<br />".$spoilersearch, $spoilersearch, $s);
while ((strpos($s, $spoilersearch) !== false)) {
$pos = strpos($s, $spoilersearch);
$rnd = random_string(8);
$spoilerreplace = '<br /> <span id="spoiler-wrap-'.$rnd.'" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-'.$rnd.'\');">'.sprintf(t('Click to open/close')).'</span>'.
'<blockquote class="spoiler" id="spoiler-'.$rnd.'" style="display: none;">';
$s = substr($s, 0, $pos).$spoilerreplace.substr($s, $pos+strlen($spoilersearch));
}
// Look for quote with author
$authorsearch = '<blockquote class="author">';
while ((strpos($s, $authorsearch) !== false)) {
$pos = strpos($s, $authorsearch);
$rnd = random_string(8);
$authorreplace = '<br /> <span id="author-wrap-'.$rnd.'" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'author-'.$rnd.'\');">'.sprintf(t('Click to open/close')).'</span>'.
'<blockquote class="author" id="author-'.$rnd.'" style="display: block;">';
$s = substr($s, 0, $pos).$authorreplace.substr($s, $pos+strlen($authorsearch));
}
$prep_arr = array(
'item' => $item,
'photo' => $photo,

View File

@ -3121,7 +3121,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
import_conv($channel,$arr['conv']);
if(array_key_exists('mail',$arr) && $arr['mail'])
import_mail($channel,$arr['mail']);
sync_mail($channel,$arr['mail']);
if(array_key_exists('event',$arr) && $arr['event'])
sync_events($channel,$arr['event']);

View File

@ -3,13 +3,54 @@
// Red config utility
if(!file_exists('include/cli_startup.php')) {
echo 'Run config from the top level Hubzilla web directory, as util/config <args>' . PHP_EOL;
exit(1);
}
require_once('include/cli_startup.php');
cli_startup();
if($argc > 3) {
$helpArgs = getopt('h', array('help'));
if (count($helpArgs) === 1) {
echo <<<'EndOfOutput'
Gets, sets, or lists site-wide configuration settings.
Usage: util/config
util/config <family>
util/config <family> <key>
util/config <family> <key> <value>
util/config
Displays all config entries
util/config <family>
Displays all config entries for family (system, database, etc)
util/config <family> <key>
Displays single config entry for the specified family and key
util/config <family> <key> <value>
Set config entry for specified family and key to value and display result
Notes:
Setting config entries which are manually set in .htconfig.php may result
in conflict between database settings and the manual startup settings.
For channel-specific configuration settings, use util/pconfig
Details for configuration options can be found at:
EndOfOutput;
echo ' ' . App::get_baseurl() . '/help/hidden_configs' . PHP_EOL . PHP_EOL;
return;
}
if($argc > 3) {
set_config($argv[1],$argv[2],$argv[3]);
echo "config[{$argv[1]}][{$argv[2]}] = " . printable_config(get_config($argv[1],$argv[2])) . "\n";
}

View File

@ -3,11 +3,57 @@
// Red pconfig utility
if(!file_exists('include/cli_startup.php')) {
echo 'Run pconfig from the top level Hubzilla web directory, as util/pconfig <args>' . PHP_EOL;
exit(1);
}
require_once('include/cli_startup.php');
require_once('include/zot.php');
cli_startup();
$helpArgs = getopt('h', array('help'));
if (count($helpArgs) === 1) {
echo <<<'EndOfOutput'
Gets, sets, or lists personal (per channel) configuration settings.
Usage: util/pconfig
util/pconfig <channel_id>
util/pconfig <channel_id> <family>
util/pconfig <channel_id> <family> <key>
util/pconfig <channel_id> <family> <key> <value>
util/pconfig
List all channel IDs
util/pconfig <channel_id>
Displays all of the the channel's config entries
util/pconfig <channel_id> <family>
Displays all of the channel's config entries for the specified family
(system, database, etc)
util/pconfig <channel_id> <family> <key>
Displays single config entry for the specified family and key
util/pconfig <channel_id> <family> <key> <value>
Set config entry for specified family and key to value and display result
Notes:
For site-wide configuration settings, use util/config
Details for configuration options can be found at:
EndOfOutput;
echo ' ' . App::get_baseurl() . '/help/hidden_configs' . PHP_EOL . PHP_EOL;
return;
}
if($argc > 4) {
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
build_sync_packet($argv[1]);
@ -34,3 +80,11 @@ if($argc == 2) {
}
}
if($argc == 1) {
$r = q("select channel_id, channel_name from channel");
if($r) {
foreach($r as $rr) {
echo sprintf('%4u %s', $rr['channel_id'], $rr['channel_name']) . PHP_EOL;
}
}
}

View File

@ -1 +1 @@
2016-04-25.1377H
2016-04-27.1379H

View File

@ -77,7 +77,7 @@ code {
}
#profile-rotator {
margin: 16px;
padding: 15px 0px 0px 15px;
}
.profile-jot-net {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -265,7 +265,7 @@ function string2bb(element) {
$.fn.bbco_autocomplete = function(type) {
if(type=='bbcode') {
var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer'];
var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'open', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer'];
var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ];
var elements = open_close_elements.concat(open_elements);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,13 @@
@media screen and (min-width: 760px) {
aside {
padding-top: 52px;
}
section {
padding-top: 52px;
}
.navbar-nav > li > a {
padding-top:7px !important;
padding-bottom:3px !important;

View File

@ -68,27 +68,31 @@
</div>
{{/if}}
{{if $visitor}}
<div class="btn-group hidden-xs">
<div class="btn-group hidden-xs hidden-sm">
{{if $writefiles}}
<button id="wall-file-upload" class="btn btn-default btn-sm" title="{{$attach}}" >
<i id="wall-file-upload-icon" class="icon-paper-clip jot-icons"></i>
</button>
{{/if}}
{{if $weblink}}
<button id="profile-link-wrapper" class="btn btn-default btn-sm" title="{{$weblink}}" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;">
<i id="profile-link" class="icon-link jot-icons"></i>
</button>
{{/if}}
</div>
<div class="btn-group hidden-xs hidden-sm">
{{if $setloc}}
<button id="profile-location-wrapper" class="btn btn-default btn-sm" title="{{$setloc}}" onclick="jotGetLocation();return false;">
<i id="profile-location" class="icon-globe jot-icons"></i>
</button>
{{/if}}
{{if $noloc}}
<button id="profile-nolocation-wrapper" class="btn btn-default btn-sm" title="{{$noloc}}" onclick="jotClearLocation();return false;" disabled="disabled">
<i id="profile-nolocation" class="icon-circle-blank jot-icons"></i>
</button>
{{/if}}
{{else}}
<div class="btn-group hidden-xs">
<div class="btn-group hidden-xs hidden-sm">
{{/if}}
{{if $feature_expire}}
<button id="profile-expire-wrapper" class="btn btn-default btn-sm" title="{{$expires}}" onclick="jotGetExpiry();return false;">
@ -111,40 +115,45 @@
</button>
{{/if}}
</div>
{{if $writefiles || $weblink || $setloc || $noloc || $feature_expire || $feature_encrypt || $feature_voting}}
<div class="btn-group visible-xs visible-sm">
<button type="button" id="more-tools" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i id="more-tools-icon" class="icon-caret-down jot-icons"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li class="visible-xs"><a href="#" onclick="preview_post();return false;"><i class="icon-eye-open"></i>&nbsp;{{$preview}}</a></li>
<ul class="dropdown-menu dropdown-menu" role="menu">
{{if $visitor}}
<li class="divider visible-xs"></li>
{{if $writefiles}}<li class="visible-xs"><a id="wall-file-upload-sub" href="#" ><i class="icon-paper-clip"></i>&nbsp;{{$attach}}</a></li>{{/if}}
<li class="visible-xs"><a href="#" onclick="jotGetLink(); return false;"><i class="icon-link"></i>&nbsp;{{$weblink}}</a></li>
{{if $writefiles}}
<li><a id="wall-file-upload-sub" href="#" ><i class="icon-paper-clip"></i>&nbsp;{{$attach}}</a></li>
{{/if}}
{{if $weblink}}
<li><a href="#" onclick="jotGetLink(); return false;"><i class="icon-link"></i>&nbsp;{{$weblink}}</a></li>
{{/if}}
i {{if $setloc}}
<li><a href="#" onclick="jotGetLocation(); return false;"><i class="icon-globe"></i>&nbsp;{{$setloc}}</a></li>
{{/if}}
<li class="divider visible-xs"></li>
<li class="visible-xs visible-sm"><a href="#" onclick="jotGetLocation(); return false;"><i class="icon-globe"></i>&nbsp;{{$setloc}}</a></li>
{{if $noloc}}
<li class="visible-xs visible-sm"><a href="#" onclick="jotClearLocation(); return false;"><i class="icon-circle-blank"></i>&nbsp;{{$noloc}}</a></li>
<li><a href="#" onclick="jotClearLocation(); return false;"><i class="icon-circle-blank"></i>&nbsp;{{$noloc}}</a></li>
{{/if}}
{{/if}}
{{if $feature_expire}}
<li class="visible-xs visible-sm"><a href="#" onclick="jotGetExpiry(); return false;"><i class="icon-eraser"></i>&nbsp;{{$expires}}</a></li>
<li><a href="#" onclick="jotGetExpiry(); return false;"><i class="icon-eraser"></i>&nbsp;{{$expires}}</a></li>
{{/if}}
{{if $feature_encrypt}}
<li class="visible-xs visible-sm"><a href="#" onclick="red_encrypt('{{$cipher}}','#profile-jot-text',$('#profile-jot-text').val());return false;"><i class="icon-key"></i>&nbsp;{{$encrypt}}</a></li>
<li><a href="#" onclick="red_encrypt('{{$cipher}}','#profile-jot-text',$('#profile-jot-text').val());return false;"><i class="icon-key"></i>&nbsp;{{$encrypt}}</a></li>
{{/if}}
{{if $feature_voting}}
<li class="visible-xs visible-sm"><a href="#" onclick="toggleVoting(); return false;"><i id="profile-voting-sub" class="icon-check-empty"></i>&nbsp;{{$voting}}</a></li>
<li><a href="#" onclick="toggleVoting(); return false;"><i id="profile-voting-sub" class="icon-check-empty"></i>&nbsp;{{$voting}}</a></li>
{{/if}}
</ul>
</div>
{{/if}}
</div>
<div id="profile-rotator-wrapper">
<div id="profile-rotator"></div>
</div>
<div id="profile-jot-submit-right" class="btn-group pull-right">
{{if $preview}}
<button class="btn btn-default btn-sm hidden-xs" onclick="preview_post();return false;" title="{{$preview}}">
<button class="btn btn-default btn-sm" onclick="preview_post();return false;" title="{{$preview}}">
<i class="icon-eye-open jot-icons" ></i>
</button>
{{/if}}