Jump to content
MakeWebGames

Recommended Posts

Posted

i searched the forum for about this and didnt find anything....

my question is can i remove admins from the stats rank ? and if so can you show me how please ?...if its not too much trouble for you ofcourse...

cheers

Posted

naw not the hall of fame i have that so it doesn't list admins.

im talking about on the index page where it lists your stats and next to your stats it says [rank:11} or wte...

i would like to have it so admins do not get ranked....if its possible...if not ill just take away the ranks..lol

thanks for your reply rpmb :D

Posted

stats are worked out on generic MC codes in

global_func.php =>

function get_rank($stat, $mykey)
{
global $db;
global $ir,$userid,$c;
$q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level != 0") ;
return $db->fetch_single($q)+1;
}

you could simply change this to

function get_rank($stat, $mykey)
{
global $db;
global $ir,$userid,$c;
$q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level == 1") ;
return $db->fetch_single($q)+1;
}

This may be a issue when viewing this function on a administration username so probably best editing index page only allowing users to view their stats something simple like

 

if ( $ir['user_level'] == 1 ) {
// show stats
}
else {
echo "Administrators do not have statistics";
}

 

This is just a rough idea, hope it helps.

In advance i know * is not always the best idea but this is from the generic MC codes engine not my own.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...