$log_handler->myThreadLog('mergeforum', array('fid' => $source, 'otherid' => $target));
        $query = C::t('forum_access')->fetch_all_by_fid_uid($source);
        foreach ($query as $access) {
            C::t('forum_access')->insert(array('uid' => $access['uid'], 'fid' => $target, 'allowview' => $access['allowview'], 'allowpost' => $access['allowpost'], 'allowreply' => $access['allowreply'], 'allowgetattach' => $access['allowgetattach']), false, true);
        }
        C::t('forum_access')->delete_by_fid($source);
        C::t('forum_thread')->clear_cache(array($source, $target), 'forumdisplay_');
        updatecache('forums');
        cpmsg('forums_merge_succeed', 'action=forums', 'succeed');
    }
} elseif ($operation == 'edit') {
    require_once libfile('function/forumlist');
    require_once libfile('function/domain');
    $highlight = getgpc('highlight');
    $anchor = getgpc('anchor');
    list($pluginsetting, $pluginvalue) = get_pluginsetting('forums');
    $multiset = 0;
    if (empty($_GET['multi'])) {
        $fids = $fid;
    } else {
        $multiset = 1;
        if (is_array($_GET['multi'])) {
            $fids = $_GET['multi'];
        } else {
            $_GET['multi'] = explode(',', $_GET['multi']);
            $fids =& $_GET['multi'];
        }
    }
    if (count($_GET['multi']) == 1) {
        $fids = $_GET['multi'][0];
        $multiset = 0;
        updatecache(array('usergroups', 'onlinelist', 'groupreadaccess'));
        cpmsg('usergroups_update_succeed', 'action=usergroups&type=' . $_GET['type'], 'succeed');
    }
} elseif ($operation == 'viewsgroup') {
    $sgroupid = $_GET['sgroupid'];
    $num = C::t('common_member')->count_by_groupid($sgroupid);
    $sgroups = '';
    foreach (C::t('common_member')->fetch_all_by_groupid($sgroupid, 0, 80) as $uid => $member) {
        $sgroups .= '<li><a href="home.php?mod=space&uid=' . $uid . '" target="_blank">' . $member['username'] . '</a></li>';
    }
    ajaxshowheader();
    echo '<ul class="userlist"><li class="unum">' . $lang['usernum'] . $num . ($num > 80 ? '&nbsp;<a href="' . ADMINSCRIPT . '?action=members&operation=search&submit=yes&groupid=' . $sgroupid . '">' . $lang['more'] . '&raquo;</a>' : '') . '</li>' . $sgroups . '</ul>';
    ajaxshowfooter();
} elseif ($operation == 'edit') {
    $return = isset($_GET['return']) && $_GET['return'] ? 'admin' : '';
    list($pluginsetting, $pluginvalue) = get_pluginsetting('groups');
    $multiset = 0;
    $gids = array();
    if (empty($_GET['multi'])) {
        if ($_GET['id']) {
            $gids[0] = $_GET['id'];
        }
    } else {
        $multiset = 1;
        if (is_array($_GET['multi'])) {
            $gids =& $_GET['multi'];
        } else {
            $_GET['multi'] = explode(',', $_GET['multi']);
            $gids =& $_GET['multi'];
        }
    }