- Joined
- Apr 8, 2010
- Messages
- 512
- Reaction score
- 96
Hello, I did a GM's Status script... yeah, I know that there's a lot of it here, but this one is easier to use, it's very effective, have clean codes, and doesn't have bugs.
I got nothing to do some time a go, then I created it xD
The instructions are in the script.
This is the script:
And this is the database configuration file:
Don't forget to change the database's access information in config.php
Enjoy xD
I got nothing to do some time a go, then I created it xD
The instructions are in the script.
This is the script:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Server GM's status</title>
<style type="text/css">
body{
font-family: Tahoma, Geneva, sans-serif;
font-size: 14px;
color: #404040;
}
</style>
</head>
<body>
<?php
require_once "config.php";
$array_gms = array(
'ID, Nickname, Rank',
'ID2, Nickname2, Rank2'
//...
);
//NOTE: You can add an infinite number of GMs =)
//NOTE2: To add another GM, insert a COMMA (,) in the end of the previous array, and then create another array following the examples above.
for($i = 0; $i < count($array_gms); $i++){ //OK, ok. I forgot that I could have used foreach, but the result is the same D=
$ExpInfos = explode(',', $array_gms[$i]);
$ArrDados = mysql_query("SELECT `zoneid` FROM `point` WHERE `uid`='".$ExpInfos[0]."' AND `zoneid` > 0");
if(mysql_num_rows($ArrDados) <= 0) $status = '<font color="red">Offline</font>';
else $status = '<font color="#006600">Online</font>';
echo '['.trim($ExpInfos[2]).'] '.trim($ExpInfos[1]).' '.$status; if($i != count($array_gms)) echo '<br />';
}
?>
</body>
</html>
And this is the database configuration file:
PHP:
<?php
$DBHost = "localhost"; //DNS or IP
$DBUser = "root"; //Database's User
$DBPassword = ""; //Database's Password
$DBName = "pw"; //Database's Name
$Conn = mysql_connect($DBHost, $DBUser, $DBPassword) or die(mysql_error());
$Dbs = mysql_select_db($DBName, $Conn) or die(mysql_error());
?>
Don't forget to change the database's access information in config.php
Enjoy xD
Last edited: