PDA

View Full Version : Avatars in Memberlist


Inf3rnal
04-12-2011, 11:13 AM
This is a quick and easy modification that will show a user's avatar next to their name in the Memberlist.

http://dl.dropbox.com/u/614379/Tutorials/Mysidia/memberlistava.png

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

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

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

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

Replace With:
$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'"

Hall of Famer
04-12-2011, 12:38 PM
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.

AlexC
04-12-2011, 01:31 PM
thank you very much, this was very easy and nice. ^.^

SilverDragonTears
06-01-2011, 11:20 AM
How do you allow member's to have avatars in the first place?

ETA:

Figured it out.

AlkseeyaKC
06-24-2011, 08:02 AM
Thanks I used this. Is there a way I can use it for Online List?

Hall of Famer
06-24-2011, 03:41 PM
Actually you can make it into a public modification compatible with Mys v1.2.x.

Inf3rnal
06-25-2011, 11:25 AM
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.

AlkseeyaKC
06-27-2011, 05:21 PM
OOO thanks! That would be awesome of you! I'm still learning the coding and not really good at it yet. XD;

Alaric
04-25-2012, 06:59 AM
Inf3rnal Can you update this script for the latest version of Mys.

Hall of Famer
04-25-2012, 09:36 AM
Id say its a good idea to PM Inf3rnal for this, it seems that he hasnt been active for a while though.

SilverDragonTears
04-25-2012, 10:07 PM
I know how to do this... though I'm still a little bitter >.<

Alaric
04-30-2012, 08:00 AM
Can you help me out Silver Kitsune?

Inf3rnal
04-30-2012, 09:33 PM
I know how to do this... though I'm still a little bitter >.<

Bitter from what?

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

Hall of Famer
05-01-2012, 02:54 PM
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.