PDA

View Full Version : Stars by names on Members list


Seapyramid
04-18-2009, 06:44 PM
On the listing of all members there are stars by the names of those who have access to the CP... Is there a way of changing that from CP to group number & then assigning different icons to select special groups based on their group number?

Sea

BMR777
04-18-2009, 06:50 PM
Yeah, but you'll have to do a little code editing.

In profile.php find:

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

Replace with:

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;

}

Hopefully you get the idea from that. :)

Brandon

Seapyramid
04-18-2009, 08:08 PM
Understood & have that coded :) However it's not showing the icons.. I beleive the reason is with this section

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

if($status == "yes"){
$star = "<img src='templates/icons/star.gif' border=0'> ";



Sea

BMR777
04-18-2009, 08:25 PM
You're right. The code I posted changes it for the actual profile, not for the member list. :)

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

Seapyramid
04-18-2009, 11:11 PM
Worked like a charm!! Thanks,

Sea

zhiichiro
06-16-2009, 01:26 AM
can you post the exact code to be removed or replaced, and the exact code to put?


because i'm confused.. on brandon's second post

Seapyramid
06-16-2009, 09:19 AM
can you post the exact code to be removed or replaced, and the exact code to put?


because i'm confused.. on brandon's second post


Do a bit of research. Actually look into the code & this post a precise question with any errors showing and post what you have done. Then maybe we can help.