wizzi Posted January 15, 2009 Posted January 15, 2009 you can add it to your webpage and it shows if gs and ls are online.. Quote
DANY PUNISHER Posted August 9, 2009 Posted August 9, 2009 This is a php script. Make a new file *.php, upload it on your FTP, open some internet browser, enter your website address with the *.php file call, and look. This is a tool for server webmaster who need to display the online player of a server. This is not a cheat, this is not a crap, this is just a php script. More, I think the code is really simple and understable with all the comments, just need to read and not flood asking noob questions about that. If you don't know what this code is talking about, if you don't know what php is done to do, just look and close your flooding spamming fingers. dude it didn't work if i put the php file with the code inside the website show a white page with this : '; //prints out the $x number of players online ?> any solution ? Quote
striker Posted October 29, 2009 Posted October 29, 2009 Parse error: syntax error, unexpected T_STRING in C:\Program Files\VertrigoServ\www\status\Map\map.php on line 27 what's wrong??? i use this code <?php //first you need to define db info define('mySQL_hostname', '127.0.0.1'); //database IP define('mySQL_database', 'Database'); //database name define('mySQL_username', 'User'); //database user define('mySQL_password', 'Pass'); //database password //connects to mysql $db_link = mysql_pconnect( mySQL_hostname, mySQL_username, mySQL_password ) or die( 'Error connecting to mysql<br><br>'.mysql_error() ); //connects to Database $db_select = mysql_select_db( mySQL_database, $db_link ) or die( 'Error connecting to Database<br><br>'.mysql_error() ); //selects desired table $chars=mysql_query("SELECT * FROM `characters` WHERE `accesslevel`=0); //tells how much rows are there (will come helpfull with while loops) $rows =mysql_numrows($characters); $i=0; $x=0; //while $i is smaller than number of rows repeat the code while ($i < $rows) { $online=mysql_result($chars,$i,"online"); //looks into characters table, under column online(if player is online its "1" else "0"), at row $i if ($online == 1) { $x++; } // if column online at row $i is "1", increase $x $i++; //increase $i } print 'Online players:<em>'.$x.'<em>'; //prints out the $x number of players online ?> Quote
Orgyilkos Posted November 15, 2009 Posted November 15, 2009 My Server Status Script: <?php //////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////// Created By Mentor www.teamsrv.net //////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// $login_ip = "127.0.0.1"; $login_port = "2106"; $game_ip = "127.0.0.1"; $game_port = "7777"; $ventrilo_ip = "127.0.0.1"; $ventrilo_port = "3784"; $mysql_host = "127.0.0.1"; $mysql_user = "root"; $mysql_passwd = "root"; $mysql_db = "l2jdb"; /////////////////////////// ////////Login Server/////// /////////////////////////// $ls = @fsockopen ($login_ip, $login_port, $errno, $errstr, 1); if ( $ls ) $ls = "<font color=green>Online</font>"; else $ls = "<font color=red>Offline</font>"; /////////////////////////// ////////Game Server /////// /////////////////////////// $gs = @fsockopen ($game_ip, $game_port, $errno, $errstr, 1); if ( $gs ) $gs = "<font color=green>Online</font>"; else $gs = "<font color=red>Offline</font>"; /////////////////////////// ////////Vent Server /////// /////////////////////////// $ve = @fsockopen ($ventrilo_ip, $ventrilo_port, $errno, $errstr, 1); if ( $ve ) $ve = "<font color=green>Online</font>"; else $ve = "<font color=red>Offline</font>"; ///////////////////////////// ////MySQL Login Server/////// ///////////////////////////// mysql_connect($mysql_host, $mysql_user, $mysql_passwd) or die ("Nem sikerült csatlakozni a MySQL szerverhez!"); mysql_select_db($mysql_db) or die("Nincs ilyen adatbázis: ".$mysql_db); // All Accounts $accounts=mysql_numrows(mysql_query("SELECT * FROM accounts")); // Online Players Num $num=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel=0")); // Online GMs Num $gmnum=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel>0")); // All Alliance Num $alliance=mysql_numrows(mysql_query("SELECT * FROM clan_data WHERE ally_name!=\'\'")); // All Characters $char=mysql_numrows(mysql_query("SELECT * FROM characters WHERE accesslevel=0")); // All GM Characters $gmchar=mysql_numrows(mysql_query("SELECT * FROM characters Where accesslevel > 0")); // All Clan $clan=mysql_numrows(mysql_query("SELECT * FROM clan_data")); $gmnamesql = mysql_query("SELECT char_name FROM characters WHERE accesslevel>=1 AND online=1 ORDER BY char_name ASC"); while ($gmnam = mysql_fetch_object($gmnamesql)) { $gmname .= "<font color=green>$gmnam->char_name</font>, "; } print " <table width='100%' border='0'> <tr><td width='80%'><b>Auth Server:</b></td><td>".$ls."</td></tr> <tr><td width='80%'><b>Bartz Server:</b></td><td>".$gs."</td></tr> <tr><td width='80%'>Accounts:</td><td>".$accounts."</td></tr> <tr><td width='80%'>Online Players:</td><td>".$num."</td></tr> <tr><td width='80%'>Online GM:</td><td>".$gmnum."</td></tr> <tr><td width='80%'>Characters:</td><td>".$char."</td></tr> <tr><td width='80%'>GM Characters:</td><td>".$gmchar."</td></tr> <tr><td width='80%'>Clans:</td><td>".$clan."</td></tr> <tr><td width='80%'>Alliances:</td><td>".$alliance."</td></tr> <tr><td>Online GM: ".$gmname."</td></tr> </table> "; //////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////// Created By Mentor www.teamsrv.net //////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// ?> Quote
sAp Posted February 3, 2010 Posted February 3, 2010 L0L http://status.blackout-gaming.net/ And Look o.O THX! Quote
pngchaves Posted February 6, 2010 Posted February 6, 2010 Bah this is too hard to do, for newbies like me.. But I managed! Thanks! :P Quote
Luffy® Posted April 13, 2010 Posted April 13, 2010 i got an error :/ Warning: mysql_numrows() expects parameter 1 to be resource, null given in D:\Xampp\xampp\htdocs\index.php on line 34 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.