标题:
discuz6.0重要函数收录showmessage
[打印本页]
作者:
fangzhen
时间:
2009-11-13 13:54
标题:
discuz6.0重要函数收录showmessage
1.信息提示
function showmessage($message, $url_forward = '', $extra = '') {
extract($GLOBALS, EXTR_SKIP);
global $extrahead, $discuz_action, $debuginfo, $seccode, $fid, $tid, $supe_fromsupesite, $supe_jumpurl, $supe, $charset, $show_message, $inajax, $_DCACHE, $advlist;
define('CACHE_FORBIDDEN', TRUE);
$supe_messagetpl = $supe_error = '';
$show_message = $message;
$msgforward = unserialize($_DCACHE['settings']['msgforward']);
$msgforward['refreshtime'] = intval($msgforward['refreshtime']);
$url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);
if($supe_fromsupesite && $supe['status']) {
$supe_messagetpl = 'supesite_';
$extra = '';
$supe_error = $url_forward ? false : true;
$url_forward = !empty($supe_jumpurl) && !$supe_error ? urldecode($supe_jumpurl) : $url_forward;
} elseif($url_forward && empty($inajax) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages'])) {
updatesession();
dheader("location: ".str_replace('&', '&', $url_forward));
}
if(in_array($extra, array('HALTED', 'NOPERM'))) {
$fid = $tid = 0;
$discuz_action = 254;
} else {
$discuz_action = 255;
}
include language('messages');
if(isset($language[$message])) {
$pre = $supe_fromsupesite ? 'supe_' : ($inajax ? 'ajax_' : '');
eval("\$show_message = \"".(isset($language[$pre.$message]) ? $language[$pre.$message] : $language[$message])."\";");
unset($pre);
}
$extrahead .= $url_forward ? '<meta http-equiv="refresh" content="'.$msgforward['refreshtime'].' url='.$url_forward.'">' : '';
if($advlist = array_merge($globaladvs ? $globaladvs['type'] : array(), $redirectadvs ? $redirectadvs['type'] : array())) {
$advitems = ($globaladvs ? $globaladvs['items'] : array()) + ($redirectadvs ? $redirectadvs['items'] : array());
foreach($advlist AS $type => $redirectadvs) {
$advlist[$type] = $advitems[$redirectadvs[array_rand($redirectadvs)]];
}
}
if($extra == 'NOPERM' && !$passport_status) {
//get secure code checking status (pos. -2)
if($seccodecheck = substr(sprintf('%05b', $seccodestatus), -2, 1)) {
$seccode = random(6, 1) + $seccode{0} * 1000000;
}
include template('nopermission');
} else {
include template($supe_messagetpl.'showmessage');
}
dexit();
}
该函数一个缺陷就是不能个性化设置信息显示时间。
欢迎光临 PHP开发笔记 (http://phpvi.com/)
Powered by Discuz! 6.1.0