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

Размер файла: 5.51Kb
<?
session_start();
include ("header.php");
           $forums="Общий форум";
           echo $div["header"];
           if (!$autorize) {echo "[<a href=\"login.php?".session_name()."=".session_id()."\">Вход</a>][<a href=\"reg.php\">Регистрация</a>]<br/>";}
           echo "[<a href=\"index.php?".session_name()."=".session_id()."\">Список форумов</a>]<br/>";
           echo $div["end"];
           echo $div["div"];
                      if ($_SESSION['wap']!="xml") {echo "-<br/>";}
           $arr = mysql_query("select * from users where `online`='1'");
           $i = @mysql_num_rows($arr);
           if(empty($start)) $start = 0;
           $start=intval($start);
           if($start<0) $start=0; $num_msgs=10;
             if($start!=0)
             echo "<a href=\"online.php?".session_name()."=".session_id()."&amp;start=".($start-$num_msgs)."\">".htmlspecialchars("<<-- Предыдущая")."</a><br/>";
             if($i>$start+$num_msgs)
             echo "<a href=\"online.php?".session_name()."=".session_id()."&amp;start=".($start+$num_msgs)."\">".htmlspecialchars("Следующая -->>")."</a><br/>";

           $q = mysql_query("select * from users where `online`='1' order by `id` asc limit $start,$num_msgs;;");
           $reg=mysql_num_rows($arr);
           echo "Зарегистрированных: $reg <br/>";
           if (mysql_affected_rows()==0)
           {
           echo "Пустая страница...<br/>";
           }
           else
           {
           while ($field=mysql_fetch_array($q))
           {
           $user=$field['login'];
           $onlf=$field['onlf'];
           $onlp=$field['onlp'];
           $onlt=$field['onlt'];
           echo "<a href=\"anketa.php?user=$user&amp;".session_name()."=".session_id()."\">$user</a>";
           echo " » ";
           if (empty($onlf)) {echo "<a href=\"index.php?".session_name()."=".session_id()."\">Список форумов</a>";}
           else
           {
           $qf = mysql_query("select * from forum where `forums`='$onlf' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo "<a href=\"index.php?b=$idf&amp;".session_name()."=".session_id()."\">$onlf</a>";
           }
           if (!empty($onlp))
           {
           $qf = mysql_query("select * from forum where `podforums`='$onlp' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo " » <a href=\"topslist.php?p=$idf&amp;".session_name()."=".session_id()."\">$onlp</a>";
           }
           if (!empty($onlt))
           {
           $qf = mysql_query("select * from forum where `themes`='$onlt' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo " » <a href=\"postslist.php?p=$idf&amp;".session_name()."=".session_id()."\">$onlt</a><br/>";
           }
           if (empty($onlt)) echo "<br/>";
           }
           }
           echo "-<br/>";
           $arr = mysql_query("select * from `anonims`");
           $i = @mysql_num_rows($arr);
           if(empty($startan)) $startan = 0;
           $startan=intval($startan);
           if($startan<0) $startan=0; $num_msgs_an=10;
             if($startan!=0)
             echo "<a href=\"online.php?".session_name()."=".session_id()."&amp;startan=".($startan-$num_msgs_an)."\">".htmlspecialchars("<<-- Предыдущая")."</a><br/>";
             if($i>$startan+$num_msgs_an)
             echo "<a href=\"online.php?".session_name()."=".session_id()."&amp;startan=".($startan+$num_msgs_an)."\">".htmlspecialchars("Следующая -->>")."</a><br/>";
           $q = mysql_query("select * from anonims order by `id` desc limit $startan,$num_msgs_an;");
           $reg=mysql_num_rows($arr);
           echo "Анонимных: $reg <br/>";
           if (mysql_affected_rows()==0)
           {
           echo "Пустая страница...<br/>";
           }
           else
           {
           while ($field=mysql_fetch_array($q))
           {
           $user=$field['login'];
           $onlf=$field['onlf'];
           $onlp=$field['onlp'];
           $onlt=$field['onlt'];
           echo "Аноним » ";
           if (empty($onlf)) {echo "<a href=\"index.php?".session_name()."=".session_id()."\">Список форумов</a>";}
           else
           {
           $qf = mysql_query("select * from forum where `forums`='$onlf' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo "<a href=\"index.php?b=$idf&amp;".session_name()."=".session_id()."\">$onlf</a>";
           }
           if (!empty($onlp))
           {
           $qf = mysql_query("select * from forum where `podforums`='$onlp' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo " » <a href=\"topslist.php?p=$idf&amp;".session_name()."=".session_id()."\">$onlp</a>";
           }
           if (!empty($onlt))
           {
           $qf = mysql_query("select * from forum where `themes`='$onlt' order by id asc;");
           $rf=mysql_fetch_array($qf);
           $idf=$rf['id'];
           echo " » <a href=\"postslist.php?p=$idf&amp;".session_name()."=".session_id()."\">$onlt</a><br/>";
           }
           if (empty($onlt)) echo "<br/>";
           }
           }
           if ($_SESSION['wap']!="xml") {echo "-<br/>";}
           echo $div["end"];
include ("footer.php");
?>