View file forum/pod_forum.php

File size: 1.01Kb
<?php
require '../sys/dbconnect.php';
include_once '../sys/head.php';
$id = num($_GET['id']);
if(empty($id)){echo'<div class="name">Ошибка</div>';
include_once '../sys/foot.php';}    
$query = mysql_fetch_assoc(mysql_query("SELECT * FROM `pod_forum` WHERE `id`='$id' LIMIT 1"));
if(!$query){echo'<div class="name">Такого подфорума нет!!</div>';
include_once '../sys/foot.php';} //проверка
if(!isset($user)){

}
else{
$count_themes = mysql_result(mysql_query("SELECT COUNT(*) FROM `themes_forum` WHERE `id_pod_forum`='$id'"), 0);
$page = isset($_GET['p'])?num($_GET['p']):1;
$sql = @mysql_query("SELECT * FROM `themes_forum` WHERE `id_pod_forum`='$id' ORDER BY `id` DESC LIMIT ".(($page-1)*$user['points_page']).", $user[points_page] ");
while($themes = mysql_fetch_array($sql))
{
echo'<div class="name"><a href="themes.php?id='.num($themes['id']).'">'.output($themes['name']).'</a></div>';
}
nav($count_themes, $page, '?', $user['points_page']); 
}
include_once '../sys/foot.php';
?>