Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
commit
92b08f1f07
@ -191,7 +191,7 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Articles'),
|
||||
'$editor' => $editor,
|
||||
'$content' => $content,
|
||||
'$pager' => alt_pager($a,$pager_total)
|
||||
'$pager' => alt_pager($pager_total)
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
@ -194,7 +194,7 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Cards'),
|
||||
'$editor' => $editor,
|
||||
'$content' => $content,
|
||||
'$pager' => alt_pager($a, $pager_total)
|
||||
'$pager' => alt_pager($pager_total)
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
@ -380,7 +380,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if((! $update) || ($checkjs->disabled())) {
|
||||
$o .= alt_pager($a,count($items));
|
||||
$o .= alt_pager(count($items));
|
||||
if ($mid && $items[0]['title'])
|
||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
'$entries' => $entries,
|
||||
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
|
||||
'$submit' => t('Find'),
|
||||
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
|
||||
'$next' => alt_pager($j['records'], t('next page'), t('previous page')),
|
||||
'$sort' => t('Sort options'),
|
||||
'$normal' => t('Alphabetic'),
|
||||
'$reverse' => t('Reverse Alphabetic'),
|
||||
|
@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
|
||||
));
|
||||
|
||||
|
||||
$o .= alt_pager($a,count($r));
|
||||
$o .= alt_pager(count($r));
|
||||
|
||||
return $o;
|
||||
|
||||
|
@ -14,9 +14,12 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
\App::set_pager_itemspage(60);
|
||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||
|
||||
//show all items
|
||||
if(argc() == 1) {
|
||||
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
|
||||
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
|
||||
intval(local_channel()),
|
||||
intval(ITEM_MODERATED)
|
||||
);
|
||||
@ -26,7 +29,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
if(argc() == 2) {
|
||||
$post_id = intval(argv(1));
|
||||
|
||||
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
|
||||
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
|
||||
intval($post_id),
|
||||
intval(local_channel()),
|
||||
intval(ITEM_MODERATED)
|
||||
@ -92,6 +95,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$o = conversation($items,'moderate',false,'traditional');
|
||||
$o .= alt_pager(count($items));
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$o .= conversation($items,$mode,$update,$page_mode);
|
||||
|
||||
if(($items) && (! $update))
|
||||
$o .= alt_pager($a,count($items));
|
||||
$o .= alt_pager(count($items));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
||||
$o .= '<div id="content-complete"></div>';
|
||||
|
||||
if(($items) && (! $update))
|
||||
$o .= alt_pager($a,count($items));
|
||||
$o .= alt_pager(count($items));
|
||||
|
||||
return $o;
|
||||
|
||||
|
@ -6,16 +6,9 @@ class Design_tools {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
// mod menu doesn't load a profile. For any modules which load a profile, check it.
|
||||
// otherwise local_channel() is sufficient for permissions.
|
||||
if(perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'write_pages') || (\App::$is_sys && is_site_admin()))
|
||||
return design_tools();
|
||||
|
||||
if(\App::$profile['profile_uid'])
|
||||
if((\App::$profile['profile_uid'] != local_channel()) && (! \App::$is_sys))
|
||||
return '';
|
||||
|
||||
if(! local_channel())
|
||||
return '';
|
||||
|
||||
return design_tools();
|
||||
return EMPTY_STR;
|
||||
}
|
||||
}
|
@ -150,9 +150,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
||||
|
||||
// attempt network auto-discovery
|
||||
|
||||
$d = discover_by_webbie($url,$protocol);
|
||||
$wf = discover_by_webbie($url,$protocol);
|
||||
|
||||
if((! $d) && ($is_http)) {
|
||||
if((! $wf) && ($is_http)) {
|
||||
|
||||
// try RSS discovery
|
||||
|
||||
@ -167,9 +167,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
||||
}
|
||||
}
|
||||
|
||||
if($d) {
|
||||
if($wf || $d) {
|
||||
$r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' limit 1",
|
||||
dbesc($url),
|
||||
dbesc(($wf) ? $wf : $url),
|
||||
dbesc($url)
|
||||
);
|
||||
}
|
||||
|
@ -1192,9 +1192,10 @@ function discover_by_webbie($webbie, $protocol = '') {
|
||||
logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO);
|
||||
|
||||
$arr = [
|
||||
'address' => $webbie,
|
||||
'protocol' => $protocol,
|
||||
'success' => false,
|
||||
'address' => $webbie,
|
||||
'protocol' => $protocol,
|
||||
'success' => false,
|
||||
'xchan' => '',
|
||||
'webfinger' => $x
|
||||
];
|
||||
/**
|
||||
@ -1207,7 +1208,7 @@ function discover_by_webbie($webbie, $protocol = '') {
|
||||
*/
|
||||
call_hooks('discover_channel_webfinger', $arr);
|
||||
if($arr['success'])
|
||||
return true;
|
||||
return $arr['xchan'];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -95,6 +95,12 @@ function queue_set_delivered($id,$channel = 0) {
|
||||
|
||||
function queue_insert($arr) {
|
||||
|
||||
// do not queue anything with no destination
|
||||
|
||||
if(! (array_key_exists('posturl',$arr) && trim($arr['posturl']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$x = q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_priority,
|
||||
outq_created, outq_updated, outq_scheduled, outq_notify, outq_msg )
|
||||
values ( '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s' )",
|
||||
|
@ -338,7 +338,7 @@ function pub_tagadelic($net,$site,$limit,$recent,$safemode,$type) {
|
||||
else {
|
||||
$sys = get_sys_channel();
|
||||
$uids = " and item.uid = " . intval($sys['channel_id']) . " ";
|
||||
$sql_extra = item_permissions_sql($sys['channel_id']);
|
||||
$sql_extra = " and item_private = 0 ";
|
||||
}
|
||||
|
||||
if($recent)
|
||||
|
@ -531,7 +531,7 @@ function paginate(&$a) {
|
||||
}
|
||||
|
||||
|
||||
function alt_pager(&$a, $i, $more = '', $less = '') {
|
||||
function alt_pager($i, $more = '', $less = '') {
|
||||
|
||||
if(! $more)
|
||||
$more = t('older');
|
||||
@ -2404,7 +2404,7 @@ function jindent($json) {
|
||||
*/
|
||||
function design_tools() {
|
||||
|
||||
$channel = App::get_channel();
|
||||
$channel = channelx_by_n(App::$profile['profile_uid']);
|
||||
$sys = false;
|
||||
|
||||
if(App::$is_sys && is_site_admin()) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
[region=aside]
|
||||
[widget=pubtagcloud][var=trending]8[/var][var=limit]20[/var][/widget]
|
||||
[widget=pubtagcloud][/widget]
|
||||
[/region]
|
||||
[region=right_aside]
|
||||
[widget=notifications][/widget]
|
||||
|
Reference in New Issue
Block a user