Acesta este un Tutorial pentru WebSite Status
Player:
StatusServer:
Who's Online - Cine este Online pe servar
Player:
- Cod:
<?php
//#######################################################
//#
//# CopyRight By www.aionkent.com
//# script By Andr3y
//# For your Website Status
//# Posted By En3rgik & Giovy
//# Comunity Aion KenT
//#
//#######################################################
//first you need to define db info
$hostname = ('127.0.0.1'); //database IP - IP Hostname Navicat in cazul nostru localhost sau 127.0.0.1
$database = ('aiondb'); //database name - database nume in cazul nostru aiondb
$username = ('root'); //database user - Username in cazul nostru root
$password = ('root'); //database password - Parola database (MYSQL) in cazul nostru root
//connects to mysql
$link = mysql_connect( $hostname, $username, $password, $database ) or die( 'Error connecting to mysql<br><br>'.mysql_error());
//selects desired table
$chars = mysql_query("SELECT * FROM players");
//tells how much rows are there (will come helpfull with while loops)
$rows = ($players)>0;
$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 "0" else "1"), 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
?>
StatusServer:
- Cod:
<?php
//#######################################################
//#
//# CopyRight By www.aionkent.com
//# script By zer0cool
//# For your Website Status
//# Posted By En3rgik & Giovy
//# Comunity Aion KenT
//#
//#######################################################
print'<table width="150">';
$server = "127.0.0.1";
$portgs = "9014";
$portls = "2106";
$timeout = "5";
if ($server and $port and $timeout) {
$game = @fsockopen("$server", $portgs, $errno, $errstr, $timeout);
$login = @fsockopen("$server", $portls, $errno, $errstr, $timeout);
}
print'<tr><td align="center"><strong>Server Status</strong></td></tr>';
if($login) { print'<tr><td>Login:</td><td><font color="#00FF00"><strong> Online</strong></font><br><br></td></tr>'; }
else { print'<tr><td>Login:</td><td><font color="#FF0000"><strong> Offline</strong></font><br><br></td></tr>'; }
if($game) { print'<tr><td>Game:</td><td><font color="#00FF00"><strong> Online</strong></font></td></tr>'; }
else { print'<tr><td>Game:</td><td"><font color="#FF0000"><strong> Offline</strong></td></tr>'; }
print'</table>';
?>
Who's Online - Cine este Online pe servar
- Cod:
<?php
//#######################################################
//#
//# CopyRight By www.aionkent.com
//# script By zer0cool
//# For your Website Status
//# Posted By En3rgik & Giovy
//# Comunity Aion KenT
//#
//#######################################################
$dbuser = "root"; // Database Username in cazul nostru root
$dbpass = "root"; // Parola (MYSQL) in cazul nostru root
$dbhost = "localhost"; // Hostname in cazul nostru localhost sau 127.0.0.1
$dbname = "aiondb"; // Database Name in cazul nostru aiondb
$msconn = mysql_connect($dbhost, $dbuser, $dbpass);
$db = mysql_select_db($dbname, $msconn);
$q = mysql_query("SELECT name, exp, gender, race, player_class FROM players WHERE online=1 ORDER BY name ASC");
if($q == FALSE){ echo "Error"; End_page(); }
$count_online = mysql_num_rows($q);
echo "<table width='95%' border='0' cellpadding='0' cellspacing='0' bordercolor='#6b6b6b'>";
echo "<tr align='center'>";
echo "<td><font size='2'><b>Name</b></font></td>
<td><font size='2'><b>Lv.</b></font></td>
<td><font size='2'><b>Race</b></font></td>
<td><font size='2'><b>Gender</b></font></td>
<td><font size='2'><b>Class</b></font></td>";
echo "</tr>";
while($row = mysql_fetch_array($q))
{
if ($row["race"] == 'ELYOS') {$Race = "Elyos";}
elseif ($row["race"] == 'ASMODIANS') {$Race = "Asmodians";}
if ($row["player_class"] == 'WARRIOR') {$player_class1 = "Warrior";}
elseif ($row["player_class"] == 'GLADIATOR') {$player_class1 = "Gladiator";}
elseif ($row["player_class"] == 'TEMPLAR') {$player_class1 = "Templar";}
elseif ($row["player_class"] == 'SCOUT') {$player_class1 = "Scout";}
elseif ($row["player_class"] == 'ASSASSIN') {$player_class1 = "Assassin";}
elseif ($row["player_class"] == 'RANGER') {$player_class1 = "Ranger";}
elseif ($row["player_class"] == 'MAGE') {$player_class1 = "Mage";}
elseif ($row["player_class"] == 'SORCERER') {$player_class1 = "Sorcerer";}
elseif ($row["player_class"] == 'SPIRIT_MASTER') {$player_class1 = "Spirit Master";}
elseif ($row["player_class"] == 'PRIEST') {$player_class1 = "Priest";}
elseif ($row["player_class"] == 'CLERIC') {$player_class1 = "Cleric";}
elseif ($row["player_class"] == 'CHANTER') {$player_class1 = "Chanter";}
if ($row["exp"] <= '0') {$exp = "0";}
elseif ($row["exp"] <= '650') {$exp = "1";}
elseif ($row["exp"] <= '2567') {$exp = "2";}
elseif ($row["exp"] <= '6797') {$exp = "3";}
elseif ($row["exp"] <= '15490') {$exp = "4";}
elseif ($row["exp"] <= '30073') {$exp = "5";}
elseif ($row["exp"] <= '52958') {$exp = "6";}
elseif ($row["exp"] <= '87894') {$exp = "7";}
elseif ($row["exp"] <= '140329') {$exp = "8";}
elseif ($row["exp"] <= '213454') {$exp = "9";}
elseif ($row["exp"] <= '307558') {$exp = "10";}
elseif ($row["exp"] <= '483553') {$exp = "11";}
elseif ($row["exp"] <= '608161') {$exp = "12";}
elseif ($row["exp"] <= '825336') {$exp = "13";}
elseif ($row["exp"] <= '1091985') {$exp = "14";}
elseif ($row["exp"] <= '1418170') {$exp = "15";}
elseif ($row["exp"] <= '1810467') {$exp = "16";}
elseif ($row["exp"] <= '2332547') {$exp = "17";}
elseif ($row["exp"] <= '3002259') {$exp = "18";}
elseif ($row["exp"] <= '3820081') {$exp = "19";}
elseif ($row["exp"] <= '4820228') {$exp = "20";}
elseif ($row["exp"] <= '6115322') {$exp = "21";}
elseif ($row["exp"] <= '7725199') {$exp = "22";}
elseif ($row["exp"] <= '9727123') {$exp = "23";}
elseif ($row["exp"] <= '12075781') {$exp = "24";}
elseif ($row["exp"] <= '14762522') {$exp = "25";}
elseif ($row["exp"] <= '17879938') {$exp = "26";}
elseif ($row["exp"] <= '21482201') {$exp = "27";}
elseif ($row["exp"] <= '25494737') {$exp = "28";}
elseif ($row["exp"] <= '30171209') {$exp = "29";}
elseif ($row["exp"] <= '35999532') {$exp = "30";}
elseif ($row["exp"] <= '42807774') {$exp = "31";}
elseif ($row["exp"] <= '50898898') {$exp = "32";}
elseif ($row["exp"] <= '60588305') {$exp = "33";}
elseif ($row["exp"] <= '73257434') {$exp = "34";}
elseif ($row["exp"] <= '89381899') {$exp = "35";}
elseif ($row["exp"] <= '109123921') {$exp = "36";}
elseif ($row["exp"] <= '135145762') {$exp = "37";}
elseif ($row["exp"] <= '165081925') {$exp = "38";}
elseif ($row["exp"] <= '201229895') {$exp = "39";}
elseif ($row["exp"] <= '243367815') {$exp = "40";}
elseif ($row["exp"] <= '292723295') {$exp = "41";}
elseif ($row["exp"] <= '350683175') {$exp = "42";}
elseif ($row["exp"] <= '415055544') {$exp = "43";}
elseif ($row["exp"] <= '485437946') {$exp = "44";}
elseif ($row["exp"] <= '559304956') {$exp = "45";}
elseif ($row["exp"] <= '643833129') {$exp = "46";}
elseif ($row["exp"] <= '741341640') {$exp = "47";}
elseif ($row["exp"] <= '853768081') {$exp = "48";}
elseif ($row["exp"] <= '982677974') {$exp = "49";}
elseif ($row["exp"] <= '1112677974') {$exp = "50";}
if ($row["gender"] == 'MALE') {$gender1 = "M";}
elseif ($row["gender"] == 'FEMALE') {$gender1 = "F";}
if($row["online"] == 0) $time_online = "<font size='2'>Yes</font>";
if($row["online"] == 1) $time_online = "<font size='2' color='green'>No</font>";
echo "<tr align='center'>";
echo "<td><font size='2'>".$row["name"]."</font></td>";
echo "<td><font size='2'>".$exp."</font></td>";
echo "<td><font size='2'>" .$Race."</font></td>";
echo "<td><font size='2'>" .$gender1."</font></td>";
echo "<td><font size='2'>" .$player_class1."</font></td>";
echo "</tr>";
}
echo "</table>
";
echo "<b>Total</b>: $count_online";
?>