Curt Posted November 4, 2009 Posted November 4, 2009 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 Quote
rulerofzu Posted November 4, 2009 Posted November 4, 2009 You mean from being listed on places like the hall of fame? Just add to your database query WHERE user_level=1 Then it will only show the players and not any admins etc. Quote
Curt Posted November 4, 2009 Author Posted November 4, 2009 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 Quote
rulerofzu Posted November 4, 2009 Posted November 4, 2009 Ahhh right I am with you now. Had totally forgotten the default index has that. Quote
Zero-Affect Posted November 4, 2009 Posted November 4, 2009 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. Quote
Curt Posted November 5, 2009 Author Posted November 5, 2009 thanks Zero ill play around with that code to see what i come up with :D Quote
Zero-Affect Posted November 5, 2009 Posted November 5, 2009 Your welcome, post the result may be interesting for other users to learn from. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.