Fork me on GitHub

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

Displaying avatar of last poster

edited November 2011 in Feedback
This discussion is related to the IndexPhotos addon.
Thanks for this!!

But, I wanted to display the avatar of the most recent poster. I wanted to share my code snippet in case anyone else wants to do something similar.

In class.indexphotos.plugin.php, starting at line 46, simply change:

protected function DisplayPhoto($Sender) {
// Build user object & output photo
$FirstUser = UserBuilder($Sender->EventArguments['Discussion'], 'First');
echo UserPhoto($FirstUser);
}


to:

protected function DisplayPhoto($Sender) {
// Build user object & output photo
$FirstUser = UserBuilder($Sender->EventArguments['Discussion'], 'First');
$LastUser = UserBuilder($Sender->EventArguments['Discussion'], 'Last');
if (!$LastUser->UserID) {
echo UserPhoto($FirstUser);
} else {
echo UserPhoto($LastUser);
}
}
Mupetzhungle88benlarcey

Comments

Sign In or Register to comment.