Просмотр файла forum/index.php

Размер файла: 898B
<? $page_name="Форум"; $dir='../'; include("../include/1.php"); require "../include/avto.php";

$cat_1=mysql_query("select * from `shurik_f_cat`");
if(mysql_num_rows($cat_1)==0)echo error('Форум пуст!' , '../');
$cat_2=mysql_fetch_array($cat_1);

do{$id_cat=$cat_2['id'];
$tem_v_cate1=mysql_query("select * from `shurik_f_tem` where `cat`='$id_cat' order by `time` desc");
$tem_v_cate2=mysql_num_rows($tem_v_cate1);
$tem_v_cate3=mysql_fetch_array($tem_v_cate1);
$tem_v_cate4=mysql_fetch_array(mysql_query("select * from `shurik_f_post` where tema='$tem_v_cate3[id]' order by date desc limit 1"));

echo "<a href=cat.php?id=$cat_2[id]>$cat_2[name]</a> ($tem_v_cate2/$cat_2[post])<br/>Тема: <a href=tema.php?id=$tem_v_cate3[id]>$tem_v_cate3[name]</a> ($tem_v_cate3[avtor]/$tem_v_cate4[avtor])<hr color=white>";}
while($cat_2=mysql_fetch_array($cat_1));

include("../include/2.php"); ?>