View file online.php

File size: 829B
<?php
// by mides, 1da.su

$title = 'Онлайн';
require_once 'system/sys.php';
require_once 'system/header.php';

tp('Кто, где');

$total = mysql_result(mysql_query("SELECT COUNT(`id_user`) FROM `online`"), 0);
if ($total > 0) {
	$pages = ceil($total / $config['onpage']);
	if ($page > $pages or $page == 0) {
		$page = 1;
	}
	$begin = ($page - 1) * $config['onpage'];

	$online_r = mysql_query("SELECT * FROM `online` ORDER BY `time` DESC LIMIT $begin, $config[onpage]");
	while($online = mysql_fetch_assoc($online_r)){
		if (empty($online['place'])) $online['place'] = 'Главная';
		echo '<a href="profile.php?id='.$online['id_user'].'">'.login($online['id_user']).'</a> ['.$online['place'].']<br />';
	}
	navig($page, '?', $pages);
}
nav_main();

require_once ('system/tail.php');
?>