From 99ab06bad3eb8b4c20e70c255d9d4b168c137dde Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 25 Jul 2011 16:54:39 +0200 Subject: js to open close popup nav menu and to populate notification menu via ping. Update mod/ping to return details about messages and intros --- mod/ping.php | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'mod/ping.php') diff --git a/mod/ping.php b/mod/ping.php index 7c31f00c9..e7f366095 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -1,5 +1,5 @@ get_baseurl() . '/profile/' . $a->user['nickname'] ; - $r = q("SELECT COUNT(*) AS `total` FROM `mail` + $mails = q("SELECT *, COUNT(*) AS `total` FROM `mail` WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ", intval(local_user()), dbesc($myurl) ); - - $mail = $r[0]['total']; + $mail = $mails[0]['total']; + + header("Content-type: text/xml"); - echo "\r\n$intro$mail$network$home\r\n"; + echo " + + $intro + $mail + $network + $home + "; + if ($intro>0){ + foreach ($intros as $i) { + echo sprintf ('%s', + $a->get_baseurl().'/notification/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") + ); + }; + } + if ($mail>0){ + foreach ($mails as $i) { + var_dump($i); + echo sprintf ('%s', + $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), t("{0} sent you a message") + ); + }; + } + + echo " + + "; killme(); } -- cgit v1.2.3