Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: live627 on March 30th, 2013, 11:42 PM

Title: Notifications show one avatar
Post by: live627 on March 30th, 2013, 11:42 PM
See screenie.
Title: Re: Notifications show one avatar
Post by: Dragooon on April 1st, 2013, 08:30 PM
@Nao: Can you make the avatar formatting etc. changes universal instead of applying to individual Notififier::getText? I've intended the function to always return raw text without any formatting since it can be used for other places as well. Or share your formatting code and I can make it universal.
Title: Re: Notifications show one avatar
Post by: Nao on April 1st, 2013, 09:04 PM
Oh, you mean the code in plugin.php..? It's a WIP. Not ready for consumption...

I'm busy IRL today, I only uploaded my code here because it actually works, and I wanted to gather feedback on whether you guys liked it or not... Not the design (which is really, really tentative) or anything, but the basic functionality:
- HTML no longer holds any data;
- only the unread count;
- clicking the notifs area will load all notifications through Ajax;
- polling is every minute on active tabs, every 10 minutes on inactive tabs;
- polling only provides updated unread count and forces an Ajax reload on notifs click (i.e. even that doesn't carry extra bandwidth requirements...)
Posted: April 1st, 2013, 09:04 PM

PS @Dragooon I don't have your bug..?
Title: Re: Notifications show one avatar
Post by: Nao on April 1st, 2013, 09:05 PM
PPS: what happens if I merge a post with an earlier one that has a notification attached to it..? I guess it loses it, right..?
Title: Re: Notifications show one avatar
Post by: Dragooon on April 1st, 2013, 09:10 PM
@Nao: I was talking about the avatar stuff, that's done via modifying plugin.php's getText right? Or?
Quote from Nao on April 1st, 2013, 09:05 PM
PPS: what happens if I merge a post with an earlier one that has a notification attached to it..? I guess it loses it, right..?
I'm not sure, it shouldn't?
Title: Re: Notifications show one avatar
Post by: Nao on April 2nd, 2013, 11:34 PM
Yes, it is.

Let me fetch my code...

Code: [Select]
public function getText(Notification $notification)
{
global $txt, $memberContext;

$data = $notification->getData();
if (empty($memberContext[$data['member']['id']]['avatar']))
loadMemberAvatar($data['member']['id'], true);
return sprintf($txt['wementions_notification'], !empty($memberContext[$data['member']['id']]['avatar']) ? $memberContext[$data['member']['id']]['avatar']['image'] : '', $data['member']['name'], $data['subject']);
}

Also, I've just uploaded an updated version of script.js which allows you to close the popup by clicking anywhere else. Very, VERY oddly, I had many difficulties to pull it off, because of some peculiarities in the way it's shown in the first place.
Title: Re: Notifications show one avatar
Post by: Dragooon on April 3rd, 2013, 07:09 AM
Wouldn't it be a better idea to move it into Notifications template and do it besides the text? That way we don't need to do it for every notifier and it gives us more flexibility.
Title: Re: Notifications show one avatar
Post by: live627 on April 12th, 2013, 02:08 AM
Fixed in r2051
Title: Re: Notifications show one avatar
Post by: Nao on November 5th, 2013, 09:46 AM
Quote from Dragooon on April 1st, 2013, 09:10 PM
Quote from Nao on April 1st, 2013, 09:05 PM
PPS: what happens if I merge a post with an earlier one that has a notification attached to it..? I guess it loses it, right..?
I'm not sure, it shouldn't?
Yep. Preview fails. :(