PDA

View Full Version : question again


zhiichiro
06-15-2009, 12:18 PM
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

Seapyramid
06-15-2009, 01:06 PM
The search feature can be your friend! http://www.rusnakweb.com/forum/showthread.php?tid=827

zhiichiro
06-16-2009, 01:28 AM
ok but i'm confused on brandon's second post..

trollis76
06-16-2009, 03:48 AM
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:

// Show something else for usergroup 2

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

Hope that works![hr]
Oh, BTW on the first code you should remove the
$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. :)

zhiichiro
06-16-2009, 05:50 AM
tnx, but i'm kinda confused on this :


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

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. :)

trollis76
06-16-2009, 09:19 AM
First, you have replaced this:
$ccstat = cancp($usersgroup);
if($ccstat == "yes"){
$userdisp = "<img src='templates/icons/star.gif'> ".$usersname."";
}
else{
$userdisp = $usersname;
}

With this:

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)

// 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. :)

trollis76
06-16-2009, 11:20 AM
And then, of course; you change the IMG path so that it fits correctly. :)