Avatars in Memberlist

Forum
Last Post
Threads / Messages

Inf3rnal

Member
Moderator
Joined
Mar 1, 2011
Messages
108
Points
16
Location
US
Mysidian Dollar
16,058
This is a quick and easy modification that will show a user's avatar next to their name in the Memberlist.

memberlistava.png


First off open profile.php in any plain text editor (Notepad, Notepad++, etc).

Then Find:
Code:
$level=@mysql_result($result,$i,"usergroup");

Add Below:
Code:
$avatar=@mysql_result($result,$i,"avatar");

Then Find:
Code:
$article_content = $article_content."<b><a href='profile.php?user=".$username."'>".$star."".$username."</a></b><br>";

Replace With:
Code:
$article_content = $article_content."<img src='".$avatar."' border='0' width='25' height='25'> <b><a href='profile.php?user=".$username."'>".$star."".$username."</a></b><br>";

Enjoy :3

Edit:
Quick Note, If you want to change the size of the avatar shown just change the values of "width='25' height='25'"
 
Last edited:
Looks quite nice, many users will find it useful. Keep in mind that some images may look weird when resized to as small as 25x25.
 
How do you allow member's to have avatars in the first place?

ETA:

Figured it out.
 
Last edited:
Thanks I used this. Is there a way I can use it for Online List?

Your welcome. Yes you can just add those 3 things in the correct areas.

Actually I have some spare time. I'll go look through the code and edit my post for the Online List too. I've got a few more tutorials on the way.
 
Inf3rnal Can you update this script for the latest version of Mys.
 
Bitter from what?

I've been having issues pulling the avatar field since the user databases were split.

Well it shouldnt be a problem for you Inf3rnal as an intermediate programmer. Id say you aint used to the way database script works. All you need to do is to call a method join() so that multiple tables are joined in one select query.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top