MyBB Community Forums

Full Version: Adding profile link to avatar in portal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Been messing around all morning trying to get this to work in the portal.php file, but I can't, I give in. I'm trying to add a profile link to the avatar image displayed in portal announcements when clicked.

Here is the code for members avatar displayed.

$avatar = "<img src=\"{$announcement['avatar']}\" alt=\"\" {$avatar_width_height} />";

I've tried just about everything I can find and think off using this example below. I've not listed the code I've tried there, because I've tried a lot of different ways to try and make it work with no success. The best I could get was the users ID number displayed only after the forum url. But it doesn't work because it has to have: "bburl/user-1.html" shown. All I could get was: "bburl/1"

$avatar = "<a href=\"profile code here\"><img src=\"{$announcement['avatar']}\" alt=\"\" {$avatar_width_height} /></a>";

So does anybody know what needs to go were it says "profile code here"?
Open portal.php and find; (around line# 496)
$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"{$announcement['avatar']}\" alt=\"\" {$avatar_width_height} /></td>";
and change it to;
$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><a href=\"member.php?action=profile&uid={$announcement['uid']}\" title=\"{$announcement['uid']}\"><img src=\"{$announcement['avatar']}\" alt=\"\" {$avatar_width_height} /></a></td>";

Now you should have avatars in portal that point you to User's profiles. Wink
Thanks a lot for that, I would never have got that one you used to make it work. Now I'm happy, thanks again!
Thanks. Wink