Xversion
Member
- Jul 5, 2014
- 11
- 0
First release on Devbest, gets the data from your database (most but not sure if all) databases of Butterfly and Phoenix.
Details include :
-> Online or Offline
-> Users Online
-> User Peak
-> Rooms Loaded
-> Server Name/Version
-> Stamp
-> Bannerdata (for Butterfly)
-> Minutes Uptime (for Butterfly)
Copy the code and save to 'server_status.php'
Screenshots: (of Butterfly Emu)
lemme know if it works (I only tested this on Apache but any web server with PHP/PDO and MySQL should work.
Details include :
-> Online or Offline
-> Users Online
-> User Peak
-> Rooms Loaded
-> Server Name/Version
-> Stamp
-> Bannerdata (for Butterfly)
-> Minutes Uptime (for Butterfly)
PHP:
<?php
/*
_________ _________ __ __
/ _____/ ______________ __ ___________/ _____// |______ _/ |_ __ __ ______
\_____ \_/ __ \_ __ \ \/ // __ \_ __ \_____ \\ __\__ \\ __\ | \/ ___/
/ \ ___/| | \/\ /\ ___/| | \/ \| | / __ \| | | | /\___ \
/_______ /\___ >__| \_/ \___ >__| /_______ /|__| (____ /__| |____//____ >
\/ \/ \/ \/ \/ \/
By Xversion
*/
define('db_host', 'localhost'); //Your Database Hostname
define('db_user', 'root'); //Your Database Username
define('db_pass', 'test123'); //Your Database Password
define('db_name', 'xabbo_db'); //Your Database Name
define('server', 'butterfly'); //Your Emulator (phoenix or butterfly)
$db = new PDO('mysql:host='. db_host .';dbname='. db_name, db_user, db_pass); //Connect to MySQL Database via PDO
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //PDO Exceptions
if (server == 'butterfly')
{
$get_server_status = $db->prepare('SELECT * FROM server_status ORDER BY id DESC');
$get_server_status->execute();
for($i=0; $row = $get_server_status->fetch(); $i++)
{
echo '<b>Server Status :</b> ' . htmlentities($row['status']) . '<br />
<b>Server Name & Version :</b> ' . htmlentities($row['server_ver']) . '<br />
<b>Rooms Loaded :</b> ' . htmlentities($row['rooms_loaded']) . '<br />
<b>User(s) Online : </b>' . htmlentities($row['users_online']) . '<br />
<b>User(s) Peak : </b>' . htmlentities($row['userpeak']) . '<br />
<b>Stamp : </b>' . htmlentities($row['stamp']) . '<br />
<b>Minutes Uptime : </b>' . htmlentities($row['minutesuptime']) . '<br />
<b>BannerData : </b>' . htmlentities($row['bannerdata']) . '<br />';
}
exit;
}
elseif (server == 'phoenix')
{
$get_server_status = $db->prepare('SELECT * FROM server_status ORDER BY id DESC');
$get_server_status->execute();
for($i=0; $row = $get_server_status->fetch(); $i++)
{
echo '<b>Server Status :</b> ' . htmlentities($row['status']) . '<br />
<b>Server Name & Version :</b> ' . htmlentities($row['server_ver']) . '<br />
<b>Rooms Loaded :</b> ' . htmlentities($row['rooms_loaded']) . '<br />
<b>User(s) Online : </b>' . htmlentities($row['users_online']) . '<br />
<b>User(s) Peak : </b>' . htmlentities($row['userpeak']) . '<br />
<b>Stamp : </b>' . htmlentities($row['stamp']) . '<br />';
}
exit;
}
exit;
?>
Copy the code and save to 'server_status.php'
Screenshots: (of Butterfly Emu)
lemme know if it works (I only tested this on Apache but any web server with PHP/PDO and MySQL should work.
Last edited: