Файл: public_html/element_forum/element_new_topic.php
Строк: 75
<?php
require_once './element_function/element_function_forum.php';
if (readcache('element_user_mesto'.$user['lost_id']) != 'Обновления форума') writecache('element_user_mesto'.$user['lost_id'], 'Форум');
$ban = BanUserCountActive($user['lost_id']);
if (isset($_GET['read']))
{
$read_data = array();
$read = mysql_query("SELECT `lost_id` FROM `element_forum_topic_2` WHERE `lost_subforum`='1' AND `lost_subforum`='3' AND `lost_subforum`='4' AND `lost_subforum`='7' AND `lost_subforum`='8' AND `lost_subforum`='10' AND `lost_subforum`='32' AND NOT `lost_id` IN (SELECT `lost_topic` FROM `element_forum_read_2` WHERE `lost_user`='{$user['lost_id']}')");
while ($_data = mysql_fetch_assoc($read))
{
$read_data[] = $_data['lost_id'];
}
if (sizeof($read_data))
{
mysql_query("INSERT INTO `element_forum_read_2` (`lost_topic`, `lost_user`, `lost_time`)
VALUES ('".implode("', '{$user['lost_id']}', UNIX_TIMESTAMP()), ('", $read_data)."', '{$user['lost_id']}', UNIX_TIMESTAMP())");
}
header("Location: ?id=".$id);
die;
}
$title = $subforum['lost_name'];
require_once './element_include/element_head.php';
require_once './element_include/element_header_user_true.php';
echo '<div class="nfl p5 mb5 mt5 small mlra">';
echo '<div class="cntr"><img width="16" height="16" alt="" src="/images/icons/forum_new.png"/> <a href="/forum">Форум</a><span class="white"> / Что нового?</span></div>';
require_once './element_function/element_function_pagination.php';
$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
$pagination = pagination(10, $page, $count_topic);
$query_topic = mysql_query("SELECT `lost_id`,`lost_name`,`lost_pric`,`lost_close`,`lost_time_comment` FROM `element_forum_topic_2` WHERE `lost_subforum`='1' AND `lost_subforum`='3' AND `lost_subforum`='4' AND `lost_subforum`='7' AND `lost_subforum`='8' AND `lost_subforum`='10' AND `lost_subforum`='32' ORDER BY `lost_pric` DESC,`lost_time_comment` DESC LIMIT $pagination[start], $pagination[num]");
$i = 1;
echo '<div class="hr mt5 mb5"></div>';
while ($myrrow = mysql_fetch_array($query_topic)) {
$odd = ($i % 2) ? ' odd' : ''; // Цвет ячейки
$bold = ($myrrow['lost_pric'] > 0) ? 'bold' : ''; // Жырный шрифт
$close = ($myrrow['lost_close'] > 0) ? 'ccc' : 'yellow1'; // Цвет
$new = (Read_Topic_User($user['lost_id'], $myrrow['lost_id']) >= $myrrow['lost_time_comment']) ? '' : '_new';
echo '<div class="ml5 mr5"><a class="bl p5 block'.$odd.'" href="/forum/topic?id='.$myrrow['lost_id'].'">
<img width="16" height="16" alt="" src="/images/icons/topic'.$new.'.png"/>
<span class="'.$bold.' '.$close.' small">'.$myrrow['lost_name'].' ['.Count_Topic_Comment($myrrow['lost_id']).']</a></span>
</div>';
$i++;
}
echo '<div>'.pagination_echo($pagination['page'],$pagination['total'],'/forum/subforum?id='.$id.'&page=').'</div>';
echo '<div class="hr mt5 mb5"></div>';
echo '</div>';
// lost_forum_create_topic
?>