aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ping.php
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-03-01 11:49:22 +0100
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-03-01 11:49:22 +0100
commitdd9432903ddb3e12381881da44fb84afff832d52 (patch)
treeb499e77cd4faf8157c2e048fb8242bc2ca2720cc /mod/ping.php
parente0c659b34b8992111bcc64d3f0eea75dfa193412 (diff)
parentbd2c8c92f1b30d8f811bd4aab0fe3a2c5496ec61 (diff)
downloadvolse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.gz
volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.bz2
volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/ping.php')
-rw-r--r--mod/ping.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 0f6f0a9d6..1562254b1 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -14,10 +14,29 @@ function ping_init(&$a) {
$firehose = intval(get_pconfig(local_user(),'system','notify_full'));
- $z = q("select * from notify where uid = %d
- order by seen asc, date desc limit 0, 50",
+ $t = q("select count(*) as total from notify where uid = %d and seen = 0",
intval(local_user())
);
+ if($t && intval($t[0]['total']) > 49) {
+ $z = q("select * from notify where uid = %d
+ and seen = 0 order by date desc limit 0, 50",
+ intval(local_user())
+ );
+ }
+ else {
+ $z1 = q("select * from notify where uid = %d
+ and seen = 0 order by date desc limit 0, 50",
+ intval(local_user())
+ );
+
+ $z2 = q("select * from notify where uid = %d
+ and seen = 1 order by date desc limit 0, %d",
+ intval(local_user()),
+ intval(50 - intval($t[0]['total']))
+ );
+ $z = array_merge($z1,$z2);
+ }
+
$tags = array();
@@ -26,9 +45,10 @@ function ping_init(&$a) {
$dislikes = array();
$friends = array();
$posts = array();
-
+ $home = 0;
+ $network = 0;
- $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
+ $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`wall`, `item`.`author-name`,
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`