View file forum/themes.php

File size: 1.39Kb
<?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 `themes_forum` WHERE `id`='$id' LIMIT 1"));
if(!$query){echo'<div class="name">Такой темы!!</div>';
include_once '../sys/foot.php';} 
if(!isset($user)){ 

}

else{
$count_post = 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_fetch_array(mysql_query("SELECT * FROM `themes_forum` WHERE `id_pod_forum`='$id' ORDER BY `id` DESC LIMIT ".(($page-1)*$user['points_page']).", $user[points_page] "));
echo'<div class="cat">'.$sql['name'].'</div>
	 <div class="login">1.<a href="'.$HOME.'/'.num($sql['id_user']).'.html">';
$user_add_news = mysql_fetch_assoc(mysql_query("SELECT `name` FROM `user_ank` WHERE`id_user`='$sql[id_user]'")); 
						echo $sql['text'].'</div>';
//while($themes = mysql_fetch_array($sql))
//{
//echo'<div class="name"><a href="themes.php?id='.num($themes['id']).'">'.output($themes['name']).'</a></div>';
//}

//кто шарит чё это может разкоментировать,хотя я думаю что не надо
//а кто не знает маме привет
}
include_once '../sys/foot.php';
?>