X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fping.php;h=caa78f9b7cf2f800ae8fb82ff38aa1d43621e3fd;hb=6a8b96709e13b04a0657c25b4538c160e2118131;hp=30f1dc83742dc4db7b2a8fa4c646ba81529777dc;hpb=3ca3157e53d9a37f5fee6ef6c459d61b453cca72;p=friendica.git diff --git a/mod/ping.php b/mod/ping.php index 30f1dc8374..caa78f9b7c 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -15,13 +15,14 @@ function ping_init(&$a) { $likes = array(); $dislikes = array(); $friends = array(); + $posts = array(); $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `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` WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND - `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0", + `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0 ORDER BY `item`.`created` DESC", intval(local_user()) ); @@ -34,6 +35,9 @@ function ping_init(&$a) { case ACTIVITY_DISLIKE: $dislikes[] = $it; break; + case ACTIVITY_POST; + $posts[] = $it; + break; case ACTIVITY_FRIEND: $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; $obj = parse_xml_string($xmlhead.$it['object']); @@ -114,7 +118,7 @@ function ping_init(&$a) { function xmlize($href, $name, $url, $photo, $date, $message){ $notsxml = '%s'; return sprintf ( $notsxml, - $href, $name, $url, $photo, $date, $message + xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message) ); } @@ -151,20 +155,24 @@ function ping_init(&$a) { } if (count($likes)){ foreach ($likes 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} like %s's post"), $i['pname'] ) ); + 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} liked %s's post"), $i['pname'] ) ); }; } if (count($dislikes)){ foreach ($dislikes 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} dislike %s's post"), $i['pname'] ) ); + 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} disliked %s's post"), $i['pname'] ) ); }; } if (count($friends)){ foreach ($friends 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} is now friend with %s"), $i['fname'] ) ); + 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} is now friends with %s"), $i['fname'] ) ); + }; + } + if (count($posts)){ + foreach ($posts 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} posted") ) ); }; } - echo " "; } @@ -172,16 +180,14 @@ function ping_init(&$a) { if(x($_SESSION,'sysmsg')){ foreach ($_SESSION['sysmsg'] as $m){ - echo "".($m).""; + echo "".xmlify($m).""; } - //$_SESSION['sysmsg']=array(); unset($_SESSION['sysmsg']); } if(x($_SESSION,'sysmsg_info')){ foreach ($_SESSION['sysmsg_info'] as $m){ - echo "".($m).""; + echo "".xmlify($m).""; } - //$_SESSION['sysmsg_info']=array(); unset($_SESSION['sysmsg_info']); }