Размер файла: 2.58Kb
<?
session_start();
include ("header.php");
$date=date("Ymd");
$forums="Общий форум";
if (!$autorize) {
echo $div["header"];
echo "[<a href=\"login.php?".session_name()."=".session_id()."\">Вход</a>][<a href=\"reg.php\">Регистрация</a>]<br/>";
echo $div["end"];
}
echo $div["header"];
echo "[<a href=\"index.php?".session_name()."=".session_id()."\">Список форумов</a>]<br/>";
echo $div["end"];
echo $div["div"];
if ($_SESSION['wap']!="xml") {echo "<br/>";}
if(empty($start)) $start = 0;
$start=intval($start);
if($start<0) $start=0; $num_msgs=10;
$arr = mysql_query("select * from forum where (`t`=1);");
$q = mysql_query("select * from forum where (`t`=1) order by `id_msg` desc limit $start,$num_msgs;");
$reg=mysql_num_rows($arr);
//echo "Найдено: $reg<br/>";
echo $div["end"];
if (mysql_affected_rows()==0)
{
echo $div["ten"];
echo "Нет тем...<br/>";
echo $div["end"];
}
else
{
echo $div["ten"];
while ($field=mysql_fetch_array($q))
{
$forum=$field['forums'];
$podforum=$field['podforums'];
$tema=$field['themes'];
$id=$field['id'];
$who=$field['who'];
$qi = mysql_query("select * from messages where ((forums='$forum')and(podforums='$podforum')and(themes='$tema'));");
$row=mysql_fetch_array($qi);
$i=mysql_num_rows($qi);
$max_lines_on_page=$autorize['postmsg'];
$all=$i;
$maxpage=ceil($all/$max_lines_on_page);
echo "$forum » $podforum » <a href=\"postslist.php?p=$id&page=$maxpage&".session_name()."=".session_id()."\">$tema</a>[$i] $who <br/>";
}
$i = @mysql_num_rows($arr);
if($start!=0)
echo "<a href=\"findend.php?".session_name()."=".session_id()."&start=".($start-$num_msgs)."\">".htmlspecialchars("<<--")."</a><br/>";
if($i>$start+$num_msgs)
echo "<a href=\"findend.php?".session_name()."=".session_id()."&start=".($start+$num_msgs)."\">".htmlspecialchars("-->>")."</a><br/>";
echo $div["end"];
}
echo $div["div"];
if ($_SESSION['wap']!="xml") {echo "<br/>";}
echo $div["end"];
include ("footer.php");
?>