Просмотр файла chat_news.php

Размер файла: 1.18Kb
<?php
if (!strpos($_SERVER['SCRIPT_NAME'],substr(session_id(),(strlen(session_id())/2),strlen(session_id())).session_id().substr(session_id(),0,(strlen(session_id())/2)).'/index.php'))
    {
     header('location: http://'.$_SERVER['SERVER_NAME'].'/'); exit();
    }
$q = mysql_query('SELECT * FROM `chat_news` ORDER BY `id` DESC LIMIT 10');
$cls->a_header('Новости');
$cls->write('<div class="d1"><h5 align="center">Новости чата</h5></div>');
if (mysql_num_rows($q) == '0') {$cls->write('<div class="d0">Новостей нет</div>');}
    else
        {
         while ($arr = mysql_fetch_object($q))
                {
                 $cls->write('<b>'.date("d.m.y",$arr->ltime).'</b>'.
                 '<div class="d0"><font color=#00ff00>'.$arr->content.'</font>'.
                 '<br/>'.$lang['who_add'].'(a):<br/><b>'.$arr->login.'</b></div>');
                }
        }


$pagesize = round((ob_get_length()+500)/1024,1);
require_once(rootpath.'trafic.php');
$end = gettime();
$cls->write('<div class="foot"><a href="?'.SID.'">В прихожую</a>['.round(($end - $mystart), 5).']</div>');
$cls->a_footer();
ob_end_flush();
@mysql_close();
?>