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

Размер файла: 2.52Kb
<?
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)and(`data` like '%$date%'));");
           $q = mysql_query("select * from forum where ((`t`=1)and(`data` like '%$date%')) order by `id` 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);
           echo "$forum » $podforum » <a href=\"postslist.php?p=$id&amp;".session_name()."=".session_id()."\">$tema</a>[$i] $who <br/>";
           }
             $i = @mysql_num_rows($arr);
             if($start!=0)
             echo "<a href=\"findnew.php?".session_name()."=".session_id()."&amp;start=".($start-$num_msgs)."\">".htmlspecialchars("<<--")."</a><br/>";
             if($i>$start+$num_msgs)
             echo "<a href=\"findnew.php?".session_name()."=".session_id()."&amp;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");
?>