• 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!

Cipsofts borders?

PHP:
$main_content .= '<div class="TableContainer" >
  <table class="Table1" cellpadding="0" cellspacing="0" >
    <div class="CaptionContainer" >
      <div class="CaptionInnerContainer" >
        <span class="CaptionEdgeLeftTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionBorderTop" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionVerticalLeft" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <div class="Text" >World Information</div>
        <span class="CaptionVerticalRight" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <span class="CaptionBorderBottom" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionEdgeLeftBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
      </div>
    </div>
    <tr>
      <td>
        <div class="InnerTableContainer" >
          <table style="width:100%;" >
<tr>
<td class="LabelV" >
<span >Status:</span>
</td>
<td style="width:100%;" >Online</td>
</tr>
<tr>
<td class="LabelV" ><span >Players Online:</span></td><td>35 (1 are Away from keyboard)</td>
</tr>
<td class="LabelV" ><span >Online Record:</span></td><td>67 players (on 20 March 2011, 8:14 pm)</td>
</tr>
<td class="LabelV" ><span >Creation Date:</span></td><td>18 February 2011</td>
</tr>
<td class="LabelV" ><span >Location:</span></td><td>Sweden</td>
</tr>
<td class="LabelV" ><span >PvP Type:</span></td><td>Open-PVP</td></tr><td class="LabelV" ><span>
World Quest Titles:
</span>
</td>
<td>
This game world currently has no title.
</td>
</tr>          </table>
        </div>
  </table>
</div>
</td>
</tr>
<br/>';

Try this, I don't test it. Put this in whoisonline.php if you have problem post it.
 
Add only functions in lines:
Code:
35 (1 are Away from keyboard) = '.$config['status']['serverStatus_players'] .' ('.($players['online']-$config['status']['serverStatus_players']).' are Away from keyboard)
 
How can i get this part? And thanks for helping :)

PHP:
<td class="LabelV" ><span >Online Record:</span></td><td>67 players (on 20 March 2011, 8:14 pm)</td>

PHP:
$SQL->query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 1;');

I know it needs this querry but where should i add it?:p

Here is my whoisonline.php

Lua:
<?PHP
$main_content .= '<div class="TableContainer" >
  <table class="Table1" cellpadding="0" cellspacing="0" >
    <div class="CaptionContainer" >
      <div class="CaptionInnerContainer" >
        <span class="CaptionEdgeLeftTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionBorderTop" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionVerticalLeft" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <div class="Text" >World Information</div>
        <span class="CaptionVerticalRight" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <span class="CaptionBorderBottom" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionEdgeLeftBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
      </div>
    </div>
    <tr>
      <td>
        <div class="InnerTableContainer" >
          <table style="width:100%;" >
<tr>
<td class="LabelV" >
<span >Status:</span>
</td>
<td style="width:100%;" >Online</td>
</tr>
<tr>
<td class="LabelV" ><span >Players Online:</span></td><td>'.$config['status']['serverStatus_players'].'</td>
</tr>
<td class="LabelV" ><span >Online Record:</span></td><td>67 players (on 20 March 2011, 8:14 pm)</td>
</tr>
<td class="LabelV" ><span >Creation Date:</span></td><td>26 February 2011</td>
</tr>
<td class="LabelV" ><span >Location:</span></td><td>Europe</td>
</tr>
<td class="LabelV" ><span >PvP Type:</span></td><td>Open PVP</td></tr><td class="LabelV" ><span>
World Quest Titles:
</span>
</td>
<td>
This game world currently has no title.
</td>
</tr>          </table>
        </div>
  </table>
</div>
</td>
</tr>
<br/>';
$update_interval = 1;
if(count($config['site']['worlds']) > 1)
{
	$worlds .= '<i>Select world:</i> ';
	foreach($config['site']['worlds'] as $id => $world_n)
	{
		$worlds .= ' <a href="?subtopic=whoisonline&world='.$id.'">'.$world_n.'</a> , ';
		if($id == (int) $_GET['world'])
		{
			$world_id = $id;
			$world_name = $world_n;
		}
	}
	$main_content .= substr($worlds, 0, strlen($worlds)-3);
}
if(!isset($world_id))
{
	$world_id = 0;
	$world_name = $config['server']['serverName'];
}
$order = $_REQUEST['order'];
if($order == 'level')
	$orderby = 'level';
elseif($order == 'vocation')
	$orderby = 'vocation';
if(empty($orderby))
	$orderby = 'name';
$tmp_file_name = 'cache/whoisonline-'.$orderby.'-'.$world_id.'.tmp';
if(file_exists($tmp_file_name) && filemtime($tmp_file_name) > (time() - $update_interval))
{
	$tmp_file_content = explode(",", file_get_contents($tmp_file_name));
	$number_of_players_online = $tmp_file_content[0];
	$players_rows = $tmp_file_content[1];
}
else
{
	$players_online_data = $SQL->query('SELECT * FROM players WHERE world_id = '.(int) $world_id.' AND online > 0 ORDER BY '.$orderby);
	$number_of_players_online =0;
	foreach($players_online_data as $player)
	{
		$number_of_players_online++;
		$acc = $SQL->query('SELECT * FROM '.$SQL->tableName('accounts').' WHERE '.$SQL->fieldName('id').' = '.$player['account_id'].'')->fetch();
		if(is_int($number_of_players_online / 2))
			$bgcolor = $config['site']['darkborder'];
		else
			$bgcolor = $config['site']['lightborder'];
			 $rs = "";
if ($player['skulltime'] > 0 && $player['skull'] == 3)
                $rs = "<img style='border: 0;' src='./images/whiteskull.gif'/>";
        elseif ($player['skulltime'] =  $player['skull'] == 6)
                $rs = "<img style='border: 0;' src='./images/redskull.gif'/>";
        elseif ($player['skulltime'] =  $player['skull'] == 10)
                $rs = "<img style='border: 0;' src='./images/blackskull.gif'/>";
                
		$players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=10%><image src="images/flags/'.$acc['flag'].'.png"/></TD><TD WIDTH=70%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].$rs.'</A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$vocation_name[$world_id][$player['promotion']][$player['vocation']].'</TD></TR>';
	}
	file_put_contents($tmp_file_name, $number_of_players_online.','.$players_rows);
}
if($number_of_players_online == 0)
	//server status - server empty
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on   <b>'.$config['site']['worlds'][$world_id].'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
else
{
//Vocations pics
$vocs = array();
foreach($SQL->query('SELECT `vocation`, COUNT(`id`) AS `count` FROM `players` WHERE `world_id` = "'.$world_id.'" AND `online` > 0 GROUP BY `vocation`') as $entry)
	  $vocs[$entry['vocation']] = $entry['count'];
$main_content .= '';

	//server status - someone is online
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are Online - <b>'.$config['status']['serverStatus_players'] .' are active</b> and, '.($number_of_players_online-$config['status']['serverStatus_players']).' are AFK.</TD></TR></TABLE></TD></TR></TABLE><BR>'; 
	
      //list of players
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD><a href="" CLASS=white >Country</a></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.$world_id.'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.$world_id.'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>';
	//search bar
	$main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post>  <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
?>
 
Last edited:
Code:
<?php
$cache_sec = 10;
$info = array(
	0 => array('Europe', '03/11')
);

$id=0;
if(isset($_POST['world'])) {
	$f = null;
	foreach($config['site']['worlds'] as $k => $v)
		if($v == $_POST['world']) {
			$f = true;
			$id = $k;
			break;
		}
	if(!$f)
		$_POST['world'] = $config['site']['worlds'][0];
} else $_POST['world'] = $config['site']['worlds'][0];

$order = 'name_asc';
if(isset($_REQUEST['order']) && in_array($_REQUEST['order'], array('name_desc', 'level_asc','level_desc','vocation_asc','vocation_desc')))
	$order = $_REQUEST['order'];

if(count($config['site']['worlds']) > 1) {
	$main_content =
'<form action="?subtopic=whoisonline" method="post">
	<div class="TableContainer">
		<table class="Table1" cellpadding="0" cellspacing="0">
			<div class="CaptionContainer">
				<div class="CaptionInnerContainer">
					<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
					<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
					<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
					<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
					<div class="Text">World Selection</div>
					<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
					<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
					<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
					<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
				</div>
			</div>
			<tr>
				<td>
					<div class="InnerTableContainer">
						<table width="100%">
							<tr>
								<td style="vertical-align:middle" class="LabelV150">World Name:</td>
								<td style="width:170px">
									<select size="1" name="world" style="width:165px">';
foreach($config['site']['worlds'] as $v)
	$main_content .= '<option value="'.$v.'"'.($v == $_POST['world'] ? ' selected="selected"' : '').'>'.$v.'</option>';
$main_content .= '
									</select>
								</td>
								<td style="text-align:left">
									<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
										<div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div>
											<input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"/>
										</div>
									</div>
								</td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
	</div>
</form><br/>
';
}
$main_content .=
'<div class="TableContainer">
	<table class="Table1" cellpadding="0" cellspacing="0">
		<div class="CaptionContainer">
			<div class="CaptionInnerContainer">
				<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
				<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
				<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
				<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
				<div class="Text">World Information</div>
				<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>
				<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>
				<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
				<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>
			</div>
		</div>
		<tr>
			<td>
				<div class="InnerTableContainer">
					<table width="100%">
						<tr>
							<td class="LabelV150">Status:</td>
							<td>O'.($config['status']['serverStatus_online'] == 1 ? 'n' : 'ff').'line</td>
						</tr>
						<tr>
							<td class="LabelV150">Players Online:</td>
							<td>';
$f = 'cache/whoisonline-'.$_POST['world'].'-'.$order.'.tmp';
$ff = 'cache/whoisonline-'.$_POST['world'].'-record.tmp';
if(file_exists($f) && filemtime($f) > (time() - $cache_sec)) {
	$cp = file_get_contents($f);
	$cached = null;
	if(file_exists($f) && filemtime($f) > (time() - $cache_sec)) {
		$e = explode('|', file_get_contents($ff));
		$n = $e[0];
		$c = $e[1];
		$cached = true;
	}
}
else {
	$cp = '';
	$n = 0;
	$q = 'SELECT name,level,vocation,promotion FROM players WHERE world_id='.$id.' AND online=1';
	if(in_array($order, array('name_asc','name_desc','level_asc','level_desc')))
		$q .= ' ORDER BY '.str_replace('_', ' ', $order);

	if(in_array($order, array('vocation_asc','vocation_desc'))) {
		$a = array();
		$q .= ' ORDER BY level desc';
		foreach($SQL->query($q)->fetchAll() as $p)
			$a[] = array($p['name'], $p['level'], $vocation_name[$id][$p['promotion']][$p['vocation']]);
		function cmp($a, $b) {
			return $a[2][0] == $b[2][0] ? 0 :
				$GLOBALS['order'] == 'vocation_asc'
					? ($a[2][0] < $b[2][0] ? -1 : 1)
					: ($a[2][0] > $b[2][0] ? -1 : 1);
		}
		usort($a, 'cmp');
		foreach($a as $p) {
			$n++;
			$cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'" style="text-align:right"><td style="width:70%;text-align:left"><a href="?subtopic=characters&name='.urlencode($p[0]).'">'.$p[0].'</a></td><td style="width:10%">'.$p[1].'</td><td style="width:20%">'.str_replace(' ','*',$p[2]).'</td></tr>';
		}
	}
	else {
		$l = array();
		foreach($SQL->query($q)->fetchAll() as $p) {
			$n++;
			$cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'" style="text-align:right"><td style="width:70%;text-align:left">';
			if($order == 'name_asc') {
				$tmp = strtoupper($p['name'][0]);
				if(!in_array($tmp, $l)) {
					$l[] = $tmp;
					$cp .= '<a name="'.$tmp.'"></a>';
				}
			}
			$cp .= '<a href="?subtopic=characters&name='.urlencode($p['name']).'">'.$p['name'].'</a></td><td style="width:10%">'.$p['level'].'</td><td style="width:20%">'.str_replace(' ','*',$vocation_name[$id][$p['promotion']][$p['vocation']]).'</td></tr>';
		}
	}
	file_put_contents($f, $cp);
}
if(!$cached) {
	$r=$SQL->query('SELECT MAX(record) as r,MAX(timestamp) as t FROM server_record WHERE world_id='.$id)->fetch();
	$c = $r['r'].' players (on '.date('M*d*Y,*H:i:s*T', $r['t']).')';
	file_put_contents($ff, $n.'|'.$c);
}
$main_content .= $n.'</td>
						</tr>
						<tr>
							<td class="LabelV150">Online Record:</td>
							<td>'.$c.'</td>
						</tr>
						<tr>
							<td class="LabelV150">Creation Date:</td>
							<td>'.$info[$id][1].'</td>
						</tr>
						<tr>
							<td class="LabelV150">Location:</td>
							<td>'.$info[$id][0].'</td>
						</tr>
						<tr>
							<td class="LabelV150">PvP Type:</td>
							<td>';
$w=strtolower($config['server']['worldType']);
if(in_array($w, array('pvp','2','normal','open','openpvp')))
	$main_content .= 'Open PvP';
elseif(in_array($w, array('no-pvp','nopvp','non-pvp','nonpvp','1','safe','optional','optionalpvp')))
	$main_content .= 'Optional PvP';
elseif(in_array($w, array('pvp-enforced','pvpenforced','pvp-enfo','pvpenfo','pvpe','enforced','enfo','3','war','hardcore','hardcorepvp')))
	$main_content .= 'Hardcore PvP';
$main_content .= '</td>
						</tr>
					</table>
				</div>
			</td>
		</tr>
	</table>
</div><br/>
	<div class="TableContainer">
		<table class="Table2" cellpadding="0" cellspacing="0">    <div class="CaptionContainer">      <div class="CaptionInnerContainer">        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>        <div class="Text">Players Online';
if($order == 'name_asc')
	$main_content .= '<span class="TableHeadlineNavigation"> [ <a href="#A">A</a> <a href="#B">B</a> <a href="#C">C</a> <a href="#D">D</a> <a href="#E">E</a> <a href="#F">F</a> <a href="#G">G</a> <a href="#H">H</a> <a href="#I">I</a> <a href="#J">J</a> <a href="#K">K</a> <a href="#L">L</a> <a href="#M">M</a> <a href="#N">N</a> <a href="#O">O</a> <a href="#P">P</a> <a href="#Q">Q</a> <a href="#R">R</a> <a href="#S">S</a> <a href="#T">T</a> <a href="#U">U</a> <a href="#V">V</a> <a href="#W">W</a> <a href="#X">X</a> <a href="#Y">Y</a> <a href="#Z">Z</a> ]**</span>';
$main_content .= '</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer">          <table width="100%"><tr class="LabelH"><td style="text-align:left;width:90%">Name**<small style="font-weight:normal">[<a href="?subtopic=whoisonline&world='.$_POST['world'].'&order=name_'.($order == 'name_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'name_asc' ? 'content/order_desc' : ($order == 'name_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td><td>Level**<small style="font-weight:normal">[<a href="?subtopic=whoisonline&world='.$_POST['world'].'&order=level_'.($order == 'level_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'level_asc' ? 'content/order_desc' : ($order == 'level_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td><td>Vocation**<small style="font-weight:normal">[<a href="?subtopic=whoisonline&world='.$_POST['world'].'&order=vocation_'.($order == 'vocation_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'vocation_asc' ? 'content/order_desc' : ($order == 'vocation_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td></tr>'.$cp.'          </table>        </div>  </table></div></td></tr><br/><form action="?subtopic=characters" method="post"><div class="TableContainer">  <table class="Table1" cellpadding="0" cellspacing="0">    <div class="CaptionContainer">      <div class="CaptionInnerContainer">        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>        <div class="Text">Search Character</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer">          <table width="100%"><tr><td style="vertical-align:middle" class="LabelV150">Character Name:</td><td style="width:170px"><input style="width:165px" name="name" value="" size="29" maxlength="29"/></td><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"></div></div></td></tr>          </table>        </div>  </table></div></td></tr></form></center>';
?>
 
yep you're missing
order_desc.gif
and
order_asc.gif
(www/layouts/t/images/content/)

you're getting asterisks because your php doesn't support some extension or encoding, try replacing all &#160; with &nbsp;

it would also look better if you added this into your basic.css
Code:
.LabelV150
{
  font-weight:700;
  padding-right:10px;
  white-space:nowrap;
  vertical-align:top;
  width:150px;
}

.TableHeadlineNavigation
{
  margin-top:4px;
  font-size:8px;
  float:right;
}

.TableHeadlineNavigation a,.TableHeadlineNavigation a:hover
{
  color:#FFF;
}
 
Last edited:
Which file do i need to edit the * ~ &nbsp;


And Thank you so much for helping with this, seriously it looks amazing.
Appreciate this so much. x x
 
Thank you so much :)

One more question and thats me done, is it possible to add in this particular line

Code:
Players Online: 	163

So that it shows Online/AFK players?

PHP:
<td class="LabelV150">Players Online:</td><td>'.$config['status']['serverStatus_players'].'</td>

Tried the above but failed :p

Thank you x x
 
Thank you so much :)

One more question and thats me done, is it possible to add in this particular line

Code:
Players Online: 	163

So that it shows Online/AFK players?

PHP:
<td class="LabelV150">Players Online:</td><td>'.$config['status']['serverStatus_players'].'</td>

Tried the above but failed :p

Thank you x x

Make a lua script that players who have been afk for more then 15 mins, it will connect to a certain query in the database and add that player to the query (you have to create a new query for this ofcourse).
Then edit your current php code and add that query, and make it connect to database.
 
There has been a code released for this, just having issues with adding it. :p
So that it will show in the correct line along with (Players xx) Because when i add it now it goes to a different line :p
 
sorting by vocation seems to be bugged. the string compare function is failing, they're also not being sorted by level when you order them by vocation
 
Still it's quite nice, and the only thing is missing is the show/afk which i can't seem to figure out which line to add it at.

PHP:
//server status - someone is online
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are Online - <b>'.$config['status']['serverStatus_players'] .' are active</b> and, '.($number_of_players_online-$config['status']['serverStatus_players']).' are AFK.</TD></TR></TABLE></TD></TR></TABLE><BR>';
 
But it worked fine in previous script? ;o

for e.g

Aeron - Who is online?

Currently 153 players are Online - 90 are active and, 63 are AFK.

That is all i want, because that is what Xinn is looking for.
I'm not really worried how much exactly it works corretcly, as long as the script provided by Kula/Xinn is in there somewhere.

Here is the full script.
PHP:
<?PHP
$main_content .= '<div class="TableContainer" >
  <table class="Table1" cellpadding="0" cellspacing="0" >
    <div class="CaptionContainer" >
      <div class="CaptionInnerContainer" >
        <span class="CaptionEdgeLeftTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightTop" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionBorderTop" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionVerticalLeft" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <div class="Text" >World Information</div>
        <span class="CaptionVerticalRight" style="background-image:url(layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
        <span class="CaptionBorderBottom" style="background-image:url(layouts/tibiacom/images/content/table-headline-border.gif);" ></span>
        <span class="CaptionEdgeLeftBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
        <span class="CaptionEdgeRightBottom" style="background-image:url(layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
      </div>
    </div>
    <tr>
      <td>
        <div class="InnerTableContainer" >
          <table style="width:100%;" >
<tr>
<td class="LabelV" >
<span >Status:</span>
</td>
<td style="width:100%;" >Online</td>
</tr>
<tr>
<td class="LabelV" ><span >Players Online:</span></td><td>'.$config['status']['serverStatus_players'].'</td>
</tr>
<td class="LabelV" ><span >Online Record:</span></td><td>67 players (on 20 March 2011, 8:14 pm)</td>
</tr>
<td class="LabelV" ><span >Creation Date:</span></td><td>26 February 2011</td>
</tr>
<td class="LabelV" ><span >Location:</span></td><td>Europe</td>
</tr>
<td class="LabelV" ><span >PvP Type:</span></td><td>Open PVP</td></tr><td class="LabelV" ><span>
World Quest Titles:
</span>
</td>
<td>
This game world currently has no title.
</td>
</tr>          </table>
        </div>
  </table>
</div>
</td>
</tr>
<br/>';
$update_interval = 1;
if(count($config['site']['worlds']) > 1)
{
	$worlds .= '<i>Select world:</i> ';
	foreach($config['site']['worlds'] as $id => $world_n)
	{
		$worlds .= ' <a href="?subtopic=whoisonline&world='.$id.'">'.$world_n.'</a> , ';
		if($id == (int) $_GET['world'])
		{
			$world_id = $id;
			$world_name = $world_n;
		}
	}
	$main_content .= substr($worlds, 0, strlen($worlds)-3);
}
if(!isset($world_id))
{
	$world_id = 0;
	$world_name = $config['server']['serverName'];
}
$order = $_REQUEST['order'];
if($order == 'level')
	$orderby = 'level';
elseif($order == 'vocation')
	$orderby = 'vocation';
if(empty($orderby))
	$orderby = 'name';
$tmp_file_name = 'cache/whoisonline-'.$orderby.'-'.$world_id.'.tmp';
if(file_exists($tmp_file_name) && filemtime($tmp_file_name) > (time() - $update_interval))
{
	$tmp_file_content = explode(",", file_get_contents($tmp_file_name));
	$number_of_players_online = $tmp_file_content[0];
	$players_rows = $tmp_file_content[1];
}
else
{
	$players_online_data = $SQL->query('SELECT * FROM players WHERE world_id = '.(int) $world_id.' AND online > 0 ORDER BY '.$orderby);
	$number_of_players_online =0;
	foreach($players_online_data as $player)
	{
		$number_of_players_online++;
		$acc = $SQL->query('SELECT * FROM '.$SQL->tableName('accounts').' WHERE '.$SQL->fieldName('id').' = '.$player['account_id'].'')->fetch();
		if(is_int($number_of_players_online / 2))
			$bgcolor = $config['site']['darkborder'];
		else
			$bgcolor = $config['site']['lightborder'];
			 $rs = "";
if ($player['skulltime'] > 0 && $player['skull'] == 3)
                $rs = "<img style='border: 0;' src='./images/whiteskull.gif'/>";
        elseif ($player['skulltime'] =  $player['skull'] == 6)
                $rs = "<img style='border: 0;' src='./images/redskull.gif'/>";
        elseif ($player['skulltime'] =  $player['skull'] == 10)
                $rs = "<img style='border: 0;' src='./images/blackskull.gif'/>";
                
		$players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=10%><image src="http://otland.net/images/flags/'.$acc['flag'].'.png"/></TD><TD WIDTH=70%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].$rs.'</A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$vocation_name[$world_id][$player['promotion']][$player['vocation']].'</TD></TR>';
	}
	file_put_contents($tmp_file_name, $number_of_players_online.','.$players_rows);
}
if($number_of_players_online == 0)
	//server status - server empty
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on   <b>'.$config['site']['worlds'][$world_id].'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
else
{
//Vocations pics
$vocs = array();
foreach($SQL->query('SELECT `vocation`, COUNT(`id`) AS `count` FROM `players` WHERE `world_id` = "'.$world_id.'" AND `online` > 0 GROUP BY `vocation`') as $entry)
	  $vocs[$entry['vocation']] = $entry['count'];
$main_content .= '';

	//server status - someone is online
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are Online - <b>'.$config['status']['serverStatus_players'] .' are active</b> and, '.($number_of_players_online-$config['status']['serverStatus_players']).' are AFK.</TD></TR></TABLE></TD></TR></TABLE><BR>'; 
	
      //list of players
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD><a href="" CLASS=white >Country</a></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.$world_id.'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.$world_id.'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>';
	//search bar
	$main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post>  <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
?>


I know i ask for alot, if you'd like i will be very happy to pay you for the time you spend doing this and finishing this for me :p
it's just something that needs to be done in order so i can have my server back on Xinns list. :L
 
Last edited:
hmm, have you edited your sources to only count active connections as online players? (kula's patch)
because it seems to be doing that now
 
PHP:
$main_content .= $n.'</td>
PHP:
$main_content .= $n.' ('.$config['status']['serverStatus_players'] .' active &amp; '.($n-$config['status']['serverStatus_players']).' AFK)</td>
 
Back
Top