diff options
author | zotlabs <mike@macgirvin.com> | 2017-10-22 19:32:08 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-10-22 19:32:08 -0700 |
commit | c49eec71f0995cd75be99a64a4dde398f9f0241b (patch) | |
tree | 06e29769c32460299d9c73794028e657e362b6e2 /Zotlabs/Module/Ping.php | |
parent | cdb1bc9be6fbc09caff62c0153386cc58a2bfbd9 (diff) | |
parent | b58bf75f21d15ac440bb3a90edb29afac9eb64ba (diff) | |
download | volse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.tar.gz volse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.tar.bz2 volse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module/Ping.php')
-rw-r--r-- | Zotlabs/Module/Ping.php | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 5f44b3c20..c91659f2f 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -258,37 +258,20 @@ class Ping extends \Zotlabs\Web\Controller { * dropdown menu. */ if(argc() > 1 && argv(1) === 'notify') { - $t = q("select count(*) as total from notify where uid = %d and seen = 0", + $t = q("select * from notify where uid = %d and seen = 0 order by created desc", intval(local_channel()) ); - if($t && intval($t[0]['total']) > 49) { - $z = q("select * from notify where uid = %d - and seen = 0 order by created desc limit 50", - intval(local_channel()) - ); - } else { - $z1 = q("select * from notify where uid = %d - and seen = 0 order by created desc limit 50", - intval(local_channel()) - ); - $z2 = q("select * from notify where uid = %d - and seen = 1 order by created desc limit %d", - intval(local_channel()), - intval(50 - intval($t[0]['total'])) - ); - $z = array_merge($z1,$z2); - } - if(count($z)) { - foreach($z as $zz) { + if($t) { + foreach($t as $tt) { $notifs[] = array( - 'notify_link' => z_root() . '/notify/view/' . $zz['id'], - 'name' => $zz['xname'], - 'url' => $zz['url'], - 'photo' => $zz['photo'], - 'when' => relative_date($zz['created']), - 'hclass' => (($zz['seen']) ? 'notify-seen' : 'notify-unseen'), - 'message' => strip_tags(bbcode($zz['msg'])) + 'notify_link' => z_root() . '/notify/view/' . $tt['id'], + 'name' => $tt['xname'], + 'url' => $tt['url'], + 'photo' => $tt['photo'], + 'when' => relative_date($tt['created']), + 'hclass' => (($tt['seen']) ? 'notify-seen' : 'notify-unseen'), + 'message' => strip_tags(bbcode($tt['msg'])) ); } } |