diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-08-17 21:59:06 +0200 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-08-17 21:59:06 +0200 |
commit | afdc639f17f0f5e12f291b512ccc12b3df6b2acf (patch) | |
tree | 4058d3dec4c37b1af317c37a77dd1bec95c21318 | |
parent | 07b6c868b3a66efc2737dfc6459b4114fea59ba0 (diff) | |
download | volse-hubzilla-afdc639f17f0f5e12f291b512ccc12b3df6b2acf.tar.gz volse-hubzilla-afdc639f17f0f5e12f291b512ccc12b3df6b2acf.tar.bz2 volse-hubzilla-afdc639f17f0f5e12f291b512ccc12b3df6b2acf.zip |
fix friend request query in ping
-rw-r--r-- | mod/ping.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mod/ping.php b/mod/ping.php index 973ecb03f..40ce5be0b 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -20,13 +20,25 @@ function ping_init(&$a) { ); $home = $r[0]['total']; - $intros = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`, + $intros1 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`, `fcontact`.`name`, `fcontact`.`url`, `fcontact`.`photo` FROM `intro` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id` - WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 ", + WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`fid`!=0", intval(local_user()) ); - $intro = $intros[0]['total']; + $intros2 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`, + `contact`.`name`, `contact`.`url`, `contact`.`photo` + FROM `intro` LEFT JOIN `contact` ON `intro`.`contact-id` = `contact`.`id` + WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`contact-id`!=0", + intval(local_user()) + ); + + $intro = $intros1[0]['total'] + $intros2[0]['total']; + if ($intros1[0]['total']==0) $intros1=Array(); + if ($intros2[0]['total']==0) $intros2=Array(); + $intros = $intros1+$intros2; + + $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ; $mails = q("SELECT *, COUNT(*) AS `total` FROM `mail` @@ -61,7 +73,7 @@ function ping_init(&$a) { if ($intro>0){ foreach ($intros as $i) { echo sprintf ( $notsxml, - $a->get_baseurl().'/notification/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") + $a->get_baseurl().'/notifications/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") ); }; } |