Файл: titwar.ru/element_forum/element_subforum_other.php
Строк: 101
<?php
    /// Общий форум
    if ($subforum['lost_dostype'] > 0) {
        if ($user['lost_privilege'] != 3 AND !in_array($user['lost_id'],$moderation)) {
            $title = 'Доступ закрыт';
            $error1 = 'Вы не можете смотреть этот раздел, так как руководство ограничило к нему доступ<br/><br/><a class="white" href="/forum">К списку разделов</a>';
            require_once 'element_error_page.php';
            exit;
        }
    }
    
    
    
    require_once './element_function/element_function_forum.php';
    $count_topic = Count_Topic_Subforum($subforum['lost_id']);
    if (readcache('element_user_mesto'.$user['lost_id']) != 'Форум') writecache('element_user_mesto'.$user['lost_id'], 'Форум');        
    $ban = BanUserCountActive($user['lost_id']);
    //$topic_lvl = element_settings_game('lost_forum_create_topic');
    
    $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"> / '.$subforum['lost_name'].'</span></div>';
    
    if ($count_topic > 0) {
        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` = '$id' 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'].'</span>
                  </a></div>';
            $i++;
        }
        
        echo '<div>'.pagination_echo($pagination['page'],$pagination['total'],'/forum/subforum?id='.$id.'&page=').'</div>';
    
    } else echo '<div class="hr mt5"></div><div class="cntr mt5 ccc">В этом разделе тем не найдено</div>';
    
    echo '<div class="hr mt5 mb5"></div>';
    
    if ($ban == 0) {
    if ($subforum['lost_news'] > 0 AND $user['lost_privilege'] >= 2) {
        echo '<img src="/images/icons/1.gif"> <a class="" href="/forum/create?id='.$id.'">Создать топик</a><br/>';
    } else if ($user['lost_level'] >= element_settings_game('lost_forum_create_topic') OR $user['lost_privilege'] >= 2) echo '<img src="/images/icons/1.gif"> <a class="" href="/forum/create?id='.$id.'">Создать топик</a></br>';
    }
    
    if ($count_topic > 0) echo '<img src="/images/icons/1.gif"> <a class="" href="">Отметить все как прочитанные</a></br>';
    echo '<img src="/images/icons/1.gif"> <span class="white">Модераторы:</span> ';
        foreach ($moderation as $value) { 
            $moders = cache_user($value); 
            $on_off = (!empty($online[$value])) ? 'online' : 'offline';
            echo ikonka_user($moders['lost_race'], $on_off).' <a class="yellow1" href="/user?id='.$value.'">'.$moders['lost_login'].'</a> '; 
        }
    echo '</div>';
    // lost_forum_create_topic
?>