question again

Forum
Last Post
Threads / Messages

zhiichiro

Member
Member
Joined
Mar 23, 2009
Messages
106
Points
0
Mysidian Dollar
7,292
how to change the icons for different groups?

because i want to use the star icon for admins only, and i want to put new icon for the "club" members
 
The search feature can be your friend! http://www.rusnakweb.com/forum/showthread.php?tid=827
 
If you want it the simple way you start by replacing all the things from Brandons first post. Then you do what he said in the second one.
And after that you need to have your own icon uploaded to this FOLDER:
templates/icons
And the thing you name that icons you write here:

PHP:
// Show something else for usergroup 2

$star = "<img src='templates/icons/NAME OF THE IMG' border=0'> ";
}

Hope that works!

Oh, BTW on the first code you should remove the
PHP:
$status = cancp($level);
and where it used to be you put the rest of the code that Brandon put in his second post.

I hope it works, since I haven't tested it myself. :)
 
tnx, but i'm kinda confused on this :

BMR777 said:
remove the $status = cancp($level); line. Then add this:

PHP:
if($level == 1){

// Show a star for the admin

$star = "<img src='templates/icons/star.gif' border=0'> ";
}
else if($level == 2){

// Show something else for usergroup 2

$star = "<img src='templates/icons/icon.gif' border=0'> ";
}

And so on. :)
 
First, you have replaced this:
PHP:
$ccstat = cancp($usersgroup);
	if($ccstat == "yes"){
	$userdisp = "<img src='templates/icons/star.gif'> ".$usersname."";
	}
	else{
	$userdisp = $usersname;
	}

With this:

PHP:
if($usersgroup == 1){

// Group 1, Root Admins

$userdisp = "<img src='templates/icons/star.gif'> ".$usersname."";
}
else if($usersgroup == 2){

// Group 2, Admins

$userdisp = "<img src='templates/icons/icon.gif'> ".$usersname."";
}
else if($usersgroup == 3){

// Registered Members, no icon
$userdisp = $usersname;

}
else if($usersgroup == 4){

// Another user group, and so on...

}
else{

// Usergroup is something else, show default style
$userdisp = $usersname;

}
Am I right?

Now you find the last line inside this code:
(This is from the profile.php, and not from the thing that you have already edited. Just search for this part inside YOUR profile.php)

PHP:
// We did not specify a user, so show the memberlist

$article_title = "Memberlist";
$article_content = "Here are all of the members of this site, sorted by registration date.<br><br>";

$query = "SELECT * FROM ".$prefix."users ORDER BY uid ASC";
$result = mysql_query($query);
$num = mysql_numrows($result);

$rowsperpage = 15;
$totalpages = ceil($num / $rowsperpage);

if(is_numeric($page) and $page != ""){
$currentpage = $page;
}
else{
$currentpage = 1;
}

if ($currentpage > $totalpages) {  
$currentpage = $totalpages;  
}
if ($currentpage < 1) {   
$currentpage = 1;  
} 
$offset = ($currentpage - 1) * $rowsperpage;  

$query = "SELECT * FROM ".$prefix."users ORDER BY uid ASC LIMIT $offset, $rowsperpage";
$result = mysql_query($query);
$num2 = mysql_numrows($result);

//Loop out code
$i=0;
while ($i < $num2) {

$id=@mysql_result($result,$i,"uid");
$username=@mysql_result($result,$i,"username");
$email=@mysql_result($result,$i,"email");
$level=@mysql_result($result,$i,"usergroup");

$star = "";
$status = cancp($level);

And you delete that part, and if you already have made the first steps, you don't need to do something else. (I think) :)

Sorry that I messed it up in my first post. :)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

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

Latest Threads

Top