aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-04-19 08:28:42 +0200
committerMario Vavti <mario@mariovavti.com>2018-04-19 08:28:42 +0200
commit92b08f1f07a25976342dc885331ecb1531e256aa (patch)
tree4127afeee7d8a3b710863d9ad022fed2b82a8ebc
parent16dcbc1e674cef1d51dc0e81f91d7055350f9990 (diff)
parenta81011333fc113006fbf49b561915532f6cd2509 (diff)
downloadvolse-hubzilla-92b08f1f07a25976342dc885331ecb1531e256aa.tar.gz
volse-hubzilla-92b08f1f07a25976342dc885331ecb1531e256aa.tar.bz2
volse-hubzilla-92b08f1f07a25976342dc885331ecb1531e256aa.zip
Merge remote-tracking branch 'mike/master' into dev
-rw-r--r--Zotlabs/Module/Articles.php2
-rw-r--r--Zotlabs/Module/Cards.php2
-rw-r--r--Zotlabs/Module/Channel.php2
-rw-r--r--Zotlabs/Module/Directory.php2
-rw-r--r--Zotlabs/Module/Message.php2
-rw-r--r--Zotlabs/Module/Moderate.php8
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Module/Pubstream.php2
-rw-r--r--Zotlabs/Widget/Design_tools.php13
-rw-r--r--include/follow.php8
-rw-r--r--include/network.php9
-rw-r--r--include/queue_fn.php6
-rw-r--r--include/taxonomy.php2
-rw-r--r--include/text.php4
-rw-r--r--view/pdl/mod_pubstream.pdl1
15 files changed, 34 insertions, 31 deletions
diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php
index 62ce1cb9c..284868241 100644
--- a/Zotlabs/Module/Articles.php
+++ b/Zotlabs/Module/Articles.php
@@ -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;
diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php
index d3b16e82e..f196988a2 100644
--- a/Zotlabs/Module/Cards.php
+++ b/Zotlabs/Module/Cards.php
@@ -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;
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 6a334b59a..953f87f11 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -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'];
}
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php
index 87387ef56..f2673fa1a 100644
--- a/Zotlabs/Module/Directory.php
+++ b/Zotlabs/Module/Directory.php
@@ -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'),
diff --git a/Zotlabs/Module/Message.php b/Zotlabs/Module/Message.php
index 7494f4bf4..5856bfbdf 100644
--- a/Zotlabs/Module/Message.php
+++ b/Zotlabs/Module/Message.php
@@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
));
- $o .= alt_pager($a,count($r));
+ $o .= alt_pager(count($r));
return $o;
diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php
index 10c8ab8f2..a7c98e05e 100644
--- a/Zotlabs/Module/Moderate.php
+++ b/Zotlabs/Module/Moderate.php
@@ -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;
}
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index b11b470f5..8d017207b 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -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;
}
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index e8a0146c4..571118201 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -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;
diff --git a/Zotlabs/Widget/Design_tools.php b/Zotlabs/Widget/Design_tools.php
index 8ab6a235d..a15c0c98d 100644
--- a/Zotlabs/Widget/Design_tools.php
+++ b/Zotlabs/Widget/Design_tools.php
@@ -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;
}
} \ No newline at end of file
diff --git a/include/follow.php b/include/follow.php
index a63fe66ea..d803afa3f 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -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)
);
}
diff --git a/include/network.php b/include/network.php
index 897fbccd6..c41d87af0 100644
--- a/include/network.php
+++ b/include/network.php
@@ -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;
}
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 798ac36db..f05bac5b0 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -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' )",
diff --git a/include/taxonomy.php b/include/taxonomy.php
index f65cdd941..e8d33986f 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -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)
diff --git a/include/text.php b/include/text.php
index bc44f22f3..55fc49560 100644
--- a/include/text.php
+++ b/include/text.php
@@ -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()) {
diff --git a/view/pdl/mod_pubstream.pdl b/view/pdl/mod_pubstream.pdl
index abb1a4931..539900155 100644
--- a/view/pdl/mod_pubstream.pdl
+++ b/view/pdl/mod_pubstream.pdl
@@ -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]