<?php

require '../system/start.php';
require '../system/functions.php';
$query = mysql_query("select * from `forum_posts` where `time` > ".(time()-86400)." order by `id` desc limit ".$page.",".$set['str']."");
$total = mysql_result(mysql_query("select count(*) from `forum_posts` where `time` > ".(time()-86400).""),0);
$str['mesto'] = 'Новое';
$str['block'] = $set['site'].' / <a href="index.php">Форум</a> / Новое';
include '../style/'.$style.'/head.php';
if($total == 0)
{
    echo '<div class="forum1">За последние сутки никто, ничего не писал...</div>';
}
else
{
    while ($row = mysql_fetch_assoc($query))
    {
        $f = mysql_fetch_assoc(mysql_query("select * from `forum_forums` where `id` = ".$row['id_forum'].""));
        $t = mysql_fetch_assoc(mysql_query("select * from `forum_topics` where `id` = ".$row['id_topic'].""));
        $i++;
        if($i%2)
        {
            echo '<div class="forum1">';
        }
        else
        {
            echo '<div class="forum2">';
        }
        echo '<img class="ico" src="../style/'.$style.'/ico/ftems.png" alt="" /> '.$f['title'].'-> <a href="topic.php?id='.$t['id'].'">'.$t['title'].'</a> ('.clock($row['time']).')</div>';
    }
}
echo '<div class="on2"><img class="ico" src="../style/default/ico/newpost.png" alt="" /> <a href="index.php">Форум</a></div>';
include '../style/'.$style.'/foot.php';
?>