PHPFusion\Forums\Admin::display_forum_list PHP Метод

display_forum_list() приватный Метод

Forum Listing
private display_forum_list ( )
    private function display_forum_list()
    {
        global $locale, $aidlink;
        $forum_settings = get_settings('forum');
        $title = !empty($this->level['title']) ? sprintf($locale['forum_000b'], $this->level['title'][0]) : $locale['forum_000c'];
        add_to_title(" " . $title);
        opentable($title);
        $threads_per_page = $forum_settings['threads_per_page'];
        $max_rows = dbcount("('forum_id')", DB_FORUMS, (multilang_table("FO") ? "forum_language='" . LANGUAGE . "' AND" : '') . " forum_cat='" . $_GET['parent_id'] . "'");
        // need max rows
        $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_rows ? intval($_GET['rowstart']) : 0;
        $result = dbquery("SELECT forum_id, forum_cat, forum_branch, forum_name, forum_description, forum_image, forum_alias, forum_type, forum_threadcount, forum_postcount, forum_order FROM\n\t\t\t" . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='" . intval($_GET['parent_id']) . "'\n\t\t\t ORDER BY forum_order ASC LIMIT " . $_GET['rowstart'] . ", {$threads_per_page}\n\t\t\t ");
        $rows = dbrows($result);
        if ($rows > 0) {
            // To support entypo and font-awesome icon switching
            $has_entypo = fusion_get_settings("entypo") ? true : false;
            $has_fa = fusion_get_settings("fontawesome") ? true : false;
            $type_icon = array('1' => $has_entypo ? 'entypo folder' : $has_fa ? 'fa fa-folder fa-fw fa-2x' : "", '2' => $has_entypo ? 'entypo icomment' : $has_fa ? 'fa fa-comment-o fa-fw fa-2x' : "", '3' => $has_entypo ? 'entypo link' : $has_fa ? 'fa fa-external-link fa-fw fa-2x' : "", '4' => $has_entypo ? 'entypo info-circled' : $has_fa ? 'fa fa-lightbulb-o fa-fw fa-2x' : "");
            $ui_label = array("move_up" => $has_entypo ? "<i class='entypo up-bold m-r-10'></i>" : $has_fa ? "<i class='fa fa-arrow-up fa-lg m-r-10'></i>" : $locale['forum_046'], "move_down" => $has_entypo ? "<i class='entypo down-bold m-r-10'></i>" : $has_fa ? "<i class='fa fa-arrow-down fa-lg m-r-10'></i>" : $locale['forum_045'], "edit_permission" => $has_entypo ? "<i class='entypo key m-r-10'></i>" : $has_fa ? "<i class='fa fa-eye fa-lg m-r-10'></i>" : $locale['forum_047'], "edit" => $has_entypo ? "<i class='entypo cog m-r-10'></i>" : $has_fa ? "<i class='fa fa-cog fa-lg m-r-10'></i>" : $locale['forum_048'], "delete" => $has_entypo ? "<i class='entypo icancel m-r-10'></i>" : $has_fa ? "<i class='fa fa-trash-o fa-lg m-r-10'></i>" : $locale['forum_049']);
            $i = 1;
            while ($data = dbarray($result)) {
                $up = $data['forum_order'] - 1;
                $down = $data['forum_order'] + 1;
                echo "<div class='panel panel-default'>\n";
                echo "<div class='panel-body'>\n";
                echo "<div class='pull-left m-r-10'>\n";
                echo "<i class='display-inline-block text-lighter " . $type_icon[$data['forum_type']] . "'></i>\n";
                echo "</div>\n";
                echo "<div class='overflow-hide'>\n";
                echo "<div class='row'>\n";
                echo "<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6'>\n";
                $html2 = '';
                if ($data['forum_image'] && file_exists(INFUSIONS . "forum/images/" . $data['forum_image'])) {
                    echo "<div class='pull-left m-r-10'>\n" . thumbnail(INFUSIONS . "forum/images/" . $data['forum_image'], '50px') . "</div>\n";
                    echo "<div class='overflow-hide'>\n";
                    $html2 = "</div>\n";
                }
                echo "<span class='strong text-bigger'><a href='" . FUSION_SELF . $aidlink . "&amp;parent_id=" . $data['forum_id'] . "&amp;branch=" . $data['forum_branch'] . "'>" . $data['forum_name'] . "</a></span><br/>" . nl2br(parseubb($data['forum_description'])) . $html2;
                echo "</div>\n<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6'>\n";
                echo "<div class='pull-right'>\n";
                $upLink = FUSION_SELF . $aidlink . $this->ext . "&amp;action=mu&amp;order={$up}&amp;forum_id=" . $data['forum_id'];
                $downLink = FUSION_SELF . $aidlink . $this->ext . "&amp;action=md&amp;order={$down}&amp;forum_id=" . $data['forum_id'];
                echo $i == 1 ? '' : "<a title='" . $locale['forum_046'] . "' href='" . $upLink . "'>" . $ui_label['move_up'] . "</a>";
                echo $i == $rows ? '' : "<a title='" . $locale['forum_045'] . "' href='" . $downLink . "'>" . $ui_label['move_down'] . "</a>";
                echo "<a title='" . $locale['forum_047'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=p_edit&forum_id=" . $data['forum_id'] . "&amp;parent_id=" . $_GET['parent_id'] . "'>" . $ui_label['edit_permission'] . "</a>";
                // edit
                echo "<a title='" . $locale['forum_048'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=edit&forum_id=" . $data['forum_id'] . "&amp;parent_id=" . $_GET['parent_id'] . "'>" . $ui_label['edit'] . "</a>";
                // edit
                echo "<a title='" . $locale['forum_049'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;forum_id=" . $data['forum_id'] . "&amp;forum_cat=" . $data['forum_cat'] . "&amp;forum_branch=" . $data['forum_branch'] . $this->ext . "' onclick=\"return confirm('" . $locale['delete_notice'] . "');\">" . $ui_label['delete'] . "</a>";
                // delete
                echo "</div>\n";
                echo "<span class='text-dark text-smaller strong'>" . $locale['forum_057'] . " " . number_format($data['forum_threadcount']) . " / " . $locale['forum_059'] . " " . number_format($data['forum_postcount']) . " </span>\n<br/>";
                $subforums = get_child($this->forum_index, $data['forum_id']);
                $subforums = !empty($subforums) ? count($subforums) : 0;
                echo "<span class='text-dark text-smaller strong'>" . $locale['forum_058'] . " " . number_format($subforums) . "</span>\n<br/>";
                echo "<span class='text-smaller text-dark strong'>" . $locale['forum_051'] . " </span> <span class='text-smaller'>" . $data['forum_alias'] . " </span>\n";
                echo "</div></div>\n";
                // end row
                echo "</div>\n";
                echo "</div>\n</div>\n";
                $i++;
            }
            if ($max_rows > $threads_per_page) {
                $ext = isset($_GET['parent_id']) ? "&amp;parent_id=" . $_GET['parent_id'] . "&amp;" : '';
                echo makepagenav($_GET['rowstart'], $threads_per_page, $max_rows, 3, FUSION_SELF . $aidlink . $ext);
            }
        } else {
            echo "<div class='well text-center'>" . $locale['560'] . "</div>\n";
        }
        closetable();
    }