Просмотр файла usert.php

Размер файла: 978B
<?php
include 'inc/db.php';
include 'inc/1.php';
$id=intval($_GET['id']);
if (!$_GET['id']){header("Location: /index.php");
exit;}
$ank=gus($id);
if ($ank['name']==''){header("Location: /index.php");
exit;}
echo "<div class='t2'>Темы пользователя</div>";
if (!$_GET['p'])$_GET['p']=1;
$p=intval($_GET['p']);
$start=(($p*15)-15);
$q=mysql_query("SELECT `id`, `name`, `time` FROM `forum` WHERE `user` = '$id' ORDER BY `time` DESC LIMIT $start, 15");
$b=1;
while ($f=mysql_fetch_assoc($q)){
$post=($b%2);
echo "<div class='p$post'>";
$name=out($f['name']);
$time=vremja($f['time']);
echo "<a href='theme.php?id=$f[id]'>$name</a> ($ank[name])<br>[$time]";
echo "</div>";
$b++;
}
$q1=(mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$id'"))/15);
$q2=round(mysql_num_rows(mysql_query("SELECT `id` FROM `forum` WHERE `user` = '$id'"))/15);
if ($q1>$q2)$pages=($q2+1);
pages($pages, $p, "?p");
include 'inc/foot.php';
?>