aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Daemon/Queue.php1
-rw-r--r--Zotlabs/Daemon/Ratenotif.php8
-rw-r--r--Zotlabs/Lib/Enotify.php6
-rw-r--r--Zotlabs/Module/Admin/Site.php7
-rw-r--r--Zotlabs/Module/Channel.php1
-rw-r--r--Zotlabs/Module/Cloud.php19
-rw-r--r--Zotlabs/Module/Cloud_tiles.php17
-rw-r--r--Zotlabs/Module/Display.php3
-rw-r--r--Zotlabs/Module/Magic.php13
-rw-r--r--Zotlabs/Module/Mail.php4
-rw-r--r--Zotlabs/Module/Network.php19
-rw-r--r--Zotlabs/Module/Owa.php4
-rw-r--r--Zotlabs/Module/Page.php24
-rw-r--r--Zotlabs/Module/Pdledit.php8
-rw-r--r--Zotlabs/Module/Ping.php14
-rw-r--r--Zotlabs/Module/Profile_photo.php10
-rw-r--r--Zotlabs/Module/Pubstream.php62
-rw-r--r--Zotlabs/Module/Search.php4
-rw-r--r--Zotlabs/Module/Settings/Display.php3
-rw-r--r--Zotlabs/Module/Starred.php2
-rw-r--r--Zotlabs/Render/Comanche.php3
-rw-r--r--Zotlabs/Storage/Browser.php20
-rw-r--r--Zotlabs/Widget/Portfolio.php12
-rw-r--r--doc/Widgets.md34
-rw-r--r--include/connections.php2
-rw-r--r--include/conversation.php12
-rwxr-xr-xinclude/items.php8
-rw-r--r--include/message.php6
-rw-r--r--include/nav.php2
-rw-r--r--include/network.php18
-rw-r--r--include/photos.php3
-rw-r--r--include/queue_fn.php9
-rw-r--r--include/text.php2
-rw-r--r--include/zid.php25
-rw-r--r--include/zot.php33
-rwxr-xr-xutil/add_widget_repo11
-rw-r--r--view/css/mod_pubstream.css3
-rw-r--r--view/es-es/hmessages.po10
-rw-r--r--view/es-es/hstrings.php8
-rw-r--r--view/js/mod_pubstream.js5
-rw-r--r--view/pdl/mod_search.pdl1
-rw-r--r--view/pdl/mod_sources.pdl6
-rw-r--r--view/theme/redbasic/css/style.css23
-rwxr-xr-xview/tpl/admin_site.tpl1
-rwxr-xr-xview/tpl/build_query.tpl2
-rw-r--r--view/tpl/cloud_directory.tpl35
-rw-r--r--view/tpl/cloud_header.tpl1
-rw-r--r--view/tpl/pdledit.tpl3
-rwxr-xr-xview/tpl/settings_display.tpl1
49 files changed, 441 insertions, 87 deletions
diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php
index 11cbe4494..17d150250 100644
--- a/Zotlabs/Daemon/Queue.php
+++ b/Zotlabs/Daemon/Queue.php
@@ -12,6 +12,7 @@ class Queue {
require_once('include/items.php');
require_once('include/bbcode.php');
+
if(argc() > 1)
$queue_id = argv(1);
else
diff --git a/Zotlabs/Daemon/Ratenotif.php b/Zotlabs/Daemon/Ratenotif.php
index a94b89004..c7bf79854 100644
--- a/Zotlabs/Daemon/Ratenotif.php
+++ b/Zotlabs/Daemon/Ratenotif.php
@@ -88,6 +88,14 @@ class Ratenotif {
'msg' => json_encode($encoded_item)
));
+
+ $x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ update_queue_item($hash);
+ continue;
+ }
+
$deliver[] = $hash;
if(count($deliver) >= $deliveries_per_process) {
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index e82c11a35..d5798e671 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -778,10 +778,14 @@ class Enotify {
// Call localize_item to get a one line status for activities.
// This should set $item['localized'] to indicate we have a brief summary.
+ // and perhaps $item['shortlocalized'] for an even briefer summary
localize_item($item);
- if($item['localize']) {
+ if($item['shortlocalize']) {
+ $itemem_text = $item['shortlocalize'];
+ }
+ elseif($item['localize']) {
$itemem_text = $item['localize'];
}
else {
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index d3d058c53..2df8b9908 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -61,8 +61,9 @@ class Site {
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
- $techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
- $imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
+ $techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
+ $imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
+ $force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 300);
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
@@ -128,6 +129,7 @@ class Site {
set_config('system','allowed_sites', $allowed_sites);
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
+ set_config('system','force_queue_threshold', $force_queue);
if ($global_directory == '') {
del_config('system', 'directory_submit_url');
} else {
@@ -318,6 +320,7 @@ class Site {
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
'$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")),
+ '$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',300), t("Always defer immediate delivery if queue contains more than this number of entries.")),
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 14d02d873..7c4c900a1 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -332,6 +332,7 @@ class Channel extends \Zotlabs\Web\Controller {
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
'$mid' => $mid,
'$verb' => '',
+ '$net' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
));
diff --git a/Zotlabs/Module/Cloud.php b/Zotlabs/Module/Cloud.php
index 75191a279..d2264092b 100644
--- a/Zotlabs/Module/Cloud.php
+++ b/Zotlabs/Module/Cloud.php
@@ -57,12 +57,21 @@ class Cloud extends \Zotlabs\Web\Controller {
$auth->observer = $ob_hash;
}
+ // if we arrived at this path with any query parameters in the url, build a clean url without
+ // them and redirect.
+ // @fixme if the filename has an ampersand in it AND there are query parameters,
+ // this may not do the right thing.
+
+ if((strpos($_SERVER['QUERY_STRING'],'?') !== false) || (strpos($_SERVER['QUERY_STRING'],'&') !== false && strpos($_SERVER['QUERY_STRING'],'&') === false)) {
+ $path = z_root();
+ if(argc()) {
+ foreach(\App::$argv as $a) {
+ $path .= '/' . $a;
+ }
+ }
+ goaway($path);
+ }
- $_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
- $_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
-
- $_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
- $_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
diff --git a/Zotlabs/Module/Cloud_tiles.php b/Zotlabs/Module/Cloud_tiles.php
new file mode 100644
index 000000000..45124cdfa
--- /dev/null
+++ b/Zotlabs/Module/Cloud_tiles.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace Zotlabs\Module;
+
+class Cloud_tiles extends \Zotlabs\Web\Controller {
+
+ function init() {
+
+ if(intval($_SESSION['cloud_tiles']))
+ $_SESSION['cloud_tiles'] = 0;
+ else
+ $_SESSION['cloud_tiles'] = 1;
+
+ goaway(z_root() . '/' . hex2bin(argv(1)));
+
+ }
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 785274105..266a5b6bf 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -12,6 +12,8 @@ class Display extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
+ $module_format = 'html';
+
if(argc() > 1) {
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
if(! in_array($module_format,['atom','zot','json']))
@@ -188,6 +190,7 @@ class Display extends \Zotlabs\Web\Controller {
'$dend' => '',
'$dbegin' => '',
'$verb' => '',
+ '$net' => '',
'$mid' => $mid
));
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php
index 879085f96..9ad9c951c 100644
--- a/Zotlabs/Module/Magic.php
+++ b/Zotlabs/Module/Magic.php
@@ -146,10 +146,17 @@ class Magic extends \Zotlabs\Web\Controller {
if($x['success']) {
$j = json_decode($x['body'],true);
- if($j['success'] && $j['token']) {
- $x = strpbrk($dest,'?&');
- $args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : '');
+ if($j['success']) {
+ $token = '';
+ if($j['encrypted_token']) {
+ openssl_private_decrypt(base64url_decode($j['encrypted_token']),$token,$channel['channel_prvkey']);
+ }
+ else {
+ $token = $j['token'];
+ }
+ $x = strpbrk($dest,'?&');
+ $args = (($x) ? '&owt=' . $token : '?f=&owt=' . $token) . (($delegate) ? '&delegate=1' : '');
goaway($dest . $args);
}
}
diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php
index 12f3b8152..b58b169d0 100644
--- a/Zotlabs/Module/Mail.php
+++ b/Zotlabs/Module/Mail.php
@@ -19,7 +19,7 @@ class Mail extends \Zotlabs\Web\Controller {
$replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : '');
$subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : '');
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
- $recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : '');
+ $recipient = ((x($_REQUEST,'messageto')) ? notags(trim(urldecode($_REQUEST['messageto']))) : '');
$rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : '');
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE);
@@ -124,7 +124,7 @@ class Mail extends \Zotlabs\Web\Controller {
// We have a local_channel, let send_message use the session channel and save a lookup
$ret = send_message(0, $recipient, $body, $subject, $replyto, $expires, $mimetype, $raw);
-
+
if($ret['success']) {
xchan_mail_query($ret['mail']);
build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index ee736ff42..4deb7c9e8 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -119,6 +119,7 @@ class Network extends \Zotlabs\Web\Controller {
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
+ $net = ((x($_GET,'net')) ? $_GET['net'] : '');
$deftag = '';
@@ -326,7 +327,8 @@ class Network extends \Zotlabs\Web\Controller {
'$tags' => urlencode($hashtags),
'$dend' => $datequery,
'$mid' => '',
- '$verb' => $verb,
+ '$verb' => $verb,
+ '$net' => $net,
'$dbegin' => $datequery2
));
}
@@ -404,7 +406,10 @@ class Network extends \Zotlabs\Web\Controller {
}
-
+
+ $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
+ $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
+
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
$uids = " and item.uid = " . local_channel() . " ";
@@ -441,10 +446,12 @@ class Network extends \Zotlabs\Web\Controller {
$items = q("SELECT item.*, item.id AS item_id, received FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_nets
+ $net_query2
ORDER BY item.received DESC $pager_sql "
);
@@ -469,10 +476,12 @@ class Network extends \Zotlabs\Web\Controller {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal
AND item.parent = item.id
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets
+ $net_query2
ORDER BY $ordering DESC $pager_sql "
);
@@ -482,9 +491,10 @@ class Network extends \Zotlabs\Web\Controller {
// this is an update
$r = q("SELECT item.parent AS item_id FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets "
+ $sql_extra3 $sql_extra $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
@@ -523,13 +533,12 @@ class Network extends \Zotlabs\Web\Controller {
if($parents_str) {
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
- $update_unseen .= " AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
$update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
}
}
else {
if($parents_str) {
- $update_unseen = " AND parent IN ( " . dbesc($parents_str) . " ) AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
+ $update_unseen = " AND parent IN ( " . dbesc($parents_str) . " )";
}
}
}
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php
index 4b0d855c5..d58fd7a41 100644
--- a/Zotlabs/Module/Owa.php
+++ b/Zotlabs/Module/Owa.php
@@ -41,7 +41,9 @@ class Owa extends \Zotlabs\Web\Controller {
$ret['success'] = true;
$token = random_string(32);
\Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
- $ret['token'] = $token;
+ $result = '';
+ openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
+ $ret['encrypted_token'] = base64url_encode($result);
}
}
}
diff --git a/Zotlabs/Module/Page.php b/Zotlabs/Module/Page.php
index c142afe77..5fdd32825 100644
--- a/Zotlabs/Module/Page.php
+++ b/Zotlabs/Module/Page.php
@@ -89,22 +89,30 @@ class Page extends \Zotlabs\Web\Controller {
if(! $ignore_language) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and (( iconfig.k = 'WEBPAGE' and item_type = %d )
- OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
+ and iconfig.k = 'WEBPAGE' and item_type = %d
+ $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($lang_page_id),
- intval(ITEM_TYPE_WEBPAGE),
- intval(ITEM_TYPE_PDL)
+ intval(ITEM_TYPE_WEBPAGE)
+ );
+ }
+ if(! $r) {
+ $r = q("select item.* from item left join iconfig on item.id = iconfig.iid
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ and iconfig.k = 'WEBPAGE' and item_type = %d
+ $sql_options $revision limit 1",
+ intval($u[0]['channel_id']),
+ dbesc($page_id),
+ intval(ITEM_TYPE_WEBPAGE)
);
}
if(! $r) {
+ // no webpage by that name, but we do allow you to load/preview a layout using this module. Try that.
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and (( iconfig.k = 'WEBPAGE' and item_type = %d )
- OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
+ and iconfig.k = 'PDL' AND item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_TYPE_WEBPAGE),
intval(ITEM_TYPE_PDL)
);
}
@@ -129,7 +137,7 @@ class Page extends \Zotlabs\Web\Controller {
}
return;
}
-
+
if($r[0]['title'])
\App::$page['title'] = escape_tags($r[0]['title']);
diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php
index f8af470ac..9b86b599b 100644
--- a/Zotlabs/Module/Pdledit.php
+++ b/Zotlabs/Module/Pdledit.php
@@ -77,8 +77,10 @@ class Pdledit extends \Zotlabs\Web\Controller {
}
$t = get_pconfig(local_channel(),'system',$module);
- if(! $t)
- $t = file_get_contents(theme_include($module));
+ $s = file_get_contents(theme_include($module));
+ if(! $t) {
+ $t = $s;
+ }
if(! $t) {
notice( t('Layout not found.') . EOL);
return '';
@@ -89,7 +91,9 @@ class Pdledit extends \Zotlabs\Web\Controller {
'$mname' => t('Module Name:'),
'$help' => t('Layout Help'),
'$another' => t('Edit another layout'),
+ '$original' => t('System layout'),
'$module' => argv(1),
+ '$src' => $s,
'$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'),
'$submit' => t('Submit')
));
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index c91659f2f..5e2d04c1f 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -169,15 +169,13 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT * FROM item
WHERE uid = %d
AND author_xchan != '%s'
- AND obj_type != '%s'
AND item_unseen = 1
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal
ORDER BY created DESC
LIMIT 300",
intval($sys['channel_id']),
- dbesc(get_observer_hash()),
- dbesc(ACTIVITY_OBJ_FILE)
+ dbesc(get_observer_hash())
);
if($r) {
@@ -313,11 +311,9 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT * FROM item
WHERE item_unseen = 1 and uid = %d $item_normal
AND author_xchan != '%s'
- AND obj_type != '%s'
ORDER BY created DESC limit 300",
intval(local_channel()),
- dbesc($ob_hash),
- dbesc(ACTIVITY_OBJ_FILE)
+ dbesc($ob_hash)
);
if($r) {
@@ -487,11 +483,9 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT id, item_wall FROM item
WHERE item_unseen = 1 and uid = %d
$item_normal
- AND author_xchan != '%s'
- AND obj_type != '%s'",
+ AND author_xchan != '%s'",
intval(local_channel()),
- dbesc($ob_hash),
- dbesc(ACTIVITY_OBJ_FILE)
+ dbesc($ob_hash)
);
if($r) {
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 27e6bc445..411518c61 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -150,6 +150,14 @@ class Profile_photo extends \Zotlabs\Web\Controller {
// If setting for the default profile, unset the profile photo flag from any other photos I own
if($is_default_profile) {
+
+ $r = q("update profile set photo = '%s', thumb = '%s' where is_default = 1 and uid = %d",
+ dbesc(z_root() . '/photo/profile/l/' . local_channel()),
+ dbesc(z_root() . '/photo/profile/m/' . local_channel()),
+ intval(local_channel())
+ );
+
+
$r = q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d
AND resource_id != '%s' AND uid = %d",
intval(PHOTO_NORMAL),
@@ -159,8 +167,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
);
-
-
send_profile_photo_activity($channel,$base_image,$profile);
}
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 15e2d8a74..4224fa3c8 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Module;
require_once('include/conversation.php');
+require_once('include/acl_selectors.php');
class Pubstream extends \Zotlabs\Web\Controller {
@@ -31,6 +32,48 @@ class Pubstream extends \Zotlabs\Web\Controller {
$item_normal_update = item_normal_update();
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
+ $net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : '');
+
+
+ if(local_channel() && (! $update)) {
+
+ $channel = \App::get_channel();
+
+ $channel_acl = array(
+ 'allow_cid' => $channel['channel_allow_cid'],
+ 'allow_gid' => $channel['channel_allow_gid'],
+ 'deny_cid' => $channel['channel_deny_cid'],
+ 'deny_gid' => $channel['channel_deny_gid']
+ );
+
+ $x = array(
+ 'is_owner' => true,
+ 'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
+ 'default_location' => $channel['channel_location'],
+ 'nickname' => $channel['channel_address'],
+ 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
+
+ 'acl' => populate_acl($channel_acl),
+ 'permissions' => $channel_acl,
+ 'bang' => '',
+ 'visitor' => true,
+ 'profile_uid' => local_channel(),
+ 'return_path' => 'channel/' . $channel['channel_address'],
+ 'expanded' => true,
+ 'editor_autocomplete' => true,
+ 'bbco_autocomplete' => 'bbcode',
+ 'bbcode' => true,
+ 'jotnets' => true
+ );
+
+ $o = '<div id="jot-popup">';
+ $o .= status_editor($a,$x);
+ $o .= '</div>';
+ }
+
+
+
+
if(! $update && !$load) {
@@ -81,7 +124,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$tags' => '',
'$dend' => '',
'$mid' => $mid,
- '$verb' => '',
+ '$verb' => '',
+ '$net' => $net,
'$dbegin' => ''
));
}
@@ -112,6 +156,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$page_mode = 'list';
else
$page_mode = 'client';
+
+
+ $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
+ $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
$simple_update = (($update) ? " and item.item_unseen = 1 " : '');
@@ -134,9 +182,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($mid) {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE mid like '%s' $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets LIMIT 1",
+ $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
);
}
@@ -144,10 +193,11 @@ class Pubstream extends \Zotlabs\Web\Controller {
// Fetch a page full of parent items for this page
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE true $uids $item_normal
AND item.parent = item.id
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets
+ $sql_extra3 $sql_extra $sql_nets $net_query2
ORDER BY $ordering DESC $pager_sql "
);
}
@@ -156,19 +206,21 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($mid) {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE mid like '%s' $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets LIMIT 1",
+ $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
);
}
else {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE true $uids $item_normal_update
AND item.parent = item.id $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets"
+ $sql_extra3 $sql_extra $sql_nets $net_query2"
);
}
$_SESSION['loadtime'] = datetime_convert();
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php
index 37e9a336f..a572a5a42 100644
--- a/Zotlabs/Module/Search.php
+++ b/Zotlabs/Module/Search.php
@@ -56,8 +56,7 @@ class Search extends \Zotlabs\Web\Controller {
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
- if((! local_channel()) || (! feature_enabled(local_channel(),'savedsearch')))
- $o .= search($search,'search-box','/search',((local_channel()) ? true : false));
+ $o .= search($search,'search-box','/search',((local_channel()) ? true : false));
if(strpos($search,'#') === 0) {
$tag = true;
@@ -138,6 +137,7 @@ class Search extends \Zotlabs\Web\Controller {
'$tags' => '',
'$mid' => '',
'$verb' => '',
+ '$net' => '',
'$dend' => '',
'$dbegin' => ''
));
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index a444d28a2..e1ea0e3e5 100644
--- a/Zotlabs/Module/Settings/Display.php
+++ b/Zotlabs/Module/Settings/Display.php
@@ -23,6 +23,7 @@ class Display {
$mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : '');
$preload_images = ((x($_POST,'preload_images')) ? intval($_POST['preload_images']) : 0);
+ $channel_menu = ((x($_POST,'channel_menu')) ? intval($_POST['channel_menu']) : 0);
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0);
@@ -63,6 +64,7 @@ class Display {
set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height);
set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height);
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
+ set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
$newschema = '';
if($theme){
@@ -217,6 +219,7 @@ class Display {
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')),
'$nosmile' => array('nosmile', t("Show emoticons (smilies) as images"), 1-intval($nosmile), '', $yes_no),
+ '$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ],
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
'$layout_editor' => t('System Page Layout Editor - (advanced)'),
diff --git a/Zotlabs/Module/Starred.php b/Zotlabs/Module/Starred.php
index 4f1d99ec6..8349ae25c 100644
--- a/Zotlabs/Module/Starred.php
+++ b/Zotlabs/Module/Starred.php
@@ -16,7 +16,7 @@ class Starred extends \Zotlabs\Web\Controller {
if(! $message_id)
killme();
- $r = q("SELECT item_flags FROM item WHERE uid = %d AND id = %d LIMIT 1",
+ $r = q("SELECT item_starred FROM item WHERE uid = %d AND id = %d LIMIT 1",
intval(local_channel()),
intval($message_id)
);
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index 8831bd117..78ca870a7 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -469,8 +469,11 @@ class Comanche {
if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php'))
require_once('Zotlabs/SiteWidget/' . $clsname . '.php');
+ elseif(file_exists('widget/' . $clsname . '/' . $clsname . '.php'))
+ require_once('widget/' . $clsname . '/' . $clsname . '.php');
elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php'))
require_once('Zotlabs/Widget/' . $clsname . '.php');
+
if(class_exists($nsname)) {
$x = new $nsname;
$f = 'widget';
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 6f6f4a292..b5c3ac1cf 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -173,6 +173,7 @@ class Browser extends DAV\Browser\Plugin {
$displayName = $this->escapeHTML($displayName);
$type = $this->escapeHTML($type);
+
$icon = '';
if ($this->enableAssets) {
@@ -196,12 +197,28 @@ class Browser extends DAV\Browser\Plugin {
}
}
+ $photo_icon = '';
+
+ if(strpos($type,'image/') === 0 && $attachHash) {
+ $r = q("select resource_id, imgscale from photo where resource_id = '%s' and imgscale in ( %d, %d ) order by imgscale asc limit 1",
+ dbesc($attachHash),
+ intval(PHOTO_RES_320),
+ intval(PHOTO_RES_PROFILE_80)
+ );
+ if($r) {
+ $photo_icon = $r[0]['resource_id'] . '-' . $r[0]['imgscale'];
+ }
+ }
+
+
+
$attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>";
// put the array for this file together
$ft['attachId'] = $this->findAttachIdByHash($attachHash);
$ft['fileStorageUrl'] = substr($fullPath, 0, strpos($fullPath, "cloud/")) . "filestorage/" . $this->auth->getCurrentUser();
$ft['icon'] = $icon;
+ $ft['photo_icon'] = $photo_icon;
$ft['attachIcon'] = (($size) ? $attachIcon : '');
// @todo Should this be an item value, not a global one?
$ft['is_owner'] = $is_owner;
@@ -221,6 +238,7 @@ class Browser extends DAV\Browser\Plugin {
$this->server->emit('onHTMLActionsPanel', array($parent, &$output, $path));
}
+
$html .= replace_macros(get_markup_template('cloud.tpl'), array(
'$header' => t('Files') . ": " . $this->escapeHTML($path) . "/",
'$total' => t('Total'),
@@ -230,6 +248,8 @@ class Browser extends DAV\Browser\Plugin {
'$upload' => t('Upload'),
'$is_owner' => $is_owner,
'$parentpath' => $parentpath,
+ '$cpath' => bin2hex(\App::$query_string),
+ '$tiles' => intval($_SESSION['cloud_tiles']),
'$entries' => $f,
'$name' => t('Name'),
'$type' => t('Type'),
diff --git a/Zotlabs/Widget/Portfolio.php b/Zotlabs/Widget/Portfolio.php
index 216ca952c..0cd043246 100644
--- a/Zotlabs/Widget/Portfolio.php
+++ b/Zotlabs/Widget/Portfolio.php
@@ -20,6 +20,15 @@ class Portfolio {
$album = $args['album'];
if($args['title'])
$title = $args['title'];
+ if(array_key_exists('mode', $args) && isset($args['mode']))
+ $mode = $args['mode'];
+ else
+ $mode = '';
+ if(array_key_exists('count', $args) && isset($args['count']))
+ $count = $args['count'];
+ else
+ $count = '';
+
/**
* This may return incorrect permissions if you have multiple directories of the same name.
@@ -92,6 +101,8 @@ class Portfolio {
$tpl = get_markup_template('photo_album_portfolio.tpl');
$o .= replace_macros($tpl, array(
'$photos' => $photos,
+ '$mode' => $mode,
+ '$count' => $count,
'$album' => (($title) ? $title : $album),
'$album_id' => rand(),
'$album_edit' => array(t('Edit Album'), $album_edit),
@@ -106,3 +117,4 @@ class Portfolio {
}
}
+
diff --git a/doc/Widgets.md b/doc/Widgets.md
index 4ad899a0f..7761b1833 100644
--- a/doc/Widgets.md
+++ b/doc/Widgets.md
@@ -129,14 +129,44 @@ Some/many of these widgets have restrictions which may restrict the type of page
Creating New Widgets
====================
-If you want a widget named 'slugfish', create widget/slugfish.php containing
+### Class Widgets
+
+To create a class-based widget named 'slugfish' create a file with the following contents:
+
+````
+<?php
+
+namespace Zotlabs\Widget;
+
+
+class Slugfish {
+
+ function widget($args) {
+
+ ... widget code goes here.
+ ... The function returns a string which is the HTML content of the widget.
+ ... $args is a named array which is passed any [var] variables from the layout editor
+ ... For instance [widget=slugfish][var=count]3[/var][/widget] will populate $args with
+ ... [ 'count' => 3 ]
+
+ }
+
+````
+
+The resultant file may be placed in widget/Slugfish/Slugfish.php , or Zotlabs/SiteWidgets/Slugfish.php . It also may be linked from a git repository using util/add_widget_repo.
+
+
+
+Traditional function based widget:
+
+If you want a widget named 'slugfish', create widget/widget_slugfish.php containing
<?php
function widget_slugfish($args) {
- .. widget code goes here
+ .. widget code goes here. See above information for class-based widgets for details.
}
diff --git a/include/connections.php b/include/connections.php
index 60bce018e..e9d7daa2d 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -369,7 +369,7 @@ function contact_remove($channel_id, $abook_id) {
return false;
- $r = q("select * from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d",
+ $r = q("select id from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d",
dbesc($abook['abook_xchan']),
dbesc($abook['abook_xchan']),
intval($channel_id)
diff --git a/include/conversation.php b/include/conversation.php
index f395b2cbe..5ff8b3864 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -162,6 +162,18 @@ function localize_item(&$item){
elseif(activity_match($item['verb'],ACTIVITY_DISLIKE)) {
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
}
+
+ // short version, in notification strings the author will be displayed separately
+
+ if(activity_match($item['verb'],ACTIVITY_LIKE)) {
+ $shortbodyverb = t('likes %1$s\'s %2$s');
+ }
+ elseif(activity_match($item['verb'],ACTIVITY_DISLIKE)) {
+ $shortbodyverb = t('doesn\'t like %1$s\'s %2$s');
+ }
+
+ $item['shortlocalize'] = sprintf($bodyverb, $objauthor, $plink);
+
$item['body'] = $item['localize'] = sprintf($bodyverb, $author, $objauthor, $plink);
if($Bphoto != "")
$item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]';
diff --git a/include/items.php b/include/items.php
index dd8b394d3..08e53553b 100755
--- a/include/items.php
+++ b/include/items.php
@@ -173,19 +173,19 @@ function comments_are_now_closed($item) {
function item_normal() {
return " and item.item_hidden = 0 and item.item_type = 0 and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
- and item.item_blocked = 0 ";
+ and item.item_blocked = 0 and item.obj_type != '" . ACTIVITY_OBJ_FILE . "' ";
}
function item_normal_search() {
return " and item.item_hidden = 0 and item.item_type in (0,3,6) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
- and item.item_blocked = 0 ";
+ and item.item_blocked = 0 and item.obj_type != '" . ACTIVITY_OBJ_FILE . "' ";
}
function item_normal_update() {
return " and item.item_hidden = 0 and item.item_type = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
- and item.item_blocked = 0 ";
+ and item.item_blocked = 0 and item.obj_type != '" . ACTIVITY_OBJ_FILE . "' ";
}
@@ -201,7 +201,7 @@ function is_item_normal($item) {
if(intval($item['item_hidden']) || intval($item['item_type']) || intval($item['item_deleted'])
|| intval($item['item_unpublished']) || intval($item['item_delayed']) || intval($item['item_pending_remove'])
- || intval($item['item_blocked']))
+ || intval($item['item_blocked']) || ($item['obj_type'] == ACTIVITY_OBJ_FILE))
return false;
return true;
diff --git a/include/message.php b/include/message.php
index 3f003e020..477c7172c 100644
--- a/include/message.php
+++ b/include/message.php
@@ -381,7 +381,7 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
$chans[] = $s;
}
- $c = q("select * from xchan where xchan_hash in (" . implode(',',$chans) . ")");
+ $c = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$chans)) . ")");
foreach($r as $k => $rr) {
$r[$k]['from'] = find_xchan_in_array($rr['from_xchan'],$c);
@@ -420,7 +420,7 @@ function private_messages_fetch_message($channel_id, $messageitem_id, $updatesee
$chans[] = $s;
}
- $c = q("select * from xchan where xchan_hash in (" . implode(',',$chans) . ")");
+ $c = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$chans)) . ")");
foreach($messages as $k => $message) {
$messages[$k]['from'] = find_xchan_in_array($message['from_xchan'],$c);
@@ -545,7 +545,7 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda
}
- $c = q("select * from xchan where xchan_hash in (" . implode(',',$chans) . ")");
+ $c = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$chans)) . ")");
foreach($messages as $k => $message) {
$messages[$k]['from'] = find_xchan_in_array($message['from_xchan'],$c);
diff --git a/include/nav.php b/include/nav.php
index 89947e270..af0ebbae2 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -312,7 +312,7 @@ EOT;
'$pleasewait' => t('Please wait...'),
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps,
- '$channel_menu' => get_config('system','channel_menu'),
+ '$channel_menu' => get_pconfig(App::$profile_uid,'system','channel_menu',get_config('system','channel_menu')),
'$channel_thumb' => ((App::$profile) ? App::$profile['thumb'] : ''),
'$channel_apps' => $channel_apps,
'$addapps' => t('Add Apps'),
diff --git a/include/network.php b/include/network.php
index 2f29a70c4..2caf29ab5 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1433,11 +1433,27 @@ function scrape_feed($url) {
-function do_delivery($deliveries) {
+
+
+function do_delivery($deliveries, $force = false) {
+
+ // $force is set if a site that wasn't responding suddenly returns to life.
+ // Try and shove through everything going to that site while it's responding.
if(! (is_array($deliveries) && count($deliveries)))
return;
+
+ $x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300)) && (! $force)) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ foreach($deliveries as $d) {
+ update_queue_item($d);
+ }
+ return;
+ }
+
+
$interval = ((get_config('system','delivery_interval') !== false)
? intval(get_config('system','delivery_interval')) : 2 );
diff --git a/include/photos.php b/include/photos.php
index 5de68f162..503a725cd 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -75,6 +75,9 @@ function photo_upload($channel, $observer, $args) {
$imagedata = @file_get_contents($tmp_name);
@unlink($tmp_name);
}
+ else {
+ $imagedata = @file_get_contents($args['os_syspath']);
+ }
}
else {
$imagedata = @file_get_contents($args['os_syspath']);
diff --git a/include/queue_fn.php b/include/queue_fn.php
index c9179b953..5fb0d5f1e 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -42,7 +42,7 @@ function update_queue_item($id, $add_priority = 0) {
$next = datetime_convert('UTC','UTC','now + 1 hour');
}
else {
- $next = datetime_convert('UTC','UTC','now + 15 minutes');
+ $next = datetime_convert('UTC','UTC','now + ' . intval($add_priority) . ' minutes');
}
q("UPDATE outq SET outq_updated = '%s',
@@ -158,6 +158,8 @@ function queue_deliver($outq, $immediate = false) {
}
}
+
+
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
@@ -198,14 +200,15 @@ function queue_deliver($outq, $immediate = false) {
}
}
if($piled_up) {
- do_delivery($piled_up);
+ // call do_delivery() with the force flag
+ do_delivery($piled_up, true);
}
}
}
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($outq['outq_posturl']);
+ update_queue_item($outq['outq_hash'],10);
}
return;
}
diff --git a/include/text.php b/include/text.php
index d81b59d75..746c35679 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2160,7 +2160,7 @@ function xchan_mail_query(&$item) {
if(count($arr)) {
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
- where xchan_hash in (" . implode(',', $arr) . ") and hubloc_primary = 1");
+ where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1");
}
if($chans) {
$item['from'] = find_xchan_in_array($item['from_xchan'],$chans);
diff --git a/include/zid.php b/include/zid.php
index ce9f70385..5ade6b0f8 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -89,10 +89,35 @@ function strip_zids($s) {
return preg_replace('/[\?&]zid=(.*?)(&|$)/ism','$2',$s);
}
+function strip_owt($s) {
+ return preg_replace('/[\?&]owt=(.*?)(&|$)/ism','$2',$s);
+}
+
function strip_zats($s) {
return preg_replace('/[\?&]zat=(.*?)(&|$)/ism','$2',$s);
}
+function strip_auth_query_params() {
+
+ $_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
+ $_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
+ $_SERVER['QUERY_STRING'] = strip_owt($_SERVER['QUERY_STRING']);
+
+ $_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
+ $_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
+ $_SERVER['REQUEST_URI'] = strip_owt($_SERVER['REQUEST_URI']);
+
+
+ $_ENV['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_ENV['QUERY_STRING']);
+ $_ENV['QUERY_STRING'] = strip_zids($_ENV['QUERY_STRING']);
+ $_ENV['QUERY_STRING'] = strip_owt($_ENV['QUERY_STRING']);
+
+ $_ENV['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_ENV['REQUEST_URI']);
+ $_ENV['REQUEST_URI'] = strip_zids($_ENV['REQUEST_URI']);
+ $_ENV['REQUEST_URI'] = strip_owt($_ENV['REQUEST_URI']);
+
+}
+
/**
* zidify_callback() and zidify_links() work together to turn any HTML a tags with class="zrl" into zid links
diff --git a/include/zot.php b/include/zot.php
index dad30dbb0..5764bb99a 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -285,6 +285,16 @@ function zot_refresh($them, $channel = null, $force = false) {
return false;
}
+ $s = q("select site_dead from site where site_url = '%s' limit 1",
+ dbesc($url)
+ );
+
+ if($s && intval($s[0]['site_dead']) && (! $force)) {
+ logger('zot_refresh: site ' . $url . ' is marked dead and force flag is not set. Cancelling operation.');
+ return false;
+ }
+
+
$token = random_string();
$postvars = [];
@@ -3138,6 +3148,15 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
'msg' => json_encode($info)
));
+
+ $x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ update_queue_item($hash);
+ continue;
+ }
+
+
Zotlabs\Daemon\Master::Summon(array('Deliver', $hash));
$total = $total - 1;
@@ -3649,6 +3668,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
$disallowed = array('id','aid','uid','guid');
foreach($arr['profile'] as $profile) {
+
$x = q("select * from profile where profile_guid = '%s' and uid = %d limit 1",
dbesc($profile['profile_guid']),
intval($channel['channel_id'])
@@ -3671,6 +3691,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(in_array($k,$disallowed))
continue;
+ if($profile['is_default'] && in_array($k,['photo','thumb']))
+ continue;
+
if($k === 'name')
$clean['fullname'] = $v;
elseif($k === 'with')
@@ -3868,7 +3891,7 @@ function zot_reply_message_request($data) {
if ($messages) {
$env_recips = null;
- $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_error = 0 and hubloc_deleted = 0",
+ $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_error = 0 and hubloc_deleted = 0 and site.site_dead = 0 ",
dbesc($sender_hash)
);
if (! $r) {
@@ -3901,6 +3924,14 @@ function zot_reply_message_request($data) {
'msg' => $data_packet
));
+
+ $x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ update_queue_item($hash);
+ continue;
+ }
+
/*
* invoke delivery to send out the notify packet
*/
diff --git a/util/add_widget_repo b/util/add_widget_repo
index cb3112626..4cfd6a170 100755
--- a/util/add_widget_repo
+++ b/util/add_widget_repo
@@ -5,17 +5,6 @@ if [ $# -lt 2 ]; then
exit 1
fi
-#if [[ $1 != *"//github.com/redmatrix"* && $3 != 'insecure' ]]; then
-# echo "";
-# echo "This is NOT an official project repository.";
-# echo "In order to protect you from unverified and";
-# echo "possibly malicious content, this repository";
-# echo "will not be linked to your site unless you";
-# echo "append the word 'insecure' to the command.";
-# echo "";
-# exit 1
-#fi
-
mkdir -p extend/widget/$2
mkdir widget > /dev/null 2>&1
git clone $1 extend/widget/$2
diff --git a/view/css/mod_pubstream.css b/view/css/mod_pubstream.css
new file mode 100644
index 000000000..dde242d4e
--- /dev/null
+++ b/view/css/mod_pubstream.css
@@ -0,0 +1,3 @@
+#jot-popup {
+ display: none;
+}
diff --git a/view/es-es/hmessages.po b/view/es-es/hmessages.po
index 99cc86107..67be6a829 100644
--- a/view/es-es/hmessages.po
+++ b/view/es-es/hmessages.po
@@ -14,7 +14,7 @@ msgstr ""
"Project-Id-Version: Redmatrix\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-19 12:01+0200\n"
-"PO-Revision-Date: 2017-10-20 10:42+0000\n"
+"PO-Revision-Date: 2017-10-28 10:20+0000\n"
"Last-Translator: Manuel Jiménez Friaza <mjfriaza@openmailbox.org>\n"
"Language-Team: Spanish (Spain) (http://www.transifex.com/Friendica/red-matrix/language/es_ES/)\n"
"MIME-Version: 1.0\n"
@@ -3476,7 +3476,7 @@ msgstr "Podría reducir la actividad de spam"
#: ../../Zotlabs/Module/Settings/Channel.php:512
msgid "Default Privacy Group"
-msgstr "Grupo de canales por defecto"
+msgstr "Grupo de canales predeterminado"
#: ../../Zotlabs/Module/Settings/Channel.php:514
msgid "Use my default audience setting for the type of object published"
@@ -4803,7 +4803,7 @@ msgstr "Tipo"
#: ../../Zotlabs/Module/Wiki.php:211
msgid "Any&nbsp;type"
-msgstr "Cualquier tipo"
+msgstr "Cualquier&nbsp;tipo"
#: ../../Zotlabs/Module/Wiki.php:218
msgid "Lock content type"
@@ -7294,7 +7294,7 @@ msgstr "0. Principiante/Básico"
#: ../../Zotlabs/Lib/Techlevels.php:11
msgid "1. Novice - not skilled but willing to learn"
-msgstr "1. Novicio - no está preparado pero está dispuestos a aprender"
+msgstr "1. Novato: no cualificado, pero dispuesto a aprender"
#: ../../Zotlabs/Lib/Techlevels.php:12
msgid "2. Intermediate - somewhat comfortable"
@@ -7310,7 +7310,7 @@ msgstr "4. Experto - Puedo escribir código informático"
#: ../../Zotlabs/Lib/Techlevels.php:15
msgid "5. Wizard - I probably know more than you do"
-msgstr "5. Asistente - probablemente sé más que tú"
+msgstr "5. Colaborador - probablemente sé más que tú"
#: ../../Zotlabs/Lib/Apps.php:225
msgid "Site Admin"
diff --git a/view/es-es/hstrings.php b/view/es-es/hstrings.php
index 0e2a03bb5..f5cfecb5a 100644
--- a/view/es-es/hstrings.php
+++ b/view/es-es/hstrings.php
@@ -697,7 +697,7 @@ App::$strings["This website does not expire imported content."] = "Este sitio we
App::$strings["The website limit takes precedence if lower than your limit."] = "El límite del sitio web tiene prioridad si es inferior a su propio límite.";
App::$strings["Maximum Friend Requests/Day:"] = "Máximo de solicitudes de amistad por día:";
App::$strings["May reduce spam activity"] = "Podría reducir la actividad de spam";
-App::$strings["Default Privacy Group"] = "Grupo de canales por defecto";
+App::$strings["Default Privacy Group"] = "Grupo de canales predeterminado";
App::$strings["Use my default audience setting for the type of object published"] = "Usar los ajustes de mi audiencia predeterminada para el tipo de publicación";
App::$strings["Channel permissions category:"] = "Categoría de los permisos del canal:";
App::$strings["Default Permissions Group"] = "Grupo de permisos predeterminados";
@@ -1002,7 +1002,7 @@ App::$strings["Markdown"] = "Markdown";
App::$strings["BBcode"] = "BBcode";
App::$strings["Text"] = "Texto";
App::$strings["Type"] = "Tipo";
-App::$strings["Any&nbsp;type"] = "Cualquier tipo";
+App::$strings["Any&nbsp;type"] = "Cualquier&nbsp;tipo";
App::$strings["Lock content type"] = "Tipo de contenido bloqueado";
App::$strings["Create a status post for this wiki"] = "Crear un mensaje de estado para este wiki";
App::$strings["Edit Wiki Name"] = "Editar el nombre del wiki";
@@ -1585,11 +1585,11 @@ App::$strings["Enter your email address and submit to have your password reset.
App::$strings["Email Address"] = "Dirección de correo electrónico";
App::$strings["Mark all seen"] = "Marcar todo como visto";
App::$strings["0. Beginner/Basic"] = "0. Principiante/Básico";
-App::$strings["1. Novice - not skilled but willing to learn"] = "1. Novicio - no está preparado pero está dispuestos a aprender";
+App::$strings["1. Novice - not skilled but willing to learn"] = "1. Novato: no cualificado, pero dispuesto a aprender";
App::$strings["2. Intermediate - somewhat comfortable"] = "2. Intermedio - algo cómodo";
App::$strings["3. Advanced - very comfortable"] = "3. Avanzado - muy cómodo";
App::$strings["4. Expert - I can write computer code"] = "4. Experto - Puedo escribir código informático";
-App::$strings["5. Wizard - I probably know more than you do"] = "5. Asistente - probablemente sé más que tú";
+App::$strings["5. Wizard - I probably know more than you do"] = "5. Colaborador - probablemente sé más que tú";
App::$strings["Site Admin"] = "Administrador del sitio";
App::$strings["Report Bug"] = "Informe de errores";
App::$strings["View Bookmarks"] = "Ver los marcadores";
diff --git a/view/js/mod_pubstream.js b/view/js/mod_pubstream.js
new file mode 100644
index 000000000..7e24a7f86
--- /dev/null
+++ b/view/js/mod_pubstream.js
@@ -0,0 +1,5 @@
+$(document).ready(function() {
+ $(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
+ // make auto-complete work in more places
+ $(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
+});
diff --git a/view/pdl/mod_search.pdl b/view/pdl/mod_search.pdl
index 8353b4571..e69657dac 100644
--- a/view/pdl/mod_search.pdl
+++ b/view/pdl/mod_search.pdl
@@ -1,5 +1,4 @@
[region=aside]
-[comment][widget=sitesearch][/widget][/comment]
[/region]
[region=right_aside]
[widget=notifications][/widget]
diff --git a/view/pdl/mod_sources.pdl b/view/pdl/mod_sources.pdl
new file mode 100644
index 000000000..53a3ac9e5
--- /dev/null
+++ b/view/pdl/mod_sources.pdl
@@ -0,0 +1,6 @@
+[region=aside]
+[widget=settings_menu][/widget]
+[/region]
+[region=right_aside]
+[widget=notifications][/widget]
+[/region]
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index aea75df65..9f9ece7c3 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1695,3 +1695,26 @@ dl.bb-dl > dd > li {
#permcat-index {
margin: 10px;
}
+
+.cloud-container {
+ float: left;
+ width: 80px;
+ height: 80px;
+ margin: 5px;
+}
+
+.cloud-icon i {
+ font-size: 48px;
+}
+
+.cloud-icon img {
+ width: 48px;
+ height: 48px;
+}
+
+.cloud-title {
+ width: 78px;
+ height: 36px;
+ overflow: hidden;
+}
+
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index d6ff34f93..6b39e844a 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -88,6 +88,7 @@
{{include file="field_input.tpl" field=$timeout}}
{{include file="field_input.tpl" field=$delivery_interval}}
{{include file="field_input.tpl" field=$delivery_batch_count}}
+ {{include file="field_input.tpl" field=$force_queue}}
{{include file="field_input.tpl" field=$poll_interval}}
{{include file="field_input.tpl" field=$maxloadavg}}
{{include file="field_input.tpl" field=$abandon_days}}
diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl
index a76d4e549..bfe5c8a08 100755
--- a/view/tpl/build_query.tpl
+++ b/view/tpl/build_query.tpl
@@ -29,6 +29,7 @@
var bParam_dbegin = "{{$dbegin}}";
var bParam_mid = "{{$mid}}";
var bParam_verb = "{{$verb}}";
+ var bParam_net = "{{$net}}";
function buildCmd() {
var udargs = ((page_load) ? "/load" : "");
@@ -57,6 +58,7 @@
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;
if(bParam_verb != "") bCmd = bCmd + "&verb=" + bParam_verb;
+ if(bParam_net != "") bCmd = bCmd + "&net=" + bParam_net;
if(bParam_page != 1) bCmd = bCmd + "&page=" + bParam_page;
return(bCmd);
}
diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl
index e8ae6a590..40278661f 100644
--- a/view/tpl/cloud_directory.tpl
+++ b/view/tpl/cloud_directory.tpl
@@ -1,4 +1,38 @@
<div id="cloud-drag-area" class="section-content-wrapper-np">
+ {{if $tiles}}
+
+ {{if $parentpath}}
+ <div class="cloud-container" >
+ <div class="cloud-icon"><a href="{{$parentpath.path}}">
+ <i class="fa fa-fw fa-level-up" ></i>
+ </a>
+ </div>
+ <div class="cloud-title"><a href="{{$parentpath.path}}">..</a>
+ </div>
+ </div>
+ {{/if}}
+
+ {{foreach $entries as $item}}
+ <div class="cloud-container">
+ <div class="cloud-icon"><a href="{{$item.fullPath}}">
+ {{if $item.photo_icon}}
+ <img src="photo/{{$item.photo_icon}}" title="{{$item.type}}" >
+ {{else}}
+ <i class="fa fa-fw {{$item.iconFromType}}" title="{{$item.type}}"></i>
+ {{/if}}
+ </a>
+ </div>
+ <div class="cloud-title"><a href="{{$item.fullPath}}">
+ {{$item.displayName}}
+ </a>
+ </div>
+ {{if $item.is_owner}}
+
+ {{/if}}
+ </div>
+ {{/foreach}}
+ <div class="clear"></div>
+ {{else}}
<table id="cloud-index">
<tr>
<th width="1%"></th>
@@ -42,4 +76,5 @@
{{/foreach}}
</table>
+ {{/if}}
</div>
diff --git a/view/tpl/cloud_header.tpl b/view/tpl/cloud_header.tpl
index c1e589341..468f2febc 100644
--- a/view/tpl/cloud_header.tpl
+++ b/view/tpl/cloud_header.tpl
@@ -1,6 +1,7 @@
<div class="section-title-wrapper">
{{if $actionspanel}}
<div class="pull-right">
+ <a href="cloud_tiles/{{$cpath}}" class="btn btn-sm btn-outline-secondary"><i class="fa fa-fw {{if $tiles}}fa-list-ul{{else}}fa-table{{/if}}"></i></a>
{{if $is_owner}}
<a href="/sharedwithme" class="btn btn-sm btn-outline-secondary"><i class="fa fa-cloud-download"></i>&nbsp;{{$shared}}</a>
{{/if}}
diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl
index 2ea89b6c1..66b8209c9 100644
--- a/view/tpl/pdledit.tpl
+++ b/view/tpl/pdledit.tpl
@@ -11,7 +11,10 @@
<br />
<br />
+<div class="descriptive-text">{{$original}}</div>
+<pre><code>{{$src}}</code></pre>
+<br />
<form action="pdledit" method="post" >
<input type="hidden" name="module" value="{{$module}}" />
diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl
index d8c1ac7aa..d1e6e0609 100755
--- a/view/tpl/settings_display.tpl
+++ b/view/tpl/settings_display.tpl
@@ -64,6 +64,7 @@
{{include file="field_input.tpl" field=$channel_divmore_height}}
{{include file="field_input.tpl" field=$network_divmore_height}}
{{include file="field_checkbox.tpl" field=$nosmile}}
+ {{include file="field_checkbox.tpl" field=$channel_menu}}
{{include file="field_checkbox.tpl" field=$title_tosource}}
{{include file="field_checkbox.tpl" field=$channel_list_mode}}
{{include file="field_checkbox.tpl" field=$network_list_mode}}