Adding users rank to their profiles. (EASY)

Forum
Last Post
Threads / Messages

Tony

I program.
Member
Joined
Jan 31, 2011
Messages
75
Points
0
Mysidian Dollar
4,931
Hey guys, sorry I haven't been on in a day or two, been taking a break from programming, here's a very simple mod. Also, I'm working on a banking system, i'm about 1/3 done. wish me luck!

Profile.php

find:
PHP:
$avatar=@mysql_result($result,$i,"imagelocation");
	$usersname=@mysql_result($result,$i,"username");
	$usersgroup=@mysql_result($result,$i,"usergroup");
	$website=@mysql_result($result,$i,"website");
	$aim=@mysql_result($result,$i,"aim");
	$yahoo=@mysql_result($result,$i,"yahoo");
	$msn=@mysql_result($result,$i,"msn");
	$membersince=@mysql_result($result,$i,"membersince");

add:
PHP:
    $avatar=@mysql_result($result,$i,"imagelocation");
	$usersname=@mysql_result($result,$i,"username");
	$usersgroup=@mysql_result($result,$i,"usergroup");
	$website=@mysql_result($result,$i,"website");
	$aim=@mysql_result($result,$i,"aim");
	$yahoo=@mysql_result($result,$i,"yahoo");
	$msn=@mysql_result($result,$i,"msn");
	$membersince=@mysql_result($result,$i,"membersince");
	$rank=@mysql_result($result,$i,"usergroup");

find:
PHP:
if($avatar == ""){
	$avatar = "This user doesn't have an avatar uploaded.";
	}
	
	if($website == ""){
	$website = "No Website Information Given";
	}
	else{
	$website = "<a href='".$website."' target='_blank'>".$website."</a>";
	}

	if($msn == ""){
	$msn = "No MSN Information Given";
	}
	
	if($aim == ""){
	$aim = "No AIM Information Given";
	}

	if($yahoo == ""){
	$yahoo = "No YIM Information Given";
	}

add:
*note Use a switch statement if you'd prefer it.
PHP:
if($rank == 1){ 
	$rank = "Owner";
    }
	
	if($rank == 2){ 
	$rank = "Administrator";
    }
	
	if($rank == 3){ 
	$rank = "Registered users";
    }
	
	if($rank == 4){ 
	$rank = "Artist";
    }

find:
PHP:
$article_title = $userdisp."'s Profile:";
	$article_content = "<b><u>".$lang_basic_info."".$usersname.":</u></b><br><br>
    <img src='templates/icons/web.gif'> ".$website."<br>
	<img src='templates/icons/aim.gif'> ".$aim."<br>
	<img src='templates/icons/msn.gif'> ".$msn."<br>
	<img src='templates/icons/yahoo.gif'> ".$yahoo."<br>

change to:
PHP:
	$article_title = $userdisp."'s Profile:";
	$article_content = "<b><u>".$lang_basic_info."".$usersname.":</u></b><br><br><img src='templates/icons/star.gif'> ".$rank."<br />
	<img src='templates/icons/web.gif'> ".$website."<br>
	<img src='templates/icons/aim.gif'> ".$aim."<br>
	<img src='templates/icons/msn.gif'> ".$msn."<br>
	<img src='templates/icons/yahoo.gif'> ".$yahoo."<br>

If there's an extra line break or two in there, feel free to remove it. I have more than a few mods added to the profile page, so there may be some spaces I left out by accident. :)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,267
Messages
33,048
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top