예제 #1
0
            if (hasPermissions('communes')) {
                $themesCount = $communeThemesCounts['count'];
            } elseif ($comm['author_id'] == get_uid(false) || $comm['is_moderator'] === 't') {
                $themesCount = $communeThemesCounts['count'] - $communeThemesCounts['admin_hidden_count'];
            } else {
                $themesCount = $communeThemesCounts['count'] - $communeThemesCounts['hidden_count'];
            }
            if ($om == commune::OM_TH_MY) {
                $themesCount = $uid ? commune::GetMyThemesCount($id, $uid, $cat) : 0;
            }
            //else if(!($user_mod & (commune::MOD_ADMIN)))           // !!! Не, похоже не надо. На количество страниц это влияние не оказывает,
            //  $themesCount -= commune::GetBannedThemesCount($id);  // т.к. запрос не использует данное условие, то есть в офсете есть и забаны.
            // Просто на конкретной странице окажется меньше чем commune::MAX_TOP_ON_PAGE
            // топов и все.
            if ($cat && $om != commune::OM_TH_MY) {
                $themesCount = commune::GetCategoryThemesCount($id, $cat);
            }
            $pages = ceil($themesCount / commune::MAX_TOP_ON_PAGE);
            if ($page > 1 && !in_array($action, array('do.Create.post', 'do.Edit.post')) && (($themesCount == 0 || $themesCount - 1 < ($page - 1) * commune::MAX_TOP_ON_PAGE) && !$bPageDefault || $pages == 1 && !$bPageDefault)) {
                include ABS_PATH . '/404.php';
                exit;
            }
            if ($comm['name'] != '') {
                $page_title = $page_keyw = "Сообщество > {$comm['name']} <" . ($page > 1 ? " - Страница {$page}" : '') . ' - фриланс, удаленная работа на FL.ru';
                $page_descr = LenghtFormatEx($comm['descr'], 250, '', 0);
            }
            $FBShare = array('title' => $comm['name'], 'description' => '', 'image' => HTTP_PREFIX . 'www.free-lance.ru/images/free-lance_logo.jpg');
            $commune_output = 'tpl.commune.php';
        }
        break;
}