Hey there,
I tried several things with: function loginServer. But it doesn't seem to give online or offline. It just let it at Online.
This is my AutoReload, Function and Footer file:
AutoReload:
Footer:
I tried several things with: function loginServer. But it doesn't seem to give online or offline. It just let it at Online.
This is my AutoReload, Function and Footer file:
AutoReload:
PHP Code:
<?php require('../Connections/localhost.php'); require('functions.php'); ?><head>
<a href="../user_playersonline.php">Players Online: <font color="green"><?php echo onlinetotal(); ?></font></a><br />
Total Account: <font color="green"><?php echo acctotal(); ?></font><br />
Total Characters: <font color="green"><?php echo chartotal(); ?></font><br/>
Online: <?php echo worldServer($ip); ?><br/><?php echo loginServer($ip); ?><br/>
<div style="padding-left: 2px;">
<?php $random = rand(1, 7); ?>
<a href="user_screenshots.php">
<img src="../images/screenshots/<?php echo $random; ?>_thumb.jpg" width="220" height="165" alt="Click to view more ScreenShots."/></a>
</div>
PHP Code:
<?php
function charstatus($val)
{
if($val >= 1)
return '<font color=green>Online</font>';
else
return '<font color=red>Offline</font>';
}
function eqgear($val)
{
if($val >= 110105 && $val <= 202009) {
$number = substr($val,0,-1);
$final = "$number"."5";
return $final;
}
elseif($val >= 410005 && $val <= 900265) {
$number = substr($val,0,-1);
$final = "$number"."5";
return $final;
}
elseif($val == 300000 || $val >= 2100025 && $val <= 2100095 || $val >= 1100003 && $val <= 1100009 || $val >= 1050000 && $val <= 1050050){
return $val;
}
else {
return 'default';
}
}
function prof($val)
{
if ($val > 9 && $val < 16)
return 'Trojan';
if ($val > 19 && $val < 26)
return 'Warrior';
if ($val > 39 && $val < 46)
return 'Archer';
if ($val > 49 && $val < 56)
return 'Ninja';
if ($val > 59 && $val < 66)
return 'Monk';
if ($val > 99 && $val < 102)
return 'Taolist';
if ($val > 131 && $val < 136)
return 'Water';
if ($val > 141 && $val < 146)
return 'Fire';
}
function adminUserBan($user) {
$ban = mysql_query("UPDATE accounts SET accesslevel = '0' WHERE username = '$user'") or die(mysql_error());
if(!$ban) {
echo 'The user cannot be banned at this time.';
} else {
echo 'The user has been banned successfully!';
}
}
function gmsOnline() {
$check = mysql_query("SELECT accesslevel FROM accounts WHERE accesslevel = '300' AND online = '1'") or die(mysql_error());
$total = mysql_num_rows($check);
echo $total;
}
function gmTotal() {
$check = mysql_query("SELECT State FROM accounts WHERE State = '5'") or die(mysql_error());
$total = mysql_num_rows($check);
echo $total;
}
function onlineTotal() {
$check = mysql_query("SELECT * FROM entities WHERE Online = '1'") or die(mysql_error());
$total = mysql_num_rows($check);
echo $total;
}
function accTotal() {
$check = mysql_query("SELECT * FROM accounts") or die(mysql_error());
$total = mysql_num_rows($check);
echo $total;
}
function charTotal() {
$check = mysql_query("SELECT * FROM entities") or die(mysql_error());
$total = mysql_num_rows($check);
echo $total;
}
function loginServer($ip) {
$open = @fsockopen($ip, '9959', $ERRNO, $ERRSTR, .02) or die(mysql_error());
if(!$open) {
echo '<b><font color=red>Offline</font></b>';
} else {
echo '<b><font color=green>Online</font></b>';
}
}
function worldServer($ip) {
$open = @fsockopen($ip, '5816', $ERRNO, $ERRSTR, .02) or die(mysql_error());
if(!$open) {
echo '<b><font color=red>Offline</font></b>';
} else {
echo '<b><font color=green>Online</font></b>';
}
}
function adminUserUnban($user) {
$unban = mysql_query("UPDATE accounts SET accesslevel = '100' WHERE username = '$user'") or die(mysql_error());
if(!$unban) {
echo 'The user cannot be unbanned at this time.';
} else {
echo 'The user has been unbanned successfully!';
}
}
function adminDeleteAcc($acc) {
$del = mysql_query("DELETE FROM accounts WHERE username = '$acc'") or die(mysql_error());
if(!$del) {
echo 'The user cannot be deleted at this time.';
} else {
echo 'The user has been deleted successfully!';
}
}
function adminDeleteChar($char) {
$del = mysql_query("DELETE FROM entities WHERE char_name = '$char'") or die(mysql_error());
if(!$del) {
echo 'The user cannot be deleted at this time.';
} else {
echo 'The user has been deleted successfully!';
}
}
function adminGameMasterCreate($account, $charname) {
$make = mysql_query("UPDATE accounts SET accesslevel = '300' WHERE username = '$account'") or die(mysql_error());
$make = mysql_query("UPDATE entities SET char_name = '[GM]$charname' WHERE char_name = '$charname'") or die(mysql_error());
if($make) {
echo 'GameMaster creation successfull.';
} else {
echo 'Cannot create this GameMaster.';
}
}
function adminUserAlter($char, $str, $dex, $int, $zuly, $con, $level) {
$edit = mysql_query("UPDATE entities SET str = '$str' WHERE char_name = '$char'");
$edit = mysql_query("UPDATE entities SET dex = '$dex' WHERE char_name = '$char'");
$edit = mysql_query("UPDATE entities SET con = '$con' WHERE char_name = '$char'");
$edit = mysql_query("UPDATE entities SET _int = '$int' WHERE char_name = '$char'");
$edit = mysql_query("UPDATE entities SET zuly = '$zuly' WHERE char_name = '$char'");
$edit = mysql_query("UPDATE entities SET level = '$level' WHERE char_name = '$char'");
if(!$edit) {
echo 'One or more of the updates have failed.';
} else {
echo 'Character '.$char.' edited successfully.';
}
}
?>
PHP Code:
</div>
<div id="side-b">
<div id="servertitle"></div>
<div id="servercontent">
<embed src=http://flash-clocks.com/free-flash-clocks-blog-topics/free-flash-clock-183.swf width=200 height=50 wmode=transparent type=application/x-shockwave-flash></embed>
<div id="load"><a href="user_playersonline.php">Players Online: <font color="green"><?php echo onlinetotal(); ?></font></a><br />
Total Account: <font color="green"><?php echo acctotal(); ?></font><br />
Total Characters: <font color="green"><?php echo chartotal(); ?></font><br/>
Online: <?php echo worldServer($ip); ?><br/><?php echo loginServer($ip); ?><br/>
</div>
</div>
<div id="chattitle"></div>
<div id="abouttitleblank"></div>
</div>
</div>
</div>
</div>
</body>
</html>