Server Status shower
#9

Here is the exact coding I use for Server Status, Users Online, Accounts Created, also a small rates part as well and Castle Owner reader.

 

NOTE: I have done a db cleanup I no longer have newproject_db_auth as I have merged it to be more organised with coding, I also wont release the sql dump due to customised tables etc for security.

 

<?

$CountOnlineUsersQuery = MySQL_Query("SELECT a_zone_num FROM t_users WHERE a_zone_num > -1");

$CountUsers = Mysql_Num_Rows($CountOnlineUsersQuery);

$CountAccounts = 0;

$CountAccountsQuery = Mysql_Query("SELECT * from bg_user");

WHILE ($AccountRows = MySQL_Fetch_Array($CountAccountsQuery)) {

$CountAccounts++;

}

$ServerIP = "PUT SERVER IP HERE";

$ServerPort = "4110";

$Sockres = @FSockOpen($ServerIP, $ServerPort, $errno, $errstr, 1);

if (!$Sockres) {

$Status = "Offline";

}

else {

@FClose($Sockres);

$Status = "Online";

}

echo"

Server Status: $Status

 

Users Online: $CountUsers

 

Accounts: $CountAccounts

 

 

";

$GetMeracCastleOwnerQuery = Mysql_Query("SELECT a_owner_guild_name FROM t_castle WHERE a_zone_index = 7");

$GetMeracCastleOwnerFetch = Mysql_Fetch_Array($GetMeracCastleOwnerQuery);

$MeracOwner = $GetMeracCastleOwnerFetch[a_owner_guild_name];

$GetDratanCastleOwnerQuery = Mysql_Query("SELECT a_owner_guild_name FROM t_castle WHERE a_zone_index = 4");

$GetDratanCastleOwnerFetch = Mysql_Fetch_Array($GetDratanCastleOwnerQuery);

$DratanOwner = $GetDratanCastleOwnerFetch[a_owner_guild_name];

IF ($MeracOwner == NULL) {

$MeracOwner = "NO GUILD";

}

IF ($DratanOwner == NULL) {

$DratanOwner = "NO GUILD";

}

echo"

Merac Owner: $MeracOwner

 

Dratan Owner: $DratanOwner

 

 

 

Rates:

 

Exp: x1

 

SP: x1

 

Drop: x1

 

Gold: x1

";

?>



Messages In This Thread
[No subject] - by Darquise - 10-11-2011, 06:00 PM
[No subject] - by MonarC - 10-11-2011, 06:02 PM
[No subject] - by Jackster - 10-11-2011, 06:06 PM
[No subject] - by BashVendetta - 10-11-2011, 08:07 PM
[No subject] - by Darquise - 10-12-2011, 12:18 PM
[No subject] - by joken - 10-12-2011, 01:24 PM
[No subject] - by Darquise - 10-12-2011, 06:12 PM
[No subject] - by Jackster - 10-12-2011, 06:19 PM
[No subject] - by BashVendetta - 10-13-2011, 11:38 AM
[No subject] - by Darquise - 10-15-2011, 10:45 PM
[No subject] - by BashVendetta - 10-16-2011, 08:24 AM
[No subject] - by Darquise - 10-16-2011, 11:18 AM
[No subject] - by joken - 10-16-2011, 11:43 AM
[No subject] - by BashVendetta - 10-17-2011, 04:54 PM
[No subject] - by --1-- - 11-18-2011, 09:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)