1 2 3 4 5 6 7 8 9 10
if ($user[userlevel] == 6) {
echo "Rank: Administrator";
}elseif ($user[userlevel] == 4) {
echo "Rank: Moderator";
}elseif ($user[userlevel] == 2) {
echo "Rank: Moderator";
}
1 2 3 4 5 6 7 8 9 10
<?php
function change_levels($level){ //define the function
$listed = array('2','4','6'); // define your levels
// if you wish to add to this list just add '', between the quotes add the rank number.
$changed = array('Member','Moderator','Admin'); //this is the changed rank name
//Again if you wish to add to the like just add '',
return str_replace($listed, $changed, $level); //replace the listed rank with the rank name
} //End the function
?>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<?
session_start(); //allows session
include ('online.php');
$conn = mysql_connect("localhost","xxx","xxx");
mysql_select_db(xxx) or die(mysql_error());
$logged = MYSQL_QUERY("SELECT * FROM `members` WHERE `id` = '$_SESSION[id]' AND `password` = '$_SESSION[password]'");
$logged = mysql_fetch_array($logged);
//some server details, don't edit!
$host = $_SERVER['HTTP_HOST'];
$self = $_SERVER['PHP_SELF'];
//change this to your site name
$sitename = "My Site";
//Send emails or not (email activation). 1 = true, 0 = false
$semail = "0";
$sets = mysql_query("SELECT * FROM site_stats WHERE `sid` = '1';");
$setting = mysql_fetch_array($sets);
//get the info and let it be used all over the site :)
function change_levels($level){ //define the function
$listed = array('2','4','6'); // define your levels
// if you wish to add to this list just add '', between the quotes add the rank number.
$changed = array('Member','Moderator','Admin'); //this is the changed rank name
//Again if you wish to add to the like just add '',
return str_replace($listed, $changed, $level); //replace the listed rank with the rank name
} //End the function
?>