diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-11-15 17:41:51 +0100 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-11-15 17:41:51 +0100 |
commit | 9b2cbc33ae0a4adfca156085898eeef5fd471657 (patch) | |
tree | 3abdf9cc3a5d7a6e69e7395c43adb01c646f55d8 | |
parent | 962467ee686046434e6ad060863eabb55fef2652 (diff) | |
download | volse-hubzilla-9b2cbc33ae0a4adfca156085898eeef5fd471657.tar.gz volse-hubzilla-9b2cbc33ae0a4adfca156085898eeef5fd471657.tar.bz2 volse-hubzilla-9b2cbc33ae0a4adfca156085898eeef5fd471657.zip |
ping: show tags
-rw-r--r-- | mod/ping.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/mod/ping.php b/mod/ping.php index 9965ea918..9f6ae1974 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -8,9 +8,10 @@ function ping_init(&$a) { echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <result>"; + $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; if(local_user()){ - + $tags = array(); $comments = array(); $likes = array(); $dislikes = array(); @@ -29,6 +30,11 @@ function ping_init(&$a) { $network = count($r); foreach ($r as $it) { switch($it['verb']){ + case ACTIVITY_TAG: + $obj = parse_xml_string($xmlhead.$it['object']); + $it['tname'] = $obj->content; + $tags[] = $it; + break; case ACTIVITY_LIKE: $likes[] = $it; break; @@ -36,7 +42,6 @@ function ping_init(&$a) { $dislikes[] = $it; break; case ACTIVITY_FRIEND: - $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; $obj = parse_xml_string($xmlhead.$it['object']); $it['fname'] = $obj->title; $friends[] = $it; @@ -61,6 +66,11 @@ function ping_init(&$a) { $home = count($r); foreach ($r as $it) { switch($it['verb']){ + case ACTIVITY_TAG: + $obj = parse_xml_string($xmlhead.$it['object']); + $it['tname'] = $obj->content; + $tags[] = $it; + break; case ACTIVITY_LIKE: $likes[] = $it; break; @@ -68,7 +78,6 @@ function ping_init(&$a) { $dislikes[] = $it; break; case ACTIVITY_FRIEND: - $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; $obj = parse_xml_string($xmlhead.$it['object']); $it['fname'] = $obj->title; $friends[] = $it; @@ -129,7 +138,7 @@ function ping_init(&$a) { <home>$home</home>"; if ($register!=0) echo "<register>$register</register>"; - $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts); + $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags); echo ' <notif count="'.$tot.'">'; if ($intro>0){ @@ -173,6 +182,11 @@ function ping_init(&$a) { echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) ); }; } + if (count($tags)){ + foreach ($tags as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); + }; + } echo " </notif>"; } |