function getstatistics() { global $_SGLOBAL, $_SC, $_SCONFIG; $dbsize = 0; $query = $_SGLOBAL['db']->query("SHOW TABLE STATUS LIKE '{$_SC['tablepre']}%'", 'SILENT'); while ($table = $_SGLOBAL['db']->fetch_array($query)) { $dbsize += $table['Data_length'] + $table['Index_length']; } $sitekey = trim($_SCONFIG['sitekey']); if (empty($sitekey)) { $sitekey = mksitekey(); $_SGLOBAL['db']->query("REPLACE INTO " . tname('settings') . " (variable, value) VALUES ('sitekey', '{$sitekey}')"); include_once S_ROOT . './function/cache.func.php'; updatesettingcache(); } $statistics = array('sitekey' => $sitekey, 'version' => S_VER, 'release' => S_RELEASE, 'php' => PHP_VERSION, 'mysql' => $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT VERSION()"), 0), 'dbsize' => $dbsize, 'charset' => $_SC['charset'], 'sitename' => preg_replace('/[\'\\"\\s]/s', '', $_SCONFIG['sitename']), 'adnum' => getcount('ads', array()), 'announcementnum' => getcount('announcements', array()), 'attachmentnum' => getcount('attachments', array()), 'forumnum' => getcount('forums', array()), 'categorynum' => getcount('categories', array()), 'channelnum' => getcount('channels', array()), 'friendlinknum' => getcount('friendlinks', array()), 'membernum' => getcount('members', array()), 'modelnum' => getcount('models', array()), 'pollnum' => getcount('polls', array()), 'reportnum' => getcount('reports', array()), 'robotnum' => getcount('robots', array()), 'spacecommentnum' => getcount('spacecomments', array()), 'spaceitemnum' => getcount('spaceitems', array()), 'tagnum' => getcount('tags', array()), 'usergroupnum' => getcount('usergroups', array())); $statistics['update'] = rawurlencode(serialize($statistics)) . '&h=' . substr(md5($_SERVER['HTTP_USER_AGENT'] . '|' . implode('|', $statistics)), 8, 8); return $statistics; }
} $_SGLOBAL['db']->query("DROP TABLE IF EXISTS {$tablename}"); if (!($query = $_SGLOBAL['db']->query($sqls[$key] . $sqltype, 'SILENT'))) { $installok = false; break; } } if (!$installok) { show_msg("<font color=\"blue\">数据表 ({$tablename}) 自动安装失败</font><br />反馈: " . mysql_error() . "<br /><br />请参照 {$sqlfile} 文件中的SQL文,自己手工安装数据库后,再继续进行安装操作<br /><br /><a href=\"?step={$step}\">重试</a>"); } else { show_msg('数据表已经全部安装完成,进入下一步操作', $step + 1, 1); } } elseif ($step == 4) { dbconnect(); //config $sitekey = mksitekey(); $datas = array("'allowcache', '1'", "'allowguest', '0'", "'attachmentdir', './attachments'", "'attachmentdirtype', 'month'", "'allowregister', '1'", "'attachmenturl', ''", "'bbsurltype', 'site'", "'checkgrade', ''", "'debug', '0'", "'gzipcompress', '0'", "'htmldir', './html'", "'htmlurl', ''", "'htmlcategory', '0'", "'htmlcategorytime', '300'", "'htmlindex', '0'", "'htmlindextime', '300'", "'htmlviewnews', '0'", "'htmlviewnewstime', '300'", "'language', 'chinese.php'", "'needcheck', '0'", "'pagepostfix', ''", "'searchinterval', '30'", "'sitename', 'SupeSite社区门户'", "'template', 'default'", "'thumbbgcolor', '#C0C0C0'", "'thumbcutmode', '2'", "'thumbcutstartx', '0'", "'thumbcutstarty', '0'", "'thumboption', '4'", "'timeoffset', '8'", "'urltype', '4'", "'watermark', '0'", "'watermarkfile', 'images/base/watermark.gif'", "'watermarkjpgquality', '85'", "'watermarkstatus', '9'", "'watermarktrans', '30'", "'seotitle', ''", "'seokeywords', ''", "'seodescription', ''", "'seohead', ''", "'noseccode', '1'", "'showindex', '0'", "'newsjammer', '0'", "'updateview', '1'", "'allowguestsearch', '0'", "'commenttime', '30'", "'customaddfeed', '1'", "'allowfeed', '1'", "'sitekey', '{$sitekey}'"); $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('settings')); $_SGLOBAL['db']->query("INSERT INTO " . tname('settings') . " (`variable`, `value`) VALUES (" . implode('),(', $datas) . ")"); //attachmenttypes $datas = array("'jpg', 2097152", "'jpeg', 2097152", "'png', 2097152", "'gif', 2097152", "'rar', 2097152", "'txt', 2097152", "'zip', 2097152"); $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('attachmenttypes')); $_SGLOBAL['db']->query("INSERT INTO " . tname('attachmenttypes') . " (fileext, maxsize) VALUES (" . implode('),(', $datas) . ")"); //categories $datas = array("'科技世界', 'news'", "'互联网络', 'news'", "'财经报道', 'news'", "'体育资讯', 'news'", "'明星娱乐', 'news'", "'生活资讯', 'news'", "'网站建设', 'news'", "'动态报道', 'news'", "'特别关注', 'news'"); $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('categories')); $_SGLOBAL['db']->query("INSERT INTO " . tname('categories') . " (`name`, `type`) VALUES (" . implode('),(', $datas) . ")"); $_SGLOBAL['db']->query("UPDATE " . tname('categories') . " SET subcatid=catid"); $datas = array("'news', 'type', '1'"); $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('channels')); $_SGLOBAL['db']->query("INSERT INTO " . tname('channels') . " (`nameid`, `type`, `status`) VALUES (" . implode('),(', $datas) . ")");
$is_admin = true; // 检查管理员权限(即:是否有“后台/应用”的权限) if (!hasPopedom($_SITE_CONFIG['uid'], 'admin/Apps/*', false)) { redirect(SITE_URL, 5, '您无权限查看'); } } else { $is_admin = false; } if (empty($_SITE_CONFIG['my_site_id']) || empty($_SITE_CONFIG['my_site_key'])) { $_SITE_CONFIG['my_status'] = 0; } if (submitcheck('mysubmit')) { //开启漫游 OR 同步漫游信息 $_SITE_CONFIG['site_key'] = trim($_SITE_CONFIG['site_key']); if (empty($_SITE_CONFIG['site_key'])) { $_SITE_CONFIG['site_key'] = mksitekey(); $db_prefix = getDbPrefix(); doQuery("REPLACE INTO {$db_prefix}system_data (`list`, `key`, `value`) VALUES ('myop', 'site_key', '" . serialize($_SITE_CONFIG['site_key']) . "')"); } //如果漫游关闭再开启则直接调用更新接口 if (empty($_SITE_CONFIG['my_status']) && !empty($_SITE_CONFIG['my_site_id']) && !empty($_SITE_CONFIG['my_site_key'])) { $_SITE_CONFIG['my_status'] = 1; } $is_register = 0; if (empty($_SITE_CONFIG['my_status'])) { $is_register = 1; $res = my_site_register($_SITE_CONFIG['site_key'], $_SITE_CONFIG['site_name'], MYOP_URL, UC_URL, $_SITE_CONFIG['charset'], $_SITE_CONFIG['timeoffset'], 0, 0, $_SITE_CONFIG['language'], SOCIAX_VER, MY_VER); } else { $res = my_site_refresh($_SITE_CONFIG['my_site_id'], $_SITE_CONFIG['site_name'], MYOP_URL, UC_URL, $_SITE_CONFIG['charset'], $_SITE_CONFIG['timeoffset'], 0, 0, $_SITE_CONFIG['my_site_key'], $_SITE_CONFIG['site_key'], $_SITE_CONFIG['language'], SOCIAX_VER, MY_VER); } if ($res['errCode']) {
function getstatistics() { global $_SGLOBAL, $_SC, $_SCONFIG; $dbsize = 0; $query = $_SGLOBAL['db']->query("SHOW TABLE STATUS LIKE '{$_SC['tablepre']}%'", 'SILENT'); while ($table = $_SGLOBAL['db']->fetch_array($query)) { $dbsize += $table['Data_length'] + $table['Index_length']; } $sitekey = trim($_SCONFIG['sitekey']); if (empty($sitekey)) { $sitekey = mksitekey(); $_SGLOBAL['db']->query("REPLACE INTO " . tname('config') . " (var, datavalue) VALUES ('sitekey', '{$sitekey}')"); include_once S_ROOT . './source/function_cache.php'; config_cache(false); } $statistics = array('sitekey' => $sitekey, 'version' => X_VER, 'release' => X_RELEASE, 'php' => PHP_VERSION, 'mysql' => $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT VERSION()"), 0), 'dbsize' => $dbsize, 'charset' => $_SC['charset'], 'sitename' => preg_replace('/[\'\\"\\s]/s', '', $_SCONFIG['sitename']), 'feednum' => getcount('feed', array()), 'blognum' => getcount('blog', array()), 'albumnum' => getcount('pic', array()), 'threadnum' => getcount('thread', array()), 'sharenum' => getcount('share', array()), 'commentnum' => getcount('comment', array()), 'myappnum' => getcount('myapp', array()), 'spacenum' => getcount('space', array())); $statistics['update'] = rawurlencode(serialize($statistics)) . '&h=' . substr(md5($_SERVER['HTTP_USER_AGENT'] . '|' . implode('|', $statistics)), 8, 8); return $statistics; }