Beispiel #1
0
        }
    }
    //處理下一個
    $next = $theurl . '?step=sql&i=' . ($_GET['i'] + 1);
    show_msg("[ {$i} / {$count_i} ] " . $msg, $next);
} elseif ($_GET['step'] == 'data') {
    // 升級數據
    $datasql = file_get_contents(DISCUZ_ROOT . './houseinstall/data/install_data.sql');
    $datasql = str_replace("\r\n", "\n", $datasql);
    runquery($datasql);
    show_msg("數據處理完成", "{$theurl}?step=cache");
} elseif ($_GET['step'] == 'cache') {
    require_once libfile('function/category');
    $cachearray = array('categorysort', 'sortlist', 'channellist', 'arealist', 'usergroup');
    foreach ($cachearray as $cachename) {
        categorycache($cachename, 'house');
    }
    //寫log
    if (!$devmode && @($fp = fopen($lockfile, 'w'))) {
        fwrite($fp, ' ');
        fclose($fp);
    }
    //緩存更新
    show_msg('恭喜,數據庫結構升級完成!為了數據安全,請刪除 houseinstall 目錄。');
}
//正則匹配,獲取字段/索引/關鍵字信息
function getcolumn($creatsql)
{
    $creatsql = preg_replace("/ COMMENT '.*?'/i", '', $creatsql);
    preg_match("/\\((.+)\\)\\s*(ENGINE|TYPE)\\s*\\=/is", $creatsql, $matchs);
    $cols = explode("\n", $matchs[1]);
            $channelnew['watermarktext']['fontpath'] = str_replace(array('\\', '/'), '', $channelnew['watermarktext']['fontpath']);
            if ($channelnew['watermarktype'] == 'text' && $channelnew['watermarktext']['fontpath']) {
                $fontpath = $channelnew['watermarktext']['fontpath'];
                $fontpathnew = 'ch/' . $fontpath;
                $channelnew['watermarktext']['fontpath'] = file_exists('static/image/seccode/font/' . $fontpathnew) ? $fontpathnew : '';
                if (!$channelnew['watermarktext']['fontpath']) {
                    $fontpathnew = 'en/' . $fontpath;
                    $channelnew['watermarktext']['fontpath'] = file_exists('static/image/seccode/font/' . $fontpathnew) ? $fontpathnew : '';
                }
                if (!$channelnew['watermarktext']['fontpath']) {
                    cpmsg('watermarkpreview_fontpath_error', '', 'error');
                }
            }
        }
        DB::update('category_channel', array('imageinfo' => addslashes(serialize($channelnew))), "cid='{$cid}'");
        categorycache('channellist');
        cpmsg('threadtype_infotypes_option_succeed', 'action=category&operation=attach&do=' . $do, 'succeed');
    }
} elseif ($operation == 'addusers') {
    if (!submitcheck('adduserssubmit')) {
        shownav('house', 'menu_category_usergroup');
        showsubmenu('menu_category_usergroup', array(array('menu_category_usergroup', 'category&operation=usergroup&do=house', 0), array('menu_category_addusers', 'category&operation=addusers', 1)));
        $_G['gp_gid'] = intval($_G['gp_gid']);
        $threadtypes = '<select name="sortid" onchange="window.location.href = \'?action=category&operation=addusers&do=' . $do . '&gid=\'+ this.options[this.selectedIndex].value"><option value="0">' . cplang('none') . '</option>';
        $query = DB::query("SELECT * FROM " . DB::table('category_' . $do . '_usergroup') . " WHERE type='intermediary' ORDER BY displayorder");
        while ($usergroup = DB::fetch($query)) {
            $threadtypes .= '<option value="' . $usergroup['gid'] . '" ' . ($_G['gp_gid'] == $usergroup['gid'] ? 'selected="selected"' : '') . '>' . dhtmlspecialchars($usergroup['title']) . '</option>';
        }
        $threadtypes .= '</select>';
        showformheader('category&operation=addusers&gid=' . $_G['gp_gid'] . '&do=' . $do);
        showtableheader('category_select_usergroup');