• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Uptime / Player Online Problem

Nux

Yzeria Custom War
Joined
Jan 2, 2009
Messages
1,067
Reaction score
1
Hello, well im having some trouble with my website, the uptime / players online is 0 even if 100 players are online or the server is up for 200 hours, What can cause this problems?
 
Well here it is,

PHP:
<?PHP
//start :)
session_start();
ob_start("ob_gzhandler");
//require('./exaBD.php');
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
//##### CONFIG #####
include('config-and-functions.php');
$action = $_REQUEST['action'];
//##### LOGOUT #####
if($action == "logout") 
{
	unset($_SESSION['account']);
	unset($_SESSION['password']);
}
//##### LOGIN #####
//check is player logged
$logged = FALSE;
if(isset($_SESSION['account'])) 
{
	$account_logged = $ots->createObject('Account');
	$account_logged->load($_SESSION['account']);
	if($account_logged->isLoaded() && $account_logged->getPassword() == $_SESSION['password']) 
	{
		$logged = TRUE;
		$group_id_of_acc_logged = $account_logged->getPageAccess();
	} 
	else 
	{
		$logged = FALSE;
		unset($_SESSION['account']);
		unset($account_logged);
	}
}
$login_account = strtoupper(trim($_POST['account_login']));
$login_password = trim($_POST['password_login']);
if(!$logged && !empty($login_account) && !empty($login_password)) 
{
	$login_password = password_ency($login_password);
	$account_logged = $ots->createObject('Account');
	$account_logged->find($login_account);
	if($account_logged->isLoaded()) 
	{
		if($login_password == $account_logged->getPassword()) 
		{
			$_SESSION['account'] = $account_logged->getId();
			$_SESSION['password'] = $login_password;
			$logged = TRUE;
			$account_logged->setCustomField("page_lastday", time());
			$group_id_of_acc_logged = $account_logged->getPageAccess();
		} 
		else
			$logged = FALSE;
	}
}
//#### LOAD PAGE ##########
//load subtopic page
if(empty($_REQUEST['subtopic'])) {
	$_REQUEST['subtopic'] = "latestnews";
	$subtopic = "latestnews";
}
switch($_REQUEST['subtopic']) {
	case "latestnews":
		$topic = "Latest News";
		$subtopic = "latestnews";
		include("latestnews.php");
	break;
	
//#### CUSTOM PAGES ##########
//load subtopic page
	
	case "raids";
		$subtopic = "raidschedule";
		$topic = "Raid Schedule";
		include("raids.php");
	break;
	
	case "terms";
		$subtopic = "donationterms";
		$topic = "Terms & Agreements";
		include("terms.php");
	break;
	
	case "wars";
		$subtopic = "guildwars";
		$topic = "Guild Wars";
		include("wars.php");
	break;
	
	case "downloadclient";
        $topic = "Download client?";
        $subtopic = "downloadclient";
        include("downloadclient.php");
    break;
	
	case "commands";
        $topic = "Commands list";
        $subtopic = "commands";
        include("commands.php");
    break;
	
	case "shop";
        $topic = "Gift Shop";
        $subtopic = "giftshop";
        include("shop.php");
    break;
	
	case "paypal";
        $topic = "Paypal Donation";
        $subtopic = "paypaldonation";
        include("paypal.php");
    break;
	
	case "zaypay";
        $topic = "Zaypay Donation";
        $subtopic = "zaypaydonation";
        $main_content .= '<div align="center"><br>
<b>*The 3 EUR option supports countries like Mexico!</b>
<br><iframe src="/zaypay/pay.php" width="98%"  
height="800px;"><p>Need IFRAME support, please download Opera,Firefox or Chrome</p></iframe></div>';
    break;
	
	case "archive";
		$subtopic = "archive";
		$topic = "News Archives";
		include("archive.php");
	break;
	
	case "serverinfo";
		$subtopic = "serverinfo";
		$topic = "Server Info";
		include("serverinfo.php");
	break;
	
	case "experiencetable";
		$topic = "Experience Table";
		$subtopic = "experiencetable";
		include("experiencetable.php");
	break;

	case "characters";
		$topic = "Characters";
		$subtopic = "characters";
		include("characters.php");
	break;
	case "whoisonline";
		$topic = "Who is online?";
		$subtopic = "whoisonline";
		include("whoisonline.php");
	break;
	case "highscores";
		$topic = "Highscores";
		$subtopic = "highscores";
		include("highscores.php");
	break;
	case "killstatistics";
		$topic = "Last Kills";
		$subtopic = "killstatistics";
		include("killstatistics.php");
	break;
  	case "bans":
 	    $topic = "Banishments";
    	$subtopic = "bans";
    	include("bans.php");
 	break;
	case "guilds";
		$topic = "Guilds";
		$subtopic = "guilds";
		include("guilds.php");
	break;

	case "forum":
		$topic = "Forum";
		$subtopic = "forum";
		include("forum.php");
	break;

	case "accountmanagement";
		$topic = "Account Management";
		$subtopic = "accountmanagement";
		include("accountmanagement.php");
	break;
	case "createaccount";
		$topic = "Create Account";
		$subtopic = "createaccount";
		include("createaccount.php");
	break;
	case "lostaccount";
		$topic = "Lost Account Interface";
		$subtopic = "lostaccount";
		include("lostaccount.php");
	break;
	case "downloads";
		$subtopic = "downloads";
		$topic = "Downloads";
		include("downloads.php");
	break;

	case "tibiarules";
		$topic = "Server Rules";
		$subtopic = "tibiarules";
		include("tibiarules.php");
	break;
	case "tracker";
		$subtopic = "tracker";
		$topic = "Tracker";
		include("tracker.php");
	break;
	case "changelog";
		$subtopic = "changelog";
		$topic = "Change Log";
		include("changelog.php");
	break;
	case "team";
		$subtopic = "team";
		$topic = "Gamemasters List";
		include("team.php");
	break;
	case "adminpanel":
		$topic = "Admin Panel";
		$subtopic = "adminpanel";
		include("adminpanel.php");
	break;
	case "namelock";
		$subtopic = "namelock";
		$topic = "Namelock Manager";
		include("namelocks.php");
	break;

	case "buypoints";
		$subtopic = "buypoints";
		$topic = "Buy Points";
		include("buypoints.php");
	break;
	case "shopsystem";
		$subtopic = "shopsystem";
		$topic = "Shop System";
		include("shopsystem.php");
	break;

  	case "credits":
 	    $topic = "Credits";
    	$subtopic = "credits";
    	include("credits.php");
 	break;
}
// ##### generate title of page
if(empty($topic)) 
{
	$title = $GLOBALS['config']['server']["serverName"]." - OTS";
	$main_content .= 'Invalid subtopic. Can\'t load page.';
} 
else
{
	$title = $GLOBALS['config']['server']["serverName"]." - ".$topic;
}
// ##### ADD Fotter for Credits
function getFooter()
{
	echo 'Neturia.net <a href="index.php?subtopic=credits">[Legal Credits]</a>. Layout by CipSoft GmbH.';
}
// ##### LAYOUT
$layout_header = '<script type=\'text/javascript\'>
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function MouseOverBigButton(source)
{
  source.firstChild.style.visibility = "visible";
}
function MouseOutBigButton(source)
{
  source.firstChild.style.visibility = "hidden";
}
function BigButtonAction(path)
{
  window.location = path;
}
var';
if($logged) { $layout_header .= "loginStatus=1; loginStatus='true';"; } else { $layout_header .= "loginStatus=0; loginStatus='false';"; };
$layout_header .= " var activeSubmenuItem='".$subtopic."';</script>";
include($layout_name."/layout.php");
ob_end_flush();
?>
 
post your layout.php insteed if u are useing gesior . :p I think..

Alright, well here is my layout.php

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?PHP echo $title ?></title>
<link rel="stylesheet" href="<?PHP echo $layout_name; ?>/neturia.css" type="text/css" />
</head>
<body class="thrColElsHdr">
<div id="container">
  <div id="header">
	<!-- end #header -->
  </div>
  <div id="sidebar1">
  <div id="sidebarback">
  <div id="sidebarhead">
  <div id="loginpanel">
  <div id="loginlol">
  <div align="center">
<?php if ($logged == 0)	
 echo '<form action="?subtopic=accountmanagement" method="post">
      <input type="text" name="name" value="Account Name" class="input" />
      <div id="logininput">
      <input type="password" name="pass" value="Password" class="input" />
      </div>
      <div id="loginbutton">
      <input type="submit" class="loginxd" value="" />
      </div>
  </form>
  <div id="recover">
  <div id="recoverlink"><a href="?subtopic=lostaccount">Recover your forgotten<br />
    password</a></div>
    </div>';
else
 echo '<form action="?subtopic=accountmanagement&action=logout" method="post">
      <input type="text" name="name" value="Account Name" class="input" />
      <div id="logininput">
      <input type="password" name="pass" value="Password" class="input" />
      </div>
      <div id="loginbutton">
      <input type="submit" class="loginxd" value="" />
      </div>
  </form>

<div id="recover">
  <div id="recoverlink">
<a href="?subtopic=accountmanagement">My Account
</a>
<br><a href="?subtopic=accountmanagement&action=logout">Logout
</a>
</div>
    </div>';
	?>

  </div>
  </div>
  </div>
  <div id="sidebarhead2">
  <div id="newshead">
  </div>
  </div>
  <div id="shadownews">
  <div id="menulinks">
    <div align="center"><a href="?subtopic=latestnews">Latest News</a><br />
          <a href="?subtopic=archive">News Archive</a>
      </div>
  </div>
  </div>
  <div id="positiony">
  <div id="sidebarhead3">
  <div id="accounthead">
  </div>
  </div>
  <div id="shadowaccount">
  <div id="menulinksaccount">
    <div align="center"><a href="?subtopic=accountmanagement">Manage Account</a><br />
          <a href="?subtopic=createaccount">Create Account</a><br />
          <a href="?subtopic=lostaccount">Lost Account?</a>
      </div>
  </div></div>
  </div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="communityhead">
  </div>
  </div>
  <div id="shadowcommunity">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=characters">Character</a><br />
          <a href="?subtopic=wars">!Guild Wars!</a><br />
          <a href="?subtopic=highscores">Highscores</a><br />
          <a href="?subtopic=guilds">Guilds</a><br />
          <a href="?subtopic=fragers">Top Fraggers</a><br />
          <a href="?subtopic=whoisonline">Who is Online?</a><br />
          <a href="?subtopic=bans">Banishments</a><br />
          <a href="?subtopic=forum">Forum</a>
      </div>
  </div></div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="libraryhead">
  </div>
  </div>
  <div id="shadowlibrary">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=houses">Houses</a><br />
<a href="?subtopic=commands">!Commands!</a><br />
<a href="?subtopic=raids">!Raid Schedule!</a><br />
          <a href="?subtopic=killstatistics">Latest Deaths</a><br />
          <a href="?subtopic=gallery">Gallery</a><br />
           </div>
  </div></div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="shophead">
  </div>
  </div>
  <div id="shadowshop">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=terms">Buy Points</a><br />
          <a href="?subtopic=shop">Shop Offer</a>
      </div>
  </div></div>
  </div>
  </div>
  </div>
  </div>
  </div>
  <div id="sidebarbackbuttom"></div><!-- end #sidebar1 -->
  </div>
  <div id="sidebar2">
  <div id="sidebarbackright">
  <div id="sidebarheadright">

  <div id="serverstatus">
  </div>
  </div>
  <div id="foreachlol">

<?PHP
			if($config['status']['serverStatus_online'] == 1)
  echo '<div id="onlinelol">
  </div>
  <div id="shadowstatus">
  <div id="informationonline">
  <br />
• IP: Neturia.net<br />
• Client: 8.70<br />
• Port: 7171<br />
• Players Online: '.$config['status']['serverStatus_players'].' <br/>
• Uptime: '.$config['status']['serverStatus_uptime'].'
  </div>
  </div>';
  else
echo  '<div id="offlinelol">
  </div>
  <div id="shadowstatus">
  <div id="informationoffline">
  <br />
• IP: Neturia.net<br />
• Client: 8.70<br />
• Port: 7171<br />
• Uptime: ---<br />
• Players: ---/---
  </div>
  </div>';
  ?>


</div>
  <div id="sidebarheadrightsearch">
  <div id="searchhead">
  </div>
  </div>
  <div id="searchbox" align="center">
  <form action="?subtopic=characters" method="post">
    <input type="text" name="name" value="Search character..." onfocus="this.value = ''" onblur="if(this.value == ''){ this.value = 'Search Character...'; }" class="input" /><br />
    <input type="submit" class="searchbutton" value="" />
    </form>
  </div>
  <div id="sidebarheadrightdonate">
  <div id="donatehead">
  </div>
  </div>
  <div id="donatebutton">
    <a href="?subtopic=terms"><img src="<?PHP echo $layout_name; ?>/images/donatebutton.png" /></a></div>
  <div id="sidebarheadrighthighscores">
  <div id="highscoreshead">
  </div>
  </div>
  <div id="shadowhighscores"><div id="highscoresplayers">
<?php include("topplayer.php"); ?>
</div>
  </div>
  </div>
  <div id ="sidebarbackrightbuttom">
  </div>
    <!-- end #sidebar2 --></div>
  <div id="mainContent">
  <div id="contenttop">
  <div id="contentbot">
  <div id="mainlol">
  <div id="mainintern">
  <div id="vt_content">
  <?PHP echo $main_content; ?> 
  </div>
  </div>
  </div>
  <div id="contentbottom"></div>
  <div id="footercontent" align="center">Copyright © 2011 Neturia<br />Designed And Coded By <a href="">Neturia</a><br />All Rights Reserved<p>
  </div>
  </div>
    <!-- end #mainContent -->
  </div>
<!-- end #container --></div>
</body>
</html>
 
Well, alright.

Here is my layout.php

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?PHP echo $title ?></title>
<link rel="stylesheet" href="<?PHP echo $layout_name; ?>/neturia.css" type="text/css" />
</head>
<body class="thrColElsHdr">
<div id="container">
  <div id="header">
	<!-- end #header -->
  </div>
  <div id="sidebar1">
  <div id="sidebarback">
  <div id="sidebarhead">
  <div id="loginpanel">
  <div id="loginlol">
  <div align="center">
<?php if ($logged == 0)	
 echo '<form action="?subtopic=accountmanagement" method="post">
      <input type="text" name="name" value="Account Name" class="input" />
      <div id="logininput">
      <input type="password" name="pass" value="Password" class="input" />
      </div>
      <div id="loginbutton">
      <input type="submit" class="loginxd" value="" />
      </div>
  </form>
  <div id="recover">
  <div id="recoverlink"><a href="?subtopic=lostaccount">Recover your forgotten<br />
    password</a></div>
    </div>';
else
 echo '<form action="?subtopic=accountmanagement&action=logout" method="post">
      <input type="text" name="name" value="Account Name" class="input" />
      <div id="logininput">
      <input type="password" name="pass" value="Password" class="input" />
      </div>
      <div id="loginbutton">
      <input type="submit" class="loginxd" value="" />
      </div>
  </form>

<div id="recover">
  <div id="recoverlink">
<a href="?subtopic=accountmanagement">My Account
</a>
<br><a href="?subtopic=accountmanagement&action=logout">Logout
</a>
</div>
    </div>';
	?>

  </div>
  </div>
  </div>
  <div id="sidebarhead2">
  <div id="newshead">
  </div>
  </div>
  <div id="shadownews">
  <div id="menulinks">
    <div align="center"><a href="?subtopic=latestnews">Latest News</a><br />
          <a href="?subtopic=archive">News Archive</a>
      </div>
  </div>
  </div>
  <div id="positiony">
  <div id="sidebarhead3">
  <div id="accounthead">
  </div>
  </div>
  <div id="shadowaccount">
  <div id="menulinksaccount">
    <div align="center"><a href="?subtopic=accountmanagement">Manage Account</a><br />
          <a href="?subtopic=createaccount">Create Account</a><br />
          <a href="?subtopic=lostaccount">Lost Account?</a>
      </div>
  </div></div>
  </div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="communityhead">
  </div>
  </div>
  <div id="shadowcommunity">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=characters">Character</a><br />
          <a href="?subtopic=wars">!Guild Wars!</a><br />
          <a href="?subtopic=highscores">Highscores</a><br />
          <a href="?subtopic=guilds">Guilds</a><br />
          <a href="?subtopic=fragers">Top Fraggers</a><br />
          <a href="?subtopic=whoisonline">Who is Online?</a><br />
          <a href="?subtopic=bans">Banishments</a><br />
          <a href="?subtopic=forum">Forum</a>
      </div>
  </div></div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="libraryhead">
  </div>
  </div>
  <div id="shadowlibrary">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=houses">Houses</a><br />
<a href="?subtopic=commands">!Commands!</a><br />
<a href="?subtopic=raids">!Raid Schedule!</a><br />
          <a href="?subtopic=killstatistics">Latest Deaths</a><br />
          <a href="?subtopic=gallery">Gallery</a><br />
           </div>
  </div></div>
  <div id="positionasdf">
  <div id="sidebarhead3">
  <div id="shophead">
  </div>
  </div>
  <div id="shadowshop">
  <div id="menulinkscommunity">
    <div align="center"><a href="?subtopic=terms">Buy Points</a><br />
          <a href="?subtopic=shop">Shop Offer</a>
      </div>
  </div></div>
  </div>
  </div>
  </div>
  </div>
  </div>
  <div id="sidebarbackbuttom"></div><!-- end #sidebar1 -->
  </div>
  <div id="sidebar2">
  <div id="sidebarbackright">
  <div id="sidebarheadright">

  <div id="serverstatus">
  </div>
  </div>
  <div id="foreachlol">

<?PHP
			if($config['status']['serverStatus_online'] == 1)
  echo '<div id="onlinelol">
  </div>
  <div id="shadowstatus">
  <div id="informationonline">
  <br />
• IP: Neturia.net<br />
• Client: 8.70<br />
• Port: 7171<br />
• Players Online: '.$config['status']['serverStatus_players'].' <br/>
• Uptime: '.$config['status']['serverStatus_uptime'].'
  </div>
  </div>';
  else
echo  '<div id="offlinelol">
  </div>
  <div id="shadowstatus">
  <div id="informationoffline">
  <br />
• IP: Neturia.net<br />
• Client: 8.70<br />
• Port: 7171<br />
• Uptime: ---<br />
• Players: ---/---
  </div>
  </div>';
  ?>


</div>
  <div id="sidebarheadrightsearch">
  <div id="searchhead">
  </div>
  </div>
  <div id="searchbox" align="center">
  <form action="?subtopic=characters" method="post">
    <input type="text" name="name" value="Search character..." onfocus="this.value = ''" onblur="if(this.value == ''){ this.value = 'Search Character...'; }" class="input" /><br />
    <input type="submit" class="searchbutton" value="" />
    </form>
  </div>
  <div id="sidebarheadrightdonate">
  <div id="donatehead">
  </div>
  </div>
  <div id="donatebutton">
    <a href="?subtopic=terms"><img src="<?PHP echo $layout_name; ?>/images/donatebutton.png" /></a></div>
  <div id="sidebarheadrighthighscores">
  <div id="highscoreshead">
  </div>
  </div>
  <div id="shadowhighscores"><div id="highscoresplayers">
<?php include("topplayer.php"); ?>
</div>
  </div>
  </div>
  <div id ="sidebarbackrightbuttom">
  </div>
    <!-- end #sidebar2 --></div>
  <div id="mainContent">
  <div id="contenttop">
  <div id="contentbot">
  <div id="mainlol">
  <div id="mainintern">
  <div id="vt_content">
  <?PHP echo $main_content; ?> 
  </div>
  </div>
  </div>
  <div id="contentbottom"></div>
  <div id="footercontent" align="center">Copyright © 2011 Neturia<br />Designed And Coded By <a href="">Neturia</a><br />All Rights Reserved<p>
  </div>
  </div>
    <!-- end #mainContent -->
  </div>
<!-- end #container --></div>
</body>
</html>
 
its alright, something isn't good with the serverstatus file

Well, here is the serverstatus file

PHP:
serverStatus_checkInterval = "303"
serverStatus_lastCheck = "1295953635"
serverStatus_online = "0"
serverStatus_players = "0"
serverStatus_playersMax = "0"
serverStatus_uptime = "0"
serverStatus_monsters = "0"
serverStatus_npc = "0"
serverStatus_npcs = "0"
 
where can i fix that problem then?.. since i dont have any clue where to change , i mean sometimes you can see uptime and when you refresh website it goes to 0 again.. =7
 
I know, that's when it tries to update it and store it in the file but fails. try to unset readonly property from the file, if it's set
 
what do you mean with "unset readonly property from the file"? where can i find that file which i shell change?
 
Last edited:
this file i mentioned previously >_>

PHP:
serverStatus_checkInterval = "303"
serverStatus_lastCheck = "1295953635"
serverStatus_online = "0"
serverStatus_players = "0"
serverStatus_playersMax = "0"
serverStatus_uptime = "0"
serverStatus_monsters = "0"
serverStatus_npc = "0"
serverStatus_npcs = "0"

alright where is that text "read only" ?
 
Back
Top