Contas Banidas
Código:
<?php
require_once ( 'config.php');
echo "<center><table border=1><tr><th>acc ID:</th><th>User:</th><th>Reason:</th><th>Ban Data</th><th>Unban Data</th></tr>";
$conn = mysql_connect($host, $user, $pass) or die ("Can't connect with $host");
mysql_select_db($mangosrealm, $conn);
$sqle = "SELECT `id`,`banreason`, `bandate`, `unbandate` FROM `account_banned`";
$sql = "SELECT `ab`.*, `a`.`username` FROM `account_banned` as `ab` "
."LEFT JOIN `account` as `a` ON `a`.`id` = `ab`.`id`;";
$result = mysql_query($sql, $conn);
while ($result_data = mysql_fetch_array($result))
{
echo "<tr><td align=\"center\">".$result_data["id"]."</td>";
echo "<td align=\"center\">".$result_data["username"]."</td>";
echo "<td align=\"center\">".$result_data["banreason"]."</td>";
echo "<td align=\"center\">".date("d.m.Y H:m",$result_data["bandate"])."</td>";
echo "<td align=\"center\">".date("d.m.Y H:m",$result_data["unbandate"])."</td>";
echo "</tr>";
}
mysql_close($conn);
echo "</table></center>";
?>
Configuração do Arquivo
Código:
<?php
$ip = "64.27.1.28";
$port = "3306";
$host = "localhost";
$user = "root";
$pass = "ascent";
$mangoscharacters = "characters";
$mangosrealm = "realmd";
$cod = 'utf8';
?>
================================================= ============
IPs banidos
Código:
<?php
require_once ( 'config.php');
echo "<center><table border=1><tr><th>IP:</th><th>Reason:</th><th>Ban Data</th><th>Unban Data</th></tr>";
$conn = mysql_connect($host, $user, $pass) or die ("Can't connect with $host");
mysql_select_db($mangosrealm, $conn);
$sql = "SELECT `ip`,`banreason`, `bandate`, `unbandate` FROM `ip_banned`";
$result = mysql_query($sql, $conn);
while ($result_data = mysql_fetch_array($result))
{
echo "<tr><td align=\"center\">".$result_data["ip"]."</td>";
echo "<td align=\"center\">".$result_data["banreason"]."</td>";
echo "<td align=\"center\">".date("d.m.Y H:m",$result_data["bandate"])."</td>";
echo "<td align=\"center\">".date("d.m.Y H:m",$result_data["unbandate"])."</td>";
echo "</tr>";
}
mysql_close($conn);
echo "</table></center>";
?>
================================================= ============
Recorde online
Código:
<?php
require_once ( 'config.php');
mysql_connect($host, $user, $pass) or die ("Can't connect with $host");
mysql_selectdb ("$mangosrealm");
$max = mysql_query ("select max(`maxplayers`) from uptime");
$max = mysql_result ($max,0);
echo "Max online:$max <br>";
?>
================================================= ============
Pessoas online
Código:
<?php
require_once ( 'con1.php');
$conn = mysql_connect($host, $user, $pass) or die('Connection failed: ' . mysql_error());
mysql_select_db($mangoscharacters, $conn) or die('Select DB failed: ' . mysql_error());
$sql = "SELECT Count(Online) FROM `characters` WHERE `online` = 1";
$result = mysql_query($sql, $conn);
$row = mysql_fetch_array($result);
$online = $row["Count(Online)"];
echo $online;
?>
================================================= ============
Raças Online
Código:
<?
require_once ( 'config.php');
mysql_connect("$ip", "$user", "$pass");
mysql_select_db ("$mangoscharacters");
$human = mysql_query ("select count(*) from characters where race = 1");
$human = mysql_result ($human,0);
$dwarv = mysql_query ("select count(*) from characters where race = 3");
$dwarv = mysql_result ($dwarv,0);
$night = mysql_query ("select count(*) from characters where race = 4");
$night = mysql_result ($night,0);
$gnome = mysql_query ("select count(*) from characters where race = 7");
$gnome = mysql_result ($gnome,0);
$draenei = mysql_query ("select count(*) from characters where race = 11");
$draenei = mysql_result ($draenei,0);
$orc = mysql_query ("select count(*) from characters where race = 2");
$orc = mysql_result ($orc,0);
$undead = mysql_query ("select count(*) from characters where race = 5");
$undead = mysql_result ($undead,0);
$tauren = mysql_query ("select count(*) from characters where race = 6");
$tauren = mysql_result ($tauren,0);
$troll = mysql_query ("select count(*) from characters where race = 8");
$troll = mysql_result ($troll,0);
$blood = mysql_query ("select count(*) from characters where race = 10");
$blood = mysql_result ($blood,0);
$druid = mysql_query ("select count(*) from characters where class = 11");
$druid = mysql_result ($druid,0);
$hunter = mysql_query ("select count(*) from characters where class = 3");
$hunter = mysql_result ($hunter,0);
$mage = mysql_query ("select count(*) from characters where class = 8");
$mage = mysql_result ($mage,0);
$paladin = mysql_query ("select count(*) from characters where class = 2");
$paladin = mysql_result ($paladin,0);
$priest = mysql_query ("select count(*) from characters where class = 5");
$priest = mysql_result ($priest,0);
$rogue = mysql_query ("select count(*) from characters where class = 4");
$rogue = mysql_result ($rogue,0);
$shaman = mysql_query ("select count(*) from characters where class = 7");
$shaman = mysql_result ($shaman,0);
$warlock = mysql_query ("select count(*) from characters where class = 9");
$warlock = mysql_result ($warlock,0);
$warrior = mysql_query ("select count(*) from characters where class = 1");
$warrior = mysql_result ($warrior,0);
$death = mysql_query ("select count(*) from characters where class = 6");
$death = mysql_result ($death,0);
echo "Humans: $human<br>";
echo "Dwarves: $dwarv<br>";
echo "Night Elf: $night<br>";
echo "Gnome: $gnome<br>";
echo "Draenei: $draenei<br>";
echo "Orc: $orc<br>";
echo "Undead: $undead<br>";
echo "Tauren: $tauren<br>";
echo "Troll: $troll<br>";
echo "Blood Elf: $blood<br><br>";
echo "Druid: $druid<br>";
echo "Hunter: $hunter<br>";
echo "Mage: $mage<br>";
echo "Paladin: $paladin<br>";
echo "Priest: $priest<br>";
echo "Rogue: $rogue<br>";
echo "Shaman: $shaman<br>";
echo "Warlock: $warlock<br>";
echo "Warrior: $warrior<br>";
echo "Death Knight: $death<br>";
?>
================================================= ============
Registro
Código:
<?php
/*Config*/
$realmd = array(
'db_host'=> 'localhost', //ip of db realm
'db_username' => 'root',//realm user
'db_password' => 'ascent',//realm password
'db_name'=> 'realmd',//realm db name
);
///////////////Start script//////////////////
/*
Function name: CHECK FOR SYMBOLS
Description: return TRUE if matches. ( True = OK ) ( False = NOT OK)
*/
function check_for_symbols($string){
$len=strlen($string);
$alowed_chars="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÃ…";
for($i=0;$i<$len;$i++)if(!strstr($alowed_chars,$string[$i]))return TRUE;
return FALSE;
}
/*
Function name: OUTPUT USERNAME:PASSWORD AS SHA1 crypt
Description: obious.
*/
function sha_password($user,$pass){
$user = strtoupper($user);
$pass = strtoupper($pass);
return SHA1($user.':'.$pass);
}
if ($_POST['registration']){
/*Connect and Select*/
$realmd_bc_new_connect = mysql_connect($realmd[db_host],$realmd[db_username],$realmd[db_password]);
$selectdb = mysql_select_db($realmd[db_name],$realmd_bc_new_connect);
if (!$realmd_bc_new_connect || !$selectdb){
echo "Could NOT connect to db, please check the config part of the file!";
die;
}
/*Checks*/
$username = $_POST['username'];
$password = sha_password($username,$_POST['password']);
$qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
if (check_for_symbols($_POST[password]) == TRUE || check_for_symbols($username) == TRUE || mysql_num_rows($qry_check_username) != 0){
echo "Error with creating account, might already be in use or your username / password has invalid symbols in it.";
}else{
mysql_query("INSERT INTO account (username,sha_pass_hash) VALUES ('$username','$password')");// Insert into database.
echo "Account created.";
}
}else{
///////////////Stop script, Start HTML//////////////////
?><style type="text/css">
<!--
body,td,th {
color: #999933;
}
body {
background-color: #000000;
}
#Layer1 {
position:absolute;
left:24px;
top:31px;
width:192px;
height:75px;
z-index:1;
}
-->
</style>
<title>Registration Page ~ WoWcOrE</title><div id="Layer1">
<p><em><strong><a href="/index.php">BACK TO HOMEPAGE</a></strong></em></p>
<p> <a href="/forum/index.php">BACK TO FORUM </a></p>
</div>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<div align="center">
<p> </p>
<p> </p>
<p> </p>
<p><em><strong>Username
<input type="text" name="username">
</strong></em></p>
<p> </p>
<p><em><strong>Password</strong></em>
<input type="password" name="password">
</p>
<p>
<input name="registration" type="submit" value="Register" />
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</form>
<?php
// Do not remove this;)
}
?>
================================================= ============
Status do Server: On/OFF
Código:
<?php
require_once ( 'config.php');
if (! $sock = @fsockopen($ip, $port, $num, $error, 3))
echo '<FONT COLOR=red>Off</FONT>';
else{
echo '<FONT COLOR=yellow>On</FONT>';
fclose($sock);
}
?>
================================================= ============
Tempo do Server Online
Código:
<?php
require_once ( 'config.php');
mysql_connect($host, $user, $pass) or die ("Can't connect with $host");
mysql_selectdb ("$mangosrealm");
$sql = mysql_query ("SELECT * FROM uptime ORDER BY `starttime` DESC LIMIT 1");
$uptime_results = mysql_fetch_array($sql);
if ($uptime_results['uptime'] > 86400) {
$uptime = round(($uptime_results['uptime'] / 24 / 60 / 60),2)." Days";
}
elseif($uptime_results['uptime'] > 3600) {
$uptime = round(($uptime_results['uptime'] / 60 / 60),2)." Hours";
}
else {
$uptime = round(($uptime_results['uptime'] / 60),2)." Min";
}
echo "Uptime:$uptime <br>";
?>
Credits: NERD