View file online.php

File size: 882B
<?php
// by mides, wmclub.mobi

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

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

$all_online = mysql_result(mysql_query("SELECT COUNT(`id_user`) FROM `online`"), 0);
if ($all_online > 0) {
	$pages = ceil($all_online/$config['onpage']);
	if (intval($_REQUEST['p'])) {
		$page = intval($_REQUEST['p']);
	} else {
		$page = 1;
	}
	$from = ($page-1)*$config['onpage'];

	$online_r = mysql_query("SELECT * FROM `online` ORDER BY `time` DESC LIMIT $from, $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');
?>