Elexonic
Well-Known Member
- Joined
- Jun 18, 2008
- Messages
- 1,920
- Reaction score
- 59
I have one problem in my ot, my status who is online only sum only players, ie as if the players that connect only sum and always leave them as online, this is my who is online.
PHP:
<?php
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
require("system/application/config/create_character.php");
echo '<br /><div align="center">';
@$_world = (int)$_REQUEST['world'];
if(!@$config['servers'][$_world]['vapusid'])
echo @"Please edit your config.php:<br /><span style=\"font-size: 8px\">\$config['servers'][{$_world}]['vapusid'] = ID; // Replace ID with the server id from **********<br />
To get the ID just register and click on the server the last number in the URL is your ID (/otlist.serv/10 means ID = 10)
</span>";
else
echo @'<a href="http://**********/otlist.serv/'.$config['servers'][$_world]['vapusid'].'"><img src="http://**********/otlist.graph/'.$config['servers'][$_world]['vapusid'].'/'.$config['VAPusGraphStep'].'" alt="http://********** Server Graph" /></a>';
echo "</div><br />";
$ide = new IDE;
try { $ide->loadInjections("players_online"); } catch(Exception $e) { error($e->getMessage()); }
echo form_open("character/online", array('method'=>'POST'));
if(count($config['worlds']) > 1) {
echo "<b>World </b> <select name='world'>";
echo "<option value=''>All</optino>";
foreach($config['worlds'] as $key=>$value) {
echo "<option ".set_select('world', $key)." value='$key'>$value</option>";
}
echo "</select> ";
}
echo "<b>Sort by </b> <select name='sort'>";
echo "<option value=''>None</option>";
echo "<option ".set_select('sort', 'level')." value='level'>Level</option>";
echo "<option ".set_select('sort', 'Vocation')." value='Vocation'>Profession</option>";
echo "<option ".set_select('sort', 'name')." value='name'>Name</option>";
echo "</select>";
echo " <input type='submit' value='Order'>";
echo "</form>";
echo "</form>";
echo "<table width='100%' cellspacing='1' cellpadding='3'>";
echo "<tr><td align=center><b>Outfit</b></td><td align=center><b>Name</b></td><td align=center><b>Level</b></td><td align=center><b>Vocation</b></td><td align=center><b>World</b></td></tr>";
$players = $SQL->query("SELECT `name`, `level`, `promotion`, `world_id`, `vocation`, `lookfeet`, `lookhead`, `looklegs`, `lookbody`, `looktype`, `lookaddons` FROM `players` WHERE `online`='0' ORDER BY `level` DESC;")->fetchAll();
foreach($players as $row) {
if(in_array(strtolower($row['name']), $config['restricted_names'])) continue;
echo "<tr><td><div style='position: relative; width: 64px; height: 32px;'><div style='background:transparent url(http://localhost/public/outfitter.php?id=".$row['looktype']."&addons=".$row['lookaddons']."&head=".$row['lookhead']."&body=".$row['lookbody']."&legs=".$row['looklegs']."&feet=".$row['lookfeet']."); position: absolute; width: 64px; height: 80px; background-position: bottom right; background-repeat: no-repeat; right: 0px; bottom: 0px;'></div></div></td><td align=center><a href=\"../character/view/".$row['name']."\">".$row['name']."</a></td><td align=center>".$row['level']."</td><td align=center>".getVocationName($row['vocation'], $row['promotion'])."</td><td align=center>".$config['worlds'][$row['world_id']]."</td></tr>";
}
echo "</table>";
?>