예제 #1
0
        ?>
</div>
                                <?php 
        // инфа о сообществе
        ?>
                                <div class="b-post__foot">
                                    <?php 
        // количество участников и постов
        ?>
                                    <div class="b-post__txt b-post__txt_padbot_10 b-post__txt_fontsize_11">
                                        <a class="b-post__link b-post__link_fontsize_11 b-post__link_float_right" href="<?php 
        echo $comm_url;
        ?>
">
                                            <?php 
        $themesCount = commune::getCommuneThemesCount($comm['id']);
        if (hasPermissions('communes')) {
            $themes_count = $themesCount['count'];
        } elseif ($comm['author_id'] == $uid || $comm['is_moderator'] === 't') {
            $themes_count = $themesCount['count'] - $themesCount['admin_hidden_count'];
        } else {
            $themes_count = $themesCount['count'] - $themesCount['hidden_count'];
        }
        $for_admin = $comm['author_id'] == uid || hasPermissions('communes') ? true : false;
        ?>
                                            <?php 
        echo $themes_count . ' ' . ending($themes_count, 'пост', 'поста', 'постов');
        ?>
                                        </a>
                                        <?php 
        echo $mAcceptedCnt . ' ' . ending($mAcceptedCnt, 'участник', 'участника', 'участников');
예제 #2
0
/**
 * возвращает html блока с разделами сообщества, который в левом столбце
 * @param type $commune_id ID сообщества
 * @param type $om сортировка
 * @param type $curr_cat текущая активная категория
 * @param type $page страница
 * @return string html-код
 */
function __commPrintCategoriesList($commune_id, $om, $curr_cat = '', $page = 0)
{
    $comm = NULL;
    $user_mod = 0;
    $uid = get_uid(false);
    if ($uid) {
        $status = commune::GetUserCommuneRel($commune_id, $uid);
    }
    $comm = commune::GetCommune($commune_id, !$uid ? NULL : $uid, $user_mod);
    if ($comm) {
        $communeThemesCounts = commune::getCommuneThemesCount($comm['id']);
        if (hasPermissions('communes')) {
            $themes_count = $communeThemesCounts['count'];
            $for_admin = true;
        } elseif ($status['is_moderator'] == 1 || $status['is_admin'] == 1 || $status['is_author'] == 1) {
            $themes_count = $communeThemesCounts['count'] - $communeThemesCounts['admin_hidden_count'];
            $for_commune_admin = true;
        } else {
            $themes_count = $communeThemesCounts['count'] - $communeThemesCounts['hidden_count'];
            $for_admin = false;
        }
        $categories = commune::getCategories($commune_id, true);
        ob_start();
        include $_SERVER['DOCUMENT_ROOT'] . '/commune/tpl.categories_list.php';
        return ob_get_clean();
    } else {
        return null;
    }
}