📄 home.inc.php
字号:
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: home.inc.php 17291 2008-12-12 03:15:51Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if(@file_exists(DISCUZ_ROOT.'./install/index.php')) {
@unlink(DISCUZ_ROOT.'./install/index.php');
if(@file_exists(DISCUZ_ROOT.'./install/index.php')) {
dexit('Please delete install/index.php via FTP!');
}
}
@include_once DISCUZ_ROOT.'./discuz_version.php';
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$siteuniqueid = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='siteuniqueid'");
if(empty($siteuniqueid) || strlen($siteuniqueid) < 16) {
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$siteuniqueid = $chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($onlineip.$discuz_user.$timestamp), 0, 4).random(6);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('siteuniqueid', '$siteuniqueid')");
}
if(empty($_DCACHE['settings']['authkey']) || strlen($_DCACHE['settings']['authkey']) < 16) {
$authkey = $_DCACHE['settings']['authkey'] = substr(md5($siteuniqueid.$bbname.$timestamp), 8, 8).random(8);
$db->query("REPLACE INTO {$tablepre}settings SET variable='authkey', value='$authkey'");
updatesettings();
}
if(submitcheck('notesubmit', 1)) {
if($noteid) {
$db->query("DELETE FROM {$tablepre}adminnotes WHERE id='$noteid' AND (admin='$discuz_user' OR adminid>='$adminid')");
}
if($newmessage) {
$newaccess[$adminid] = 1;
$newaccess = bindec(intval($newaccess[1]).intval($newaccess[2]).intval($newaccess[3]));
$newexpiration = strtotime($newexpiration);
$newmessage = nl2br(dhtmlspecialchars($newmessage));
$db->query("INSERT INTO {$tablepre}adminnotes (admin, access, adminid, dateline, expiration, message)
VALUES ('$discuz_user', '$newaccess', '$adminid', '$timestamp', '$newexpiration', '$newmessage')");
}
}
$serverinfo = PHP_OS.' / PHP v'.PHP_VERSION;
$serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
$serversoft = $_SERVER['SERVER_SOFTWARE'];
$dbversion = $db->result_first("SELECT VERSION()");
if(@ini_get('file_uploads')) {
$fileupload = ini_get('upload_max_filesize');
} else {
$fileupload = '<font color="red">'.$lang['no'].'</font>';
}
//$groupselect = '';
//$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups ORDER BY creditslower, groupid");
//while($group = $db->fetch_array($query)) {
// $groupselect .= '<option value="'.$group['groupid'].'">'.$group['grouptitle'].'</option>';
//}
$dbsize = 0;
$query = $db->query("SHOW TABLE STATUS LIKE '$tablepre%'", 'SILENT');
while($table = $db->fetch_array($query)) {
$dbsize += $table['Data_length'] + $table['Index_length'];
}
$dbsize = $dbsize ? sizecount($dbsize) : $lang['unknown'];
if(isset($attachsize)) {
$attachsize = $db->result($db->query("SELECT SUM(filesize) FROM {$tablepre}attachments"), 0);
$attachsize = is_numeric($attachsize) ? sizecount($attachsize) : $lang['unknown'];
} else {
$attachsize = '<a href="admincp.php?action=home&attachsize">[ '.$lang['detail'].' ]</a>';
}
$membersmod = $db->result_first("SELECT COUNT(*) FROM {$tablepre}validating WHERE status='0'");
$postsmod = $db->result_first("SELECT COUNT(*) FROM {$tablepre}posts WHERE first='0' AND invisible='-2'");
$threadsdel = $threadsmod = 0;
$query = $db->query("SELECT displayorder FROM {$tablepre}threads WHERE displayorder<'0'");
while($thread = $db->fetch_array($query)) {
if($thread['displayorder'] == -1) {
$threadsdel++;
} elseif($thread['displayorder'] == -2) {
$threadsmod++;
}
}
cpheader();
shownav();
showsubmenu('home_welcome');
$save_mastermobile = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='mastermobile'");
$save_mastermobile = !empty($save_mastermobile) ? authcode($save_mastermobile, 'DECODE', $authkey) : '';
$securityadvise = '';
$securityadvise .= !$discuz_secques ? $lang['home_secques_invalid'] : '';
$securityadvise .= empty($forumfounders) ? $lang['home_security_nofounder'] : '';
$securityadvise .= $admincp['tpledit'] ? $lang['home_security_tpledit'] : '';
$securityadvise .= $admincp['runquery'] ? $lang['home_security_runquery'] : '';
if(isfounder()) {
if($securyservice) {
$new_mastermobile = trim($new_mastermobile);
if(empty($new_mastermobile)) {
$save_mastermobile = $new_mastermobile;
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('mastermobile', '$new_mastermobile')");
} elseif($save_mastermobile != $new_mastermobile && strlen($new_mastermobile) == 11 && is_numeric($new_mastermobile) && (substr($new_mastermobile, 0, 2) == '13' || substr($new_mastermobile, 0, 2) == '15')) {
$save_mastermobile = $new_mastermobile;
$new_mastermobile = authcode($new_mastermobile, 'ENCODE', $authkey);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('mastermobile', '$new_mastermobile')");
}
}
$view_mastermobile = !empty($save_mastermobile) ? substr($save_mastermobile, 0 , 3).'*****'.substr($save_mastermobile, -3) : '';
$securityadvise = '<li><p>'.lang('home_security_service_info').'</p><form method="post" action="'.$BASESCRIPT.'?action=home&securyservice=yes">'.lang('home_security_service_mobile').': <input type="text" class="txt" name="new_mastermobile" value="'.$view_mastermobile.'" size="30" /> <input type="submit" class="btn" name="securyservice" value="'.lang($view_mastermobile ? 'submit' : 'home_security_service_open').'" /> <span class="lightfont">'.lang($view_mastermobile ? 'home_security_service_mobile_save' : 'home_security_service_mobile_none').'</span></form></li>'.$securityadvise;
}
showtableheader('home_security_tips', '', '', 0);
showtablerow('', 'class="tipsblock"', '<ul>'.$securityadvise.'</ul>');
showtablefooter();
//showsubmenu('home_security_tips');
//echo '<ul class="safelist">'.$securityadvise.'</ul>';
if($isfounder) {
$insenz = ($insenz = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='insenz'")) ? unserialize($insenz) : array();
if(empty($insenz['authkey'])) {
showtableheader('insenz_note', 'noborder mt10', '', 0);
showtablerow('', '', lang('insenz_note_join_insenz').'<a href="'.$BASESCRIPT.'?action=insenz"><u>'.$lang['insenz_note_register'].'</u></a>');
showtablefooter();
} elseif($insenz['status']) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -