本文整理汇总了PHP中setglobal函数的典型用法代码示例。如果您正苦于以下问题:PHP setglobal函数的具体用法?PHP setglobal怎么用?PHP setglobal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setglobal函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getdata
function getdata($style, $parameter)
{
$advid = 0;
if (!empty($parameter['title'])) {
$adv = C::t('common_advertisement_custom')->fetch_by_name($parameter['title']);
if (empty($adv)) {
$advid = C::t('common_advertisement_custom')->insert(array('name' => $parameter['title']), true);
} else {
$advid = $adv['id'];
}
} elseif (!empty($parameter['adv'])) {
$adv = C::t('common_advertisement_custom')->fetch_by_name($parameter['adv']);
$advid = intval($adv['id']);
} else {
$return = 'Empty Ads';
}
if ($advid) {
$flag = false;
if (getglobal('inajax')) {
$flag = true;
setglobal('inajax', 0);
}
$return = adshow('custom_' . $advid);
if ($flag) {
setglobal('inajax', 1);
}
}
return array('html' => $return, 'data' => null);
}
示例2: getdata
function getdata($style, $parameter)
{
$advid = 0;
if (!empty($parameter['title'])) {
$parameter['title'] = addslashes($parameter['title']);
$adv = DB::fetch_first('SELECT * FROM ' . DB::table('common_advertisement_custom') . " WHERE name='{$parameter['title']}'");
if (empty($adv)) {
$advid = DB::insert('common_advertisement_custom', array('name' => $parameter['title']), 1);
} else {
$advid = $adv['id'];
}
} elseif (!empty($parameter['adv'])) {
$parameter['adv'] = addslashes($parameter['adv']);
$adv = DB::fetch_first('SELECT * FROM ' . DB::table('common_advertisement_custom') . " WHERE name='{$parameter['adv']}'");
$advid = intval($adv['id']);
} else {
$return = 'Empty Ads';
}
if ($advid) {
$flag = false;
if (getglobal('inajax')) {
$flag = true;
setglobal('inajax', 0);
}
$return = adshow('custom_' . $advid);
if ($flag) {
setglobal('inajax', 1);
}
}
return array('html' => $return, 'data' => null);
}
示例3: update
public function update()
{
if ($this->sid !== null) {
if ($this->isnew) {
$this->delete();
$this->table->insert($this->var, false, false, true);
} else {
$this->table->update($this->var['sid'], $this->var);
}
setglobal('sessoin', $this->var);
dsetcookie('sid', $this->sid, 86400);
}
}
示例4: unique_id
function unique_id($extra = 'c')
{
static $dss_seeded = false;
global $_G;
$val = $_G['config']['rand_seed'] . microtime();
$val = md5($val);
$nextval = md5($_G['config']['rand_seed'] . $val . $extra);
if ($dss_seeded !== true && $_G['config']['rand_seed_last_update'] < time() - rand(1, 10)) {
setglobal('config/rand_seed_last_update', time());
setglobal('config/rand_seed', $nextval);
$dss_seeded = true;
}
return substr($val, 4, 16);
}
示例5: _init_mobile
function _init_mobile()
{
if (!$this->var['setting'] || !$this->init_mobile || !$this->var['setting']['mobile']['allowmobile'] || !is_array($this->var['setting']['mobile']) || IS_ROBOT) {
$nomobile = true;
$unallowmobile = true;
}
if ($_GET['mobile'] === 'no') {
dsetcookie('mobile', 'no', 3600);
$nomobile = true;
} elseif ($this->var['cookie']['mobile'] == 'no' && $_GET['mobile'] === 'yes') {
dsetcookie('mobile', '');
} elseif ($this->var['cookie']['mobile'] == 'no') {
$nomobile = true;
}
if (!checkmobile()) {
$nomobile = true;
}
if ($this->var['setting']['mobile']['mobilepreview'] && !$this->var['mobile'] && !$unallowmobile) {
if ($_GET['mobile'] === 'yes') {
dheader("Location:misc.php?mod=mobile");
}
}
if ($nomobile || !$this->var['setting']['mobile']['mobileforward'] && $_GET['mobile'] !== 'yes') {
if ($_SERVER['HTTP_HOST'] == $this->var['setting']['domain']['app']['mobile'] && $this->var['setting']['domain']['app']['default']) {
dheader("Location:http://" . $this->var['setting']['domain']['app']['default'] . $_SERVER['REQUEST_URI']);
} else {
return;
}
}
if (strpos($this->var['setting']['domain']['defaultindex'], CURSCRIPT) !== false && CURSCRIPT != 'forum' && !$_GET['mod']) {
if ($this->var['setting']['domain']['app']['mobile']) {
$mobileurl = 'http://' . $this->var['setting']['domain']['app']['mobile'];
} else {
if ($this->var['setting']['domain']['app']['forum']) {
$mobileurl = 'http://' . $this->var['setting']['domain']['app']['forum'] . '?mobile=yes';
} else {
$mobileurl = $this->var['siteurl'] . 'forum.php?mobile=yes';
}
}
dheader("location:{$mobileurl}");
}
define('IN_MOBILE', true);
setglobal('gzipcompress', 0);
$arr = array(strstr($_SERVER['QUERY_STRING'], '&simpletype'), strstr($_SERVER['QUERY_STRING'], 'simpletype'), '&mobile=yes', 'mobile=yes');
$query_sting_tmp = str_replace($arr, '', $_SERVER['QUERY_STRING']);
$this->var['setting']['mobile']['nomobileurl'] = ($this->var['setting']['domain']['app']['forum'] ? 'http://' . $this->var['setting']['domain']['app']['forum'] . '/' : $this->var['siteurl']) . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=no';
$this->var['setting']['lazyload'] = 0;
if ('utf-8' != CHARSET) {
if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
foreach ($_POST as $pk => $pv) {
if (!is_numeric($pv)) {
$this->var['gp_' . $pk] = $_GET[$pk] = $_POST[$pk] = $this->mobile_iconv_recurrence($pv);
}
}
}
}
if ($_GET['simpletype']) {
if ($_GET['simpletype'] == 'yes') {
$this->var['setting']['mobile']['mobilesimpletype'] = 1;
dsetcookie('simpletype', 1, 86400);
} else {
$this->var['setting']['mobile']['mobilesimpletype'] = 0;
dsetcookie('simpletype', 0, 86400);
}
} elseif ($this->var['cookie']['simpletype']) {
$this->var['setting']['mobile']['mobilesimpletype'] = $this->var['cookie']['simpletype'] == 1 ? 1 : 0;
}
if (!$this->var['setting']['mobile']['mobilesimpletype']) {
$this->var['setting']['imagemaxwidth'] = 224;
}
$this->var['setting']['regstatus'] = $this->var['setting']['mobile']['mobileregister'] ? $this->var['setting']['regstatus'] : 0;
if (!$this->var['setting']['mobile']['mobileseccode']) {
$this->var['setting']['seccodestatus'] = 0;
}
$this->var['setting']['seccodedata']['type'] = 99;
$this->var['setting']['thumbquality'] = 50;
$this->var['setting']['mobile']['simpletypeurl'] = array();
$this->var['setting']['mobile']['simpletypeurl'][0] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=yes&simpletype=no';
$this->var['setting']['mobile']['simpletypeurl'][1] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=yes&simpletype=yes';
unset($query_sting_tmp);
ob_start();
}
示例6: _initGuest
protected function _initGuest()
{
setglobal('member', array('uid' => 0, 'username' => '', 'adminid' => 0, 'groupid' => 7, 'credits' => 0, 'timeoffset' => 9999));
}
示例7: _init_misc
private function _init_misc()
{
if (!$this->init_misc) {
return false;
}
lang('core');
if ($this->init_setting && $this->init_user) {
if (!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') {
$this->var['member']['timeoffset'] = $this->var['setting']['timeoffset'];
}
}
$timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset'];
$this->var['timenow'] = array('time' => dgmdate(TIMESTAMP), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset);
$this->timezone_set($timeoffset);
$this->var['formhash'] = formhash();
define('FORMHASH', $this->var['formhash']);
if ($this->init_user) {
$allowvisitflag = in_array(CURSCRIPT, array('user')) || defined('ALLOWGUEST') && ALLOWGUEST;
if (isset($this->var['member']['status']) && $this->var['member']['status'] == -1 && !$allowvisitflag) {
showmessage('user_banned');
}
}
if (isset($this->var['setting']['ipaccess']) && $this->var['setting']['ipaccess'] && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) {
showmessage('user_banned');
}
if ($this->var['setting']['bbclosed']) {
if ($this->var['member']['adminid'] == 1) {
//系统管理员允许访问
} elseif (in_array(CURSCRIPT, array('admin', 'user', 'api')) || defined('ALLOWGUEST') && ALLOWGUEST) {
} else {
$closedreason = C::t('setting')->fetch('closedreason');
$closedreason = str_replace(':', ':', $closedreason);
dheader("Location: user.php?mod=logging&action=login");
}
}
if (isset($this->var['setting']['nocacheheaders']) && $this->var['setting']['nocacheheaders']) {
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
}
$lastact = TIMESTAMP . "\t" . dhtmlspecialchars(basename($this->var['PHP_SELF'])) . "\t" . dhtmlspecialchars($this->var['mod']);
dsetcookie('lastact', $lastact, 86400);
setglobal('currenturl_encode', base64_encode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
}
示例8: _init_mobile
private function _init_mobile()
{
if (!$this->init_mobile) {
return false;
}
if (!$this->var['setting'] || !$this->var['setting']['mobile']['allowmobile'] || !is_array($this->var['setting']['mobile']) || IS_ROBOT) {
$nomobile = true;
$unallowmobile = true;
}
$mobile = getgpc('mobile');
$mobileflag = isset($this->var['mobiletpl'][$mobile]);
if ($mobile === 'no') {
dsetcookie('mobile', 'no', 3600);
$nomobile = true;
} elseif ($this->var['cookie']['mobile'] == 'no' && $mobileflag) {
checkmobile();
dsetcookie('mobile', '');
} elseif ($this->var['cookie']['mobile'] == 'no') {
$nomobile = true;
} elseif (!($mobile_ = checkmobile())) {
$nomobile = true;
}
if (!$mobile || $mobile == 'yes') {
$mobile = isset($mobile_) ? $mobile_ : 2;
}
if (!$this->var['mobile'] && !$unallowmobile) {
if ($mobileflag) {
//dheader("Location:misc.php?mod=mobile");
}
}
if ($nomobile || !$this->var['setting']['mobile']['mobileforward'] && !$mobileflag) {
if ($_SERVER['HTTP_HOST'] == $this->var['setting']['domain']['app']['mobile'] && $this->var['setting']['domain']['app']['default']) {
dheader("Location:http://" . $this->var['setting']['domain']['app']['default'] . $_SERVER['REQUEST_URI']);
return false;
} else {
return false;
}
}
if (strpos($this->var['setting']['domain']['defaultindex'], CURSCRIPT) !== false && CURSCRIPT != 'forum' && !$_GET['mod']) {
if ($this->var['setting']['domain']['app']['mobile']) {
$mobileurl = 'http://' . $this->var['setting']['domain']['app']['mobile'];
} else {
if ($this->var['setting']['domain']['app']['forum']) {
$mobileurl = 'http://' . $this->var['setting']['domain']['app']['forum'] . '?mobile=yes';
} else {
$mobileurl = $this->var['siteurl'] . 'forum.php?mobile=yes';
}
}
dheader("location:{$mobileurl}");
}
if ($mobile === '3' && empty($this->var['setting']['mobile']['wml'])) {
return false;
}
define('IN_MOBILE', isset($this->var['mobiletpl'][$mobile]) ? $mobile : '2');
setglobal('gzipcompress', 0);
$arr = array();
foreach (array_keys($this->var['mobiletpl']) as $mobiletype) {
$arr[] = '&mobile=' . $mobiletype;
$arr[] = 'mobile=' . $mobiletype;
}
$arr = array_merge(array(strstr($_SERVER['QUERY_STRING'], '&simpletype'), strstr($_SERVER['QUERY_STRING'], 'simpletype')), $arr);
$query_sting_tmp = str_replace($arr, '', $_SERVER['QUERY_STRING']);
$this->var['setting']['mobile']['nomobileurl'] = ($this->var['setting']['domain']['app']['forum'] ? 'http://' . $this->var['setting']['domain']['app']['forum'] . '/' : $this->var['siteurl']) . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=no';
$this->var['setting']['lazyload'] = 0;
if ('utf-8' != CHARSET) {
if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
foreach ($_POST as $pk => $pv) {
if (!is_numeric($pv)) {
$_GET[$pk] = $_POST[$pk] = $this->mobile_iconv_recurrence($pv);
if (!empty($this->var['config']['input']['compatible'])) {
$this->var['gp_' . $pk] = daddslashes($_GET[$pk]);
}
}
}
}
}
if (!$this->var['setting']['mobile']['mobilesimpletype']) {
$this->var['setting']['imagemaxwidth'] = 224;
}
$this->var['setting']['regstatus'] = $this->var['setting']['mobile']['mobileregister'] ? $this->var['setting']['regstatus'] : 0;
$this->var['setting']['thumbquality'] = 50;
$this->var['setting']['avatarmethod'] = 0;
$this->var['setting']['mobile']['simpletypeurl'] = array();
$this->var['setting']['mobile']['simpletypeurl'][0] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=1&simpletype=no';
$this->var['setting']['mobile']['simpletypeurl'][1] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=1&simpletype=yes';
$this->var['setting']['mobile']['simpletypeurl'][2] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=2';
unset($query_sting_tmp);
ob_start();
}
示例9: _init_misc
protected function _init_misc()
{
if ($this->config['security']['urlxssdefend'] && !defined('DISABLEXSSCHECK')) {
$this->_xss_check();
}
// if(!$this->init_misc) {
// return false;
// }
lang('core');
if ($this->init_setting && $this->init_user) {
if (!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') {
$this->var['member']['timeoffset'] = $this->var['setting']['timeoffset'];
}
}
$timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset'];
$this->var['timenow'] = array('time' => dgmdate(TIMESTAMP), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset);
$this->timezone_set($timeoffset);
$this->var['formhash'] = formhash();
define('FORMHASH', $this->var['formhash']);
if ($this->init_user) {
$allowvisitflag = in_array(CURSCRIPT, array('member')) || defined('ALLOWGUEST') && ALLOWGUEST;
if ($this->var['group'] && isset($this->var['group']['allowvisit']) && !$this->var['group']['allowvisit']) {
if ($this->var['uid'] && !$allowvisitflag) {
if (!defined('IN_MOBILE_API')) {
showmessage('user_banned');
} else {
mobile_core::result(array('error' => 'user_banned'));
}
} elseif ((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api')) && !$this->var['inajax']) {
if (!defined('IN_MOBILE_API')) {
dheader('location: member.php?mod=logging&action=login&referer=' . rawurlencode($this->var['siteurl'] . $this->var['basefilename'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '')));
} else {
mobile_core::result(array('error' => 'to_login'));
}
}
}
if (isset($this->var['member']['status']) && $this->var['member']['status'] == -1 && !$allowvisitflag) {
if (!defined('IN_MOBILE_API')) {
showmessage('user_banned');
} else {
mobile_core::result(array('error' => 'user_banned'));
}
}
}
if ($this->var['setting']['ipaccess'] && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) {
if (!defined('IN_MOBILE_API')) {
showmessage('user_banned');
} else {
mobile_core::result(array('error' => 'user_banned'));
}
}
if ($this->var['setting']['bbclosed']) {
if ($this->var['uid'] && ($this->var['group']['allowvisit'] == 2 || $this->var['groupid'] == 1)) {
} elseif (in_array(CURSCRIPT, array('admin', 'member', 'api')) || defined('ALLOWGUEST') && ALLOWGUEST) {
} else {
$closedreason = C::t('common_setting')->fetch('closedreason');
$closedreason = str_replace(':', ':', $closedreason);
if (!defined('IN_MOBILE_API')) {
// showmessage($closedreason ? $closedreason : 'board_closed', NULL, array('adminemail' => $this->var['setting']['adminemail']), array('login' => 1));
$closedreason = $closedreason ? $closedreason : lang('message', 'board_closed');
WebUtils::endAppWithErrorInfo(array(), WebUtils::emptyHtml($closedreason));
} else {
mobile_core::result(array('error' => $closedreason ? $closedreason : 'board_closed'));
}
}
}
if (CURSCRIPT != 'admin' && !in_array($this->var['mod'], array('logging', 'seccode'))) {
periodscheck('visitbanperiods');
}
if (defined('IN_MOBILE')) {
$this->var['tpp'] = $this->var['setting']['mobile']['mobiletopicperpage'] ? intval($this->var['setting']['mobile']['mobiletopicperpage']) : 20;
$this->var['ppp'] = $this->var['setting']['mobile']['mobilepostperpage'] ? intval($this->var['setting']['mobile']['mobilepostperpage']) : 5;
} else {
$this->var['tpp'] = $this->var['setting']['topicperpage'] ? intval($this->var['setting']['topicperpage']) : 20;
$this->var['ppp'] = $this->var['setting']['postperpage'] ? intval($this->var['setting']['postperpage']) : 10;
}
if ($this->var['setting']['nocacheheaders']) {
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
}
if ($this->session->isnew && $this->var['uid']) {
updatecreditbyaction('daylogin', $this->var['uid']);
include_once libfile('function/stat');
updatestat('login', 1);
if (defined('IN_MOBILE')) {
updatestat('mobilelogin', 1);
}
if ($this->var['setting']['connect']['allow'] && $this->var['member']['conisbind']) {
updatestat('connectlogin', 1);
}
}
if (isset($this->var['member']['conisbind']) && $this->var['member']['conisbind'] && $this->var['setting'] && $this->var['setting']['connect']['newbiespan'] !== '') {
$this->var['setting']['newbiespan'] = $this->var['setting']['connect']['newbiespan'];
}
$lastact = TIMESTAMP . "\t" . dhtmlspecialchars(basename($this->var['PHP_SELF'])) . "\t" . dhtmlspecialchars($this->var['mod']);
dsetcookie('lastact', $lastact, 86400);
setglobal('currenturl_encode', base64_encode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
if ((!empty($_GET['fromuid']) || !empty($_GET['fromuser'])) && ($this->var['setting']['creditspolicy']['promotion_visit'] || $this->var['setting']['creditspolicy']['promotion_register'])) {
require_once libfile('misc/promotion', 'include');
//.........这里部分代码省略.........
示例10: update
public function update()
{
if ($this->sid !== null) {
if ($this->isnew) {
$this->delete();
$this->table->insert($this->var, false, false, true);
} else {
//添加时间更新的限制 原来的每次刷新都会更新
if (TIMESTAMP % 60 == 0) {
$this->table->update($this->var['sid'], $this->var);
}
}
setglobal('sessoin', $this->var);
dsetcookie('sid', $this->sid, 86400);
}
}
示例11: _init_misc
function _init_misc()
{
if (!$this->init_misc) {
return false;
}
lang('core');
if ($this->init_setting && $this->init_user) {
if (!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') {
$this->var['member']['timeoffset'] = $this->var['setting']['timeoffset'];
}
}
$timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset'];
$this->var['timenow'] = array('time' => dgmdate(TIMESTAMP), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset);
$this->timezone_set($timeoffset);
$this->var['formhash'] = formhash();
define('FORMHASH', $this->var['formhash']);
if ($this->init_user) {
if ($this->var['group'] && isset($this->var['group']['allowvisit']) && !$this->var['group']['allowvisit']) {
if ($this->var['uid']) {
sysmessage('user_banned', null);
} elseif ((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'api')) && !$this->var['inajax']) {
dheader('location: member.php?mod=logging&action=login&referer=' . rawurlencode($_SERVER['REQUEST_URI']));
}
}
if ($this->var['member']['status'] == -1) {
sysmessage('user_banned', null);
}
}
if ($this->var['setting']['ipaccess'] && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) {
sysmessage('user_banned', null);
}
if ($this->var['setting']['bbclosed']) {
if ($this->var['uid'] && ($this->var['group']['allowvisit'] == 2 || $this->var['groupid'] == 1)) {
} elseif (in_array(CURSCRIPT, array('admin', 'member', 'api')) || defined('ALLOWGUEST') && ALLOWGUEST) {
} else {
$closedreason = DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey='closedreason'");
$closedreason = str_replace(':', ':', $closedreason);
showmessage($closedreason ? $closedreason : 'board_closed', NULL, array(), array('login' => 1));
}
}
if (CURSCRIPT != 'admin' && !in_array($this->var['mod'], array('logging', 'seccode'))) {
periodscheck('visitbanperiods');
}
$this->var['tpp'] = $this->var['setting']['topicperpage'] ? intval($this->var['setting']['topicperpage']) : 20;
$this->var['ppp'] = $this->var['setting']['postperpage'] ? intval($this->var['setting']['postperpage']) : 10;
if ($this->var['setting']['nocacheheaders']) {
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
}
if ($this->session->isnew && $this->var['uid']) {
updatecreditbyaction('daylogin', $this->var['uid']);
include_once libfile('function/stat');
updatestat('login', 1);
}
$lastact = TIMESTAMP . "\t" . htmlspecialchars(basename($this->var['PHP_SELF'])) . "\t" . htmlspecialchars($this->var['mod']);
dsetcookie('lastact', $lastact, 86400);
setglobal('currenturl_encode', base64_encode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
if ($this->var['setting']['magicstatus'] && !$this->var['group']['allowmagics']) {
$this->var['setting']['magicstatus'] = false;
$this->var['setting']['magics'] = array();
unset($this->var['setting']['spacenavs']['magic']);
}
if ((!empty($this->var['gp_fromuid']) || !empty($this->var['gp_fromuser'])) && ($this->var['setting']['creditspolicy']['promotion_visit'] || $this->var['setting']['creditspolicy']['promotion_register'])) {
require_once libfile('misc/promotion', 'include');
}
$this->var['seokeywords'] = !empty($this->var['setting']['seokeywords'][CURSCRIPT]) ? $this->var['setting']['seokeywords'][CURSCRIPT] : '';
$this->var['seodescription'] = !empty($this->var['setting']['seodescription'][CURSCRIPT]) ? $this->var['setting']['seodescription'][CURSCRIPT] : '';
}
示例12: _init_misc
function _init_misc()
{
if (!$this->init_misc) {
return false;
}
lang('core');
if ($this->init_setting && $this->init_user) {
if (!isset($this->var['member']['timeoffset']) || $this->var['member']['timeoffset'] == 9999 || $this->var['member']['timeoffset'] === '') {
$this->var['member']['timeoffset'] = !empty($this->var['setting']['timeoffset']) ? $this->var['setting']['timeoffset'] : 8;
}
}
$timeoffset = $this->init_setting ? $this->var['member']['timeoffset'] : $this->var['setting']['timeoffset'];
$this->var['timenow'] = array('time' => dgmdate(TIMESTAMP), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset);
$this->timezone_set($timeoffset);
$this->var['formhash'] = formhash();
define('FORMHASH', $this->var['formhash']);
if ($this->init_user) {
if ($this->var['group'] && isset($this->var['group']['allowvisit']) && !$this->var['group']['allowvisit']) {
if ($this->var['uid']) {
sysmessage('user_banned', null);
} elseif ((!defined('ALLOWGUEST') || !ALLOWGUEST) && !in_array(CURSCRIPT, array('member', 'misc', 'api')) && !$this->var['inajax']) {
dheader('location: member.php?mod=logging&action=login&referer=' . rawurlencode($_SERVER['REQUEST_URI']));
}
}
}
if (!empty($this->var['setting']['ipaccess']) && !ipaccess($this->var['clientip'], $this->var['setting']['ipaccess'])) {
sysmessage('user_banned', null);
}
if (CURSCRIPT != 'admin' && !in_array($this->var['mod'], array('logging', 'seccode'))) {
periodscheck('visitbanperiods');
}
$this->var['tpp'] = !empty($this->var['setting']['topicperpage']) ? intval($this->var['setting']['topicperpage']) : 20;
$this->var['ppp'] = !empty($this->var['setting']['postperpage']) ? intval($this->var['setting']['postperpage']) : 10;
if (!empty($this->var['setting']['nocacheheaders'])) {
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
}
$lastact = TIMESTAMP . "\t" . htmlspecialchars(basename($this->var['PHP_SELF'])) . "\t" . htmlspecialchars($this->var['mod']);
dsetcookie('lastact', $lastact, 86400);
setglobal('currenturl_encode', base64_encode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
}