예제 #1
0
파일: forum_admin.php 프로젝트: notzen/e107
        if (isset($_POST['counts'])) {
            $for->forumUpdateCounts($fid, $_POST['counts_threads']);
            $msg .= FORLAN_167 . ": {$fid} <br />";
        }
        if (isset($_POST['lastpost'])) {
            $with_threads = isset($_POST['lastpost_nothread']) ? FALSE : TRUE;
            $for->forumUpdateLastpost('forum', $fid, $with_threads);
            $msg .= FORLAN_168 . ": {$fid} <br />";
        }
    }
    if (isset($_POST['userpostcounts'])) {
        require_once e_HANDLER . 'user_extended_class.php';
        $ue = new e107_user_extended();
        $list = $for->getUserCounts();
        foreach ($list as $uid => $cnt) {
            $ue->user_extended_setvalue($uid, 'user_plugin_forum_posts', $cnt, 'int');
        }
        $msg .= FORLAN_169 . ' <br />';
    }
    $forum->show_message($msg);
}
if (isset($_POST['create_sub'])) {
    $fid = (int) $sub_action;
    $tmp = array();
    $tmp['forum_name'] = $e107->tp->toDB($_POST['subname_new']);
    $tmp['forum_description'] = $e107->tp->toDB($_POST['subdesc_new']);
    $tmp['forum_order'] = (int) $_POST['suborder_new'];
    if ($tmp['forum_name'] != '' && $e107->sql->db_Select('forum', '*', "forum_id = {$fid}")) {
        $row = $e107->sql->db_Fetch();
        $tmp['forum_parent'] = $row['forum_parent'];
        $tmp['forum_moderators'] = $row['forum_moderators'];
예제 #2
0
function step7()
{
    $ns = e107::getRender();
    $stepCaption = 'Step 7: Calculate user post counts';
    if (!isset($_POST['calculate_usercounts'])) {
        $text = "\n\t\tThis step will calculate post count information for all users, as well as recount all for thread and reply counts.\n\t\t<br /><br />\n\t\t<form method='post'>\n\t\t<input class='btn btn-success' data-loading-text='Please wait...' type='submit' name='calculate_usercounts' value='Proceed with post count calculation' />\n\t\t</form>\n\t\t";
        $ns->tablerender($stepCaption, $text);
        return;
    }
    global $forum;
    require_once e_HANDLER . 'user_extended_class.php';
    $ue = new e107_user_extended();
    $counts = $forum->getUserCounts();
    foreach ($counts as $uid => $count) {
        $ue->user_extended_setvalue($uid, 'user_plugin_forum_posts', $count, 'int');
    }
    $forum->forumUpdateCounts('all', true);
    //	var_dump($counts);
    $text = "\n\tSuccessfully recalculated forum posts for " . count($counts) . " users.\n\t<br /><br />\n\t<form method='post' action='" . e_SELF . "?step=8'>\n\t<input class='btn btn-success' type='submit' name='nextStep[8]' value='Proceed to step 8' />\n\t</form>\n\t";
    $ns->tablerender($stepCaption, $text);
}