showtablerow('', array('class="td25"', 'colspan="2"'), array(cplang('operation'), '<input class="radio" type="radio" name="operate_type" value="delete"> ' . cplang('delete') . ' '));
        showsubmit('submit', 'submit', '', '', $multipage);
        showtablefooter();
        showformfooter();
    }
} elseif ($operation == 'admin') {
    $tagarray = array();
    if (submitcheck('submit') && !empty($_GET['ctidarray']) && is_array($_GET['ctidarray']) && count($_GET['ctidarray']) && !empty($_GET['operate_type'])) {
        $class_tag = new tag();
        $ctidarray = array();
        $operate_type = $_GET['operate_type'];
        $ctidarray = $_GET['ctidarray'];
        if ($operate_type == 'delete') {
            require_once libfile('function/delete');
            foreach ($ctidarray as $ctid) {
                deletecollection($ctid);
            }
        }
        cpmsg('collection_admin_updated', 'action=collection&operation=admin&searchsubmit=yes&perpage=' . $_GET['perpage'] . '&page=' . $_GET['page'], 'succeed');
    }
    if (!submitcheck('searchsubmit', 1)) {
        showformheader('collection&operation=admin');
        showtableheader();
        showsetting('collection_name', 'collection_name', $collection_name, 'text');
        showsetting('collection_ctid', 'collection_ctid', $collection_ctid, 'text');
        showsetting('collection_username', 'collection_username', $collection_username, 'text');
        showsetting('collection_uid', 'collection_uid', $collection_uid, 'text');
        showsetting('feed_search_perpage', '', $_GET['perpage'], "<select name='perpage'><option value='20'>{$lang['perpage_20']}</option><option value='50'>{$lang['perpage_50']}</option><option value='100'>{$lang['perpage_100']}</option></select>");
        showsubmit('searchsubmit');
        showtablefooter();
        showformfooter();
        $newCollectionTitle = censor(dhtmlspecialchars($_GET['title']));
        $newCollectionTitle = cutstr($newCollectionTitle, 30, '');
        $newcollection = array('name' => $newCollectionTitle, 'desc' => dhtmlspecialchars(cutstr(censor($_GET['desc']), $desclimit, '')), 'keyword' => parse_keyword($_GET['keyword'], true));
        C::t('forum_collection')->update($ctid, $newcollection);
        if ($_GET['title'] != $_G['collection']['name']) {
            C::t('forum_collectionteamworker')->update_by_ctid($ctid, $_GET['title']);
        }
        showmessage('collection_edit_succ', 'forum.php?mod=collection&action=view&ctid=' . $ctid);
    }
} elseif ($op == 'remove') {
    if ($_GET['formhash'] != FORMHASH) {
        showmessage('undefined_action', NULL);
    }
    if ($_G['collection'] && checkcollectionperm($_G['collection'], $_G['uid'])) {
        require_once libfile('function/delete');
        deletecollection($_G['collection']['ctid']);
        showmessage('collection_delete_succ', 'forum.php?mod=collection&op=my');
    } else {
        showmessage('collection_permission_deny');
    }
} elseif ($op == 'addthread') {
    if ((!$_G['forum_thread'] || !$_G['forum']) && !is_array($_GET['tids'])) {
        showmessage('thread_nonexistence');
    }
    if (!is_array($_GET['tids']) && $_G['forum']['disablecollect']) {
        showmessage('collection_forum_deny', '', array(), array('showdialog' => 1));
    }
    if (!submitcheck('addthread')) {
        $createdcollectionnum = C::t('forum_collection')->count_by_uid($_G['uid']);
        $reamincreatenum = $_G['group']['allowcreatecollection'] - $createdcollectionnum;
        $collections = getmycollection($_G['uid']);