camman
New Member
This is a script that will show a list of all the staff on your server. It will show the player's rank (God/CM/etc.), their name, and if they are online or offline.
Save this in /system/pages You could also use your admin panel to add it.
If you only want to show a people above a certain rank, change "WHERE group_id > 1" to something else. For example, to only show GM's and higher make that part say "WHERE group_id > 3".
-Cameron
Save this in /system/pages You could also use your admin panel to add it.
PHP:
<?
// Staff List Page
// by Camman (Cameron Hutchison)
// For ModernAAC
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();
include ('config.php');
//Ranks
$rank[6]="God";
$rank[5]="Community Manager";
$rank[4]="Game Master";
$rank[3]="Senior Tutor";
$rank[2]="Tutor";
$query = $SQL->query("SELECT group_id,name FROM players WHERE group_id > 1 ORDER BY group_id DESC");
echo 'All of the staff of ' . $config['server_name'] .' are listed below.<br/>
<br />
<table width="100%">
<tbody>
<tr><td><b>Rank</b></td><td width="60%"><b>Name</b></td><td><b>Status</b></td></tr>';
$aaa = 0;
foreach($query as $info)
{
$player = $ots->createObject('Player');
$player->find($info['name']);
$showRank = $rank[ $info['group_id'] ];
echo '<tr>
<td>'.$showRank.'</td>
<td width="60%"><a href="/index.php/character/view/'.$info['name'].'">'.$info['name'].'</a></td>
<td><font color="';
echo ($player->isOnline()) ? 'green' : 'red';
echo '">';
echo ($player->isOnline()) ? 'Online' : 'Offline';
echo '</font></td>
</tr>';
$aaa++;
}
echo '</tbody>
</table>';
?>
If you only want to show a people above a certain rank, change "WHERE group_id > 1" to something else. For example, to only show GM's and higher make that part say "WHERE group_id > 3".
-Cameron