измените код чтоб онлайн горм стало ато те игроки каторий зашли 5мин играли и вишли в онлайн их показивает и онлай менше нестановитса а болше!!!

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
<?php
require_once './element_options/element_options.php';
if (!$user) { header('Location: /'); exit; }
if (readcache('element_user_mesto'.$user['lost_id']) != 'Кто онлайн') writecache('element_user_mesto'.$user['lost_id'], 'Кто онлайн');
if ($go == 'search') {
$to = (isset($_GET['to']) AND !empty($_GET['to'])) ? addslashes(htmlspecialchars($_GET['to'])) : false;
$title = 'Поиск персонажа';
require_once './element_include/element_head.php';
require_once './element_include/element_header_user_true.php';
echo '<div class="nfl p5 mb5 mt5 mlra">';
echo '<div class="mb5 cntr small"><a class="button w50" href="/online">Кто онлайн</a></div>';
if ($to == 'go') {
$nick = (isset($_POST['nick']) AND !empty($_POST['nick'])) ? addslashes(htmlspecialchars(trim($_POST['nick']))) : false;
if ($nick) {
$query = mysql_query("SELECT `lost_id`,`lost_race`,`lost_login` FROM `element_user` WHERE `lost_login` LIKE '%$nick%' LIMIT 10");
$num_query = mysql_num_rows($query);
}
}
echo '<div class="cntr p5 mt5 mb5 mlra">
<form method="post" action="/online?go=search&to=go">
<input class="fdark w98 mb10" type="text" name="nick" value="'.((isset($nick) AND !empty($nick)) ? $nick : '').'" size="20" maxlength="255">
<span class="mt5 btn w30">
<span class="el"><span class="er">
<input class="ttl" type="submit" id="" name="submit" value="Искать">
</span></span>
</span>
</form></div>';
if ($to == 'go' AND isset($num_query)) {
if ($num_query > 0) {
echo '<div class="nf2 small p5 yellow1 mt5 mlra">';
$color = 1;
while ($myrrow = mysql_fetch_array($query)) {
if ($color % 2) $odd = ' odd'; else $odd = '';
echo '
<div class="ml5 mr5">
<a class="bl p5 small block'.$odd.'" href="/user?id='.$myrrow['lost_id'].'">
<span class="white small fr">'.$mesto.'</span>
'.ikonka_user($myrrow['lost_race'], ((!empty($online[$myrrow['lost_id']])) ? 'online' : 'offline')).' <span class="yellow1">'.$myrrow['lost_login'].'</span>
</a>
</div>
';
$color++;
}
echo '</div>';
} else echo '<div class="nf2 small p5 cntr red mt5 mlra">Персонаж "'.$nick.'" не найден</div>';
}
echo '</div>';
require_once './element_include/element_foot_user_true.php';
exit;
}
$title = 'Кто онлайн: '.count($online);
require_once './element_include/element_head.php';
require_once './element_include/element_header_user_true.php';
echo '<div class="nfl p5 mb5 mt5 mlra">';
echo '<div class="mb5 cntr small"><a class="button w50" href="/online?go=search">Поиск по нику</a></div>';
if (!empty($online)) {
arsort($online);
require_once './element_function/element_function_pagination.php';
$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
$pagination = pagination(10, $page, count($online));
$color = $pagination['start'];
echo '<div class="mt5 mlra">';
$i = $pagination['start'] + 1;
foreach(array_slice($online, $pagination['start'], $pagination['num'], true) as $id => $massiv) {
$online_user = cache_user($id);
if ($color % 2) $odd = ''; else $odd = ' odd';
$explode = explode(" ", $massiv);
$mesto = readcache('element_user_mesto'.$id);
$mesto = (!empty($mesto)) ? $mesto : 'На сайте';
echo '
<div class="ml5 mr5">
<a class="bl p5 small block'.$odd.'" href="/user?id='.$id.'">
<span class="white small fr">'.$mesto.'</span>
'.$i.'. '.ikonka_user($online_user['lost_race'], 'online').' <span class="yellow1">'.$online_user['lost_login'].'</span>
</a>
</div>
';
$color++;
$i++;
}
echo '</div>';
}
echo '</div>';
echo pagination_echo($pagination['page'],$pagination['total'],'/online?page=');
require_once './element_include/element_foot_user_true.php';
?>