1
1
Fork 0

fix for 'show all notifications' on notifications drop-down to handle installations in sub-directories + fix for friend notifications (eg: joe became friends with sam)

This commit is contained in:
Devlon Duthie 2011-10-08 16:57:00 -05:00
parent 2474531451
commit 2cba65bd38
2 changed files with 13 additions and 4 deletions

View file

@ -101,8 +101,7 @@
$("#nav-notifications-linkmenu").addClass("on"); $("#nav-notifications-linkmenu").addClass("on");
nnm = $("#nav-notifications-menu"); nnm = $("#nav-notifications-menu");
//nnm.html(""); nnm.html("<li><a href='"+baseurl+"/notifications/network'>Show All Notifications</a></li>");
nnm.html("<li><a href='/notifications/network'>Show All Notifications</a></li>");
//nnm.attr('popup','true'); //nnm.attr('popup','true');
eNotif.children("note").each(function(){ eNotif.children("note").each(function(){

View file

@ -179,7 +179,7 @@ function notifications_content(&$a) {
$notif_tpl = get_markup_template('notifications.tpl'); $notif_tpl = get_markup_template('notifications.tpl');
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
@ -217,6 +217,11 @@ function notifications_content(&$a) {
break; break;
case ACTIVITY_FRIEND: case ACTIVITY_FRIEND:
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
$obj = parse_xml_string($xmlhead.$it['object']);
$it['fname'] = $obj->title;
$notif_content .= replace_macros($tpl_item_friends,array( $notif_content .= replace_macros($tpl_item_friends,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'], '$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'], '$item_image' => $it['author-avatar'],
@ -250,7 +255,7 @@ function notifications_content(&$a) {
$notif_tpl = get_markup_template('notifications.tpl'); $notif_tpl = get_markup_template('notifications.tpl');
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
@ -288,6 +293,11 @@ function notifications_content(&$a) {
break; break;
case ACTIVITY_FRIEND: case ACTIVITY_FRIEND:
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
$obj = parse_xml_string($xmlhead.$it['object']);
$it['fname'] = $obj->title;
$notif_content .= replace_macros($tpl_item_friends,array( $notif_content .= replace_macros($tpl_item_friends,array(
'$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'], '$item_link' => $a->get_baseurl().'/display/'.$a->user['nickname']."/".$it['parent'],
'$item_image' => $it['author-avatar'], '$item_image' => $it['author-avatar'],