// 发布的时候改为 0 define('APP_NAME', 'bbs'); // 应用的名称 define('APP_PATH', '../../'); // 应用的路径 chdir(APP_PATH); $conf = (include './conf/conf.php'); include './xiunophp/xiunophp.php'; include './xiunophp/form.func.php'; include './model.inc.php'; $user = user_token_get('', 'bbs'); $user['gid'] != 1 and message(-1, '需要管理员权限才能设置。'); // 检测浏览器 $browser = get__browser(); check_browser($browser); $runtime = runtime_init(); if ($method == 'GET') { $sphinx = kv_get('sphinx'); !isset($sphinx['enable']) && ($sphinx['enable'] = 0); !isset($sphinx['sphinx_host']) && ($sphinx['sphinx_host'] = ''); !isset($sphinx['sphinx_port']) && ($sphinx['sphinx_port'] = ''); !isset($sphinx['sphinx_datasrc']) && ($sphinx['sphinx_datasrc'] = ''); !isset($sphinx['sphinx_deltasrc']) && ($sphinx['sphinx_deltasrc'] = ''); $input['enable'] = form_radio_yes_no('enable', $sphinx['enable']); $input['sphinx_host'] = form_text('sphinx_host', $sphinx['sphinx_host'], 300); $input['sphinx_port'] = form_text('sphinx_port', $sphinx['sphinx_port'], 100); $input['sphinx_datasrc'] = form_text('sphinx_datasrc', $sphinx['sphinx_datasrc'], 300); $input['sphinx_deltasrc'] = form_text('sphinx_deltasrc', $sphinx['sphinx_deltasrc'], 300); $header = array(); $header['title'] = 'Sphinx 搜索服务设置'; include './plugin/xn_sphinx/setting.htm';
$salt = rand(100000, 999999); $pwd = md5(md5($adminpass) . $salt); $admin = array('username' => $adminuser, 'email' => $adminemail, 'password' => $pwd, 'salt' => $salt, 'create_ip' => $longip, 'create_date' => $time); user_update(1, $admin); /*friendlink_create(array( 'name' => 'Xiuno BBS', 'url' => 'http://bbs.xiuno.com/', 'rank' => 0, 'create_date' => $time, ));*/ $setting = array('sitebrief' => '', 'seo_title' => '', 'seo_keywords' => '', 'seo_description' => '', 'footer_code' => ''); kv_set('setting', $setting); // 写测试数据 if ($test_data == 1) { runtime_truncate(); runtime_init(); online_init(); for ($i = 0; $i < 5; $i++) { $subject = '欢迎使用 Xiuno BBS 3.0 新一代论坛系统。' . $i; $message = '祝您使用愉快!'; $thread = array('fid' => 1, 'uid' => 1, 'subject' => $subject, 'message' => $message, 'seo_url' => '', 'time' => $time, 'longip' => $longip); $tid = thread_create($thread, $pid); for ($j = 0; $j < 2; $j++) { $post = array('tid' => $tid, 'uid' => 1, 'create_date' => $time, 'userip' => $longip, 'isfirst' => 0, 'message' => $message . rand(1, 10000)); $pid = post_create($post, 1); } } } message(0, '安装成功。'); } // 写数据库