Файл: modules/forum/my.php
Строк: 32
<?php
$title = 'Темы и посты пользователя';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `users` WHERE `id`='".$_GET['id']."'")->num_rows==0){
error('Пользователя не существует!');
}
switch ($_GET['act']) {
case 'topic':
?>
<div class="title">Темы пользователя <?=nick($_GET['id'])?></div>
<?
$nav=new navig("SELECT * FROM `forum_topic` WHERE `id_us`='".$_GET['id']."'");
$q = $db->query("SELECT * FROM `forum_topic` WHERE `id_us`='".$_GET['id']."' ORDER BY `id` DESC LIMIT ".$nav->start.", ".$nav->nstr);
while($t = $q->fetch_assoc()){
?>
<div class="section"><a href="/forum/topic/<?=$t['id']?>"><?=htmlspecialchars($t['name'])?></a></div>
<?
}
?>
<div class="nvgstr">
<?
$nav->panel();
?>
</div>
<?
break;
case 'post':
?>
<div class="title">Посты пользователя <?=nick($_GET['id'])?></div>
<?
$nav=new navig("SELECT * FROM `forum_post` WHERE `id_us`='".$_GET['id']."'");
$q = $db->query("SELECT * FROM `forum_post` WHERE `id_us`='".$_GET['id']."' ORDER BY `id` DESC LIMIT ".$nav->start.", ".$nav->nstr);
while($p = $q->fetch_assoc()){
$t = $db->query("SELECT `id`, `name` FROM `forum_topic` WHERE `id`='".$p['id_topic']."'")->fetch_assoc();
?>
<div class="section">
Тема: <a href="/forum/topic/<?=$t['id']?>"><?=htmlspecialchars($t['name'])?></a><br/>
Пост: <?=output($p['text'])?>
</div>
<?
}
?>
<div class="nvgstr">
<?
$nav->panel();
?>
</div>
<?
break;
default:
break;
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>