本文整理汇总了PHP中updatesession函数的典型用法代码示例。如果您正苦于以下问题:PHP updatesession函数的具体用法?PHP updatesession怎么用?PHP updatesession使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatesession函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wapfooter
function wapfooter()
{
global $discuz_uid, $discuz_user, $lang, $action, $settings, $timestamp, $timeoffset, $wapdateformat, $timeformat;
echo "<p>" . gmdate("{$wapdateformat} {$timeformat}", $timestamp + $timeoffset * 3600) . "<br />" . ($action != 'home' ? "<anchor title=\"confirm\"><prev/>{$lang['return']}</anchor> <a href=\"index.php\">{$lang['home_page']}</a><br />" : '') . ($discuz_uid ? "<a href=\"index.php?action=login&logout=yes&formhash=" . FORMHASH . "\">{$discuz_user}:{$lang['logout']}</a>" : "<a href=\"index.php?action=login\">{$lang['login']}</a> <a href=\"index.php?action=register\">{$lang['register']}</a>") . "<br /><br />\n" . "<small>Powered by Discuz!</small></p>\n" . "</card>\n" . "</wml>";
updatesession();
wmloutput();
}
示例2: wapfooter
function wapfooter() {
global $discuz_uid, $discuz_user, $lang, $action, $settings, $timestamp, $timeoffset, $wapdateformat, $timeformat;
echo "<p>".gmdate("$wapdateformat $timeformat", $timestamp + ($timeoffset * 3600))."<br />".
($action != 'home' ? "<anchor title=\"confirm\"><prev/>$lang[return]</anchor> <a href=\"index.php\">$lang[home_page]</a><br />" : '').
($discuz_uid ? "<a href=\"index.php?action=login&logout=yes&formhash=".FORMHASH."\">$discuz_user:$lang[logout]</a>" : "<a href=\"index.php?action=login\">$lang[login]</a> <a href=\"index.php?action=register\">$lang[register]</a>")."<br /><br />\n".
"<small>Powered by Discuz!</small></p>\n".
//"<do type=\"prev\" label=\"$lang[return]\"><exit /></do>\n".
"</card>\n".
"</wml>";
updatesession();
wmloutput();
}
示例3: dsetcookie
}
dsetcookie('onlineusernum', intval($onlinenum), 300);
} else {
$onlinenum = intval($_G['cookie']['onlineusernum']);
}
$onlineinfo[1] = dgmdate($onlineinfo[1], 'd');
$detailstatus = $showoldetails == 'yes' || (!isset($_G['cookie']['onlineindex']) && !$_G['setting']['whosonline_contract'] || $_G['cookie']['onlineindex']) && $onlinenum < 500 && !$showoldetails;
$guestcount = $membercount = 0;
if (!empty($_G['setting']['sessionclose'])) {
$detailstatus = false;
$membercount = C::app()->session->count(1);
$guestcount = $onlinenum - $membercount;
}
if ($detailstatus) {
$actioncode = lang('action');
$_G['uid'] && updatesession();
$whosonline = array();
$_G['setting']['maxonlinelist'] = $_G['setting']['maxonlinelist'] ? $_G['setting']['maxonlinelist'] : 500;
foreach (C::app()->session->fetch_member(1, 0, $_G['setting']['maxonlinelist']) as $online) {
$membercount++;
if ($online['invisible']) {
$invisiblecount++;
continue;
} else {
$online['icon'] = !empty($_G['cache']['onlinelist'][$online['groupid']]) ? $_G['cache']['onlinelist'][$online['groupid']] : $_G['cache']['onlinelist'][0];
}
$online['lastactivity'] = dgmdate($online['lastactivity'], 't');
$whosonline[] = $online;
}
if (isset($_G['cache']['onlinelist'][7]) && $_G['setting']['maxonlinelist'] > $membercount) {
foreach (C::app()->session->fetch_member(2, 0, $_G['setting']['maxonlinelist'] - $membercount) as $online) {
示例4: cpfooter
function cpfooter() {
global $version, $adminid, $db, $tablepre, $action, $bbname, $charset, $timestamp, $isfounder, $insenz;
global $_COOKIE, $_SESSION, $_DCOOKIE, $_DCACHE, $_DSESSION, $_DCACHE, $_DPLUGIN, $sqldebug, $debuginfo;
$infmessage = '';
?>
</td></tr></table>
<br /><br /><div class="footer"><hr size="0" noshade color="<?=BORDERCOLOR?>" width="80%">
Powered by <a href="http://www.discuz.net" target="_blank" style="color: <?=TEXT?>"><b>Discuz!</b> <?=$version?></a> © 2001-2007, <b>
<a href="http://www.comsenz.com" target="_blank" style="color: <?=TEXT?>">Comsenz Inc.</a></b><span class="smalltxt"><?=$infmessage?></span></div>
</body>
</html>
<?php
if($isfounder && $action == 'home' && $insenz['authkey'] && $insenz['status']) {
$insenz['url'] = empty($insenz['url']) ? 'api.insenz.com' : $insenz['url'];
?>
<script src="http://<?=$insenz[url]?>/news.php?id=<?=$insenz[siteid]?>&t=<?=$timestamp?>&k=<?=md5($insenz[authkey].$insenz[siteid].$timestamp.'Discuz!')?>&insenz_version=<?=INSENZ_VERSION?>&discuz_version=<?=DISCUZ_VERSION.' - '.DISCUZ_RELEASE?>&random=<?=random(4)?>" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
if(typeof error_msg != 'undefined') {
if(error_msg != '') {
alert(error_msg);
}
if(title.length || message != '') {
$('insenznews').innerHTML = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'
+ '<tr class="header"><td><?=$lang['insenz_note']?></td></tr><tr><td>'
+ (message ? message : '')
+ (title.length ? '<br /><b><?=$lang['insenz_note_new_campaign']?></b><a href="admincp.php?action=insenz&c_status=2"><font color="red"><u><?=$lang['insenz_note_link_to_go']?></u></font></a>' : '')
+ '</td></tr></table><br />';
}
}
</script>
<?
}
if($adminid == 1 && $action == 'home') {
echo '<sc'.'ript language="Jav'.'aScript" src="ht'.'tp:/'.'/cus'.'tome'.'r.disc'.'uz.n'.'et/n'.'ews'.'.p'.'hp?'.bbsinformation().'"></s'.'cri'.'pt>';
}
updatesession();
}
示例5: if
if($('loginform_<?php echo $loginhash;?>')) {
$('loginform_<?php echo $loginhash;?>').username.focus();
}
<?php if(!$this->setting['autoidselect']) { ?>
simulateSelect('loginfield_<?php echo $loginhash;?>');
<?php } } elseif($seccodecheck && !(empty($_GET['auth']) || $questionexist)) { ?>
if($('loginform_<?php echo $loginhash;?>')) {
safescript('seccodefocus', function() {$('loginform_<?php echo $loginhash;?>').seccodeverify.focus()}, 500, 10);
}
<?php } ?>
}
initinput_login();
<?php if($this->setting['sitemessage']['login']) { ?>
showPrompt('custominfo_login_<?php echo $loginhash;?>', 'mouseover', '<?php echo trim($this->setting['sitemessage']['login'][array_rand($this->setting['sitemessage']['login'])]); ?>', <?php echo $this->setting['sitemessage']['time'];?>);
<?php } ?>
function clearpwd() {
if(pwdclear) {
$('password3_<?php echo $loginhash;?>').value = '';
}
pwdclear = 0;
}
<?php } else { ?>
display('layer_login_<?php echo $loginhash;?>');
display('layer_lostpw_<?php echo $loginhash;?>');
$('lostpw_email').focus();
<?php } ?>
</script><?php updatesession();?><?php if(empty($_GET['infloat'])) { ?>
</div></div></div></div>
</div>
<?php } include template('common/footer'); ?>
示例6: isset
} else {
$filter = '';
}
} else {
$filter = '';
}
isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby={$orderby}" : ($orderby = $_DCACHE['forums'][$fid]['orderby'] ? $_DCACHE['forums'][$fid]['orderby'] : 'lastpost');
isset($ascdesc) && in_array($ascdesc, array('ASC', 'DESC')) ? $forumdisplayadd .= "&ascdesc={$ascdesc}" : ($ascdesc = $_DCACHE['forums'][$fid]['ascdesc'] ? $_DCACHE['forums'][$fid]['ascdesc'] : 'DESC');
$check = array();
$check[$filter] = $check[$orderby] = $check[$ascdesc] = 'selected="selected"';
if ($whosonlinestatus == 2 || $whosonlinestatus == 3) {
$whosonlinestatus = 1;
$onlineinfo = explode("\t", $onlinerecord);
$detailstatus = $showoldetails == 'yes' || (!isset($_DCOOKIE['onlineforum']) && !$whosonline_contract || $_DCOOKIE['onlineforum']) && $onlineinfo[0] < 500 && !$showoldetails;
if ($detailstatus) {
updatesession();
@(include language('actions'));
$whosonline = array();
$forumname = strip_tags($forum['name']);
$guestwhere = isset($_DCACHE['onlinelist'][7]) ? '' : "uid>'0' AND";
$query = $db->query("SELECT uid, groupid, username, invisible, lastactivity, action FROM {$tablepre}sessions WHERE {$guestwhere} fid='{$fid}' AND invisible='0'");
if ($db->num_rows($query)) {
$whosonlinestatus = 1;
while ($online = $db->fetch_array($query)) {
if ($online['uid']) {
$online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
} else {
$online['icon'] = $_DCACHE['onlinelist'][7];
$online['username'] = $_DCACHE['onlinelist']['guest'];
}
$online['action'] = $actioncode[$online['action']];
示例7: updatesettings
if ($onlinenum > $onlineinfo[0]) {
$_DCACHE['settings']['onlinerecord'] = $onlinerecord = "{$onlinenum}\t{$timestamp}";
$db->query("UPDATE {$tablepre}settings SET value='{$onlinerecord}' WHERE variable='onlinerecord'");
require_once DISCUZ_ROOT . './include/cache.func.php';
updatesettings();
$onlineinfo = array($onlinenum, $timestamp);
}
dsetcookie('onlineusernum', intval($onlinenum), 300);
} else {
$onlinenum = intval($_DCOOKIE['onlineusernum']);
}
$onlineinfo[1] = gmdate($dateformat, $onlineinfo[1] + $timeoffset * 3600);
$detailstatus = $showoldetails == 'yes' || (!isset($_DCOOKIE['onlineindex']) && !$whosonline_contract || $_DCOOKIE['onlineindex']) && $onlinenum < 500 && !$showoldetails;
if ($detailstatus) {
@(include language('actions'));
$discuz_uid && updatesession();
$membercount = $invisiblecount = 0;
$whosonline = array();
$maxonlinelist = $maxonlinelist ? $maxonlinelist : 500;
$query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions " . (isset($_DCACHE['onlinelist'][7]) ? '' : 'WHERE uid <> 0') . " ORDER BY uid DESC LIMIT " . $maxonlinelist);
while ($online = $db->fetch_array($query)) {
if ($online['uid']) {
$membercount++;
if ($online['invisible']) {
$invisiblecount++;
continue;
} else {
$online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
}
} else {
$online['icon'] = $_DCACHE['onlinelist'][7];
示例8: if
<? } } } ?></ul>
<? } if(is_array($subnavs)) { foreach($subnavs as $subnav) { ?><?=$subnav?><? } } if($prompts['newbietask'] && $newbietasks) { include template('task_newbie_js', '0', ''); } if($admode && !empty($advlist)) { ?>
<div class="ad_footerbanner" id="ad_footerbanner1"><?=$advlist['footerbanner1']?></div><? if($advlist['footerbanner2']) { ?><div class="ad_footerbanner" id="ad_footerbanner2"><?=$advlist['footerbanner2']?></div><? } if($advlist['footerbanner3']) { ?><div class="ad_footerbanner" id="ad_footerbanner3"><?=$advlist['footerbanner3']?></div><? } } else { ?>
<div id="ad_footerbanner1"></div><div id="ad_footerbanner2"></div><div id="ad_footerbanner3"></div>
<? } ?>
<?=$pluginhooks['global_footer']?>
<div id="footer">
<div class="wrap s_clear">
<div id="footlink">
<p>
<strong><a href="<?=$siteurl?>" target="_blank"><?=$sitename?></a></strong>
<? if($icp) { ?>( <a href="http://www.miibeian.gov.cn/" target="_blank"><?=$icp?></a>)<? } ?>
<span class="pipe">|</span><a href="mailto:<?=$adminemail?>">联系我们</a>
<? if($allowviewstats) { ?><span class="pipe">|</span><a href="stats.php">论坛统计</a><? } if($archiverstatus) { ?><span class="pipe">|</span><a href="archiver/" target="_blank">Archiver</a><? } if($wapstatus) { ?><span class="pipe">|</span><a href="wap/" target="_blank">WAP</a><? } if($statcode) { ?><span class="pipe">| <?=$statcode?></span><? } ?>
<?=$pluginhooks['global_footerlink']?>
</p>
<p class="smalltext">
GMT<?=$timenow['offset']?>, <?=$timenow['time']?>
<? if(debuginfo()) { ?>, <span id="debuginfo">Processed in <?=$debuginfo['time']?> second(s), <?=$debuginfo['queries']?> queries<? if($gzipcompress) { ?>, Gzip enabled<? } ?></span><? } ?>.
</p>
</div>
<div id="rightinfo">
<p>Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em><?=$version?></em><? if(!empty($boardlicensed)) { ?> <a href="http://license.comsenz.com/?pid=1&host=<?=$_SERVER['HTTP_HOST']?>" target="_blank">Licensed</a><? } ?></p>
<p class="smalltext">© 2001-2009 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a></p>
</div><? updatesession(); ?></div>
</div>
<? if($_DCACHE['settings']['frameon'] && in_array(CURSCRIPT, array('index', 'forumdisplay', 'viewthread')) && $_DCOOKIE['frameon'] == 'yes') { ?>
<script src="<?=$jspath?>iframe.js?<?=VERHASH?>" type="text/javascript"></script>
<? } output(); ?></body>
</html>
示例9: cpfooter
//.........这里部分代码省略.........
//$infmessage = '<br /><br /><div class="footer"><hr size="0" noshade color="'.BORDERCOLOR.'" width="80%"><span class="smalltxt"><br />Processed in '.$debuginfo['time'].' second(s), '.$debuginfo[queries].' queries</span></div>';
}
?>
<?php
echo $infmessage;
?>
<?php
echo $sqldebug;
?>
</div>
</body>
<?php
if ($_GET['highlight']) {
echo <<<EOT
<script type="text/JavaScript">
\tfunction parsetag(tag) {
\t\tvar str = document.body.innerHTML.replace(/(^|>)([^<]+)(?=<|\$)/ig, function(\$1, \$2, \$3) {
\t\t\tif(tag && \$3.indexOf(tag) != -1) {
\t\t\t\t\$3 = \$3.replace(tag, '<h_>');
\t\t\t}
\t\t\treturn \$2 + \$3;
\t \t});
\t\tdocument.body.innerHTML = str.replace(/<h_>/ig, function(\$1, \$2) {
\t\t\treturn '<font color="#c60a00">' + tag + '</font>';
\t \t});
\t}
EOT;
$kws = explode(' ', $_GET['highlight']);
foreach ($kws as $kw) {
echo 'parsetag(\'' . $kw . '\');';
}
echo '</script>';
}
?>
</html>
<?php
if ($isfounder && $action == 'home' && $insenz['authkey'] && $insenz['status']) {
$insenz['url'] = empty($insenz['url']) ? 'api.insenz.com' : $insenz['url'];
?>
<script src="http://<?php
echo $insenz[url];
?>
/news.php?id=<?php
echo $insenz[siteid];
?>
&t=<?php
echo $timestamp;
?>
&k=<?php
echo md5($insenz[authkey] . $insenz[siteid] . $timestamp . 'Discuz!');
?>
&insenz_version=<?php
echo INSENZ_VERSION;
?>
&discuz_version=<?php
echo DISCUZ_VERSION . ' - ' . DISCUZ_RELEASE;
?>
&random=<?php
echo random(4);
?>
" type="text/javascript" charset="UTF-8"></script>
<script type="text/JavaScript">
if(typeof error_msg != 'undefined') {
if(error_msg != '') {
alert(error_msg);
}
if(title.length || message != '') {
$('insenznews').innerHTML = '<table class="tb tb2 nobdb fixpadding">'
+ '<tr><th class="partition"><?php
echo lang('insenz_note');
?>
</th></tr><tr><td>'
+ (message ? message : '')
+ (title.length ? '<br /><b><?php
echo lang('insenz_note_new_campaign');
?>
</b><a href="<?php
echo $BASESCRIPT;
?>
?action=insenz&c_status=2"><font color="red"><u><?php
echo lang('insenz_note_link_to_go');
?>
</u></font></a>' : '')
+ '</td></tr></table>';
}
}
</script>
<?php
}
if ($adminid == 1 && $action == 'home') {
echo '<sc' . 'ript language="Jav' . 'aScript" src="ht' . 'tp:/' . '/cus' . 'tome' . 'r.disc' . 'uz.n' . 'et/n' . 'ews' . '.p' . 'hp?' . bbsinformation() . '"></s' . 'cri' . 'pt>';
//echo '<sc'.'ript language="Jav'.'aScript" src="http://localhost/com/n'.'ews'.'.p'.'hp?'.bbsinformation().'"></script>';
}
updatesession();
}
示例10: showmessage
function showmessage($message, $url_forward = '', $extra = '', $forwardtype = 0)
{
extract($GLOBALS, EXTR_SKIP);
global $hookscriptmessage, $extrahead, $discuz_uid, $discuz_action, $debuginfo, $seccode, $seccodestatus, $fid, $tid, $charset, $show_message, $inajax, $_DCACHE, $advlist;
define('CACHE_FORBIDDEN', TRUE);
$hookscriptmessage = $show_message = $message;
$messagehandle = 0;
$msgforward = unserialize($_DCACHE['settings']['msgforward']);
$refreshtime = intval($msgforward['refreshtime']);
$refreshtime = empty($forwardtype) ? $refreshtime : ($refreshtime ? $refreshtime : 3);
$msgforward['refreshtime'] = $refreshtime * 1000;
$url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);
$seccodecheck = $seccodestatus & 2;
if ($_DCACHE['settings']['funcsiteid'] && $_DCACHE['settings']['funckey'] && $funcstatinfo && !IS_ROBOT) {
$statlogfile = DISCUZ_ROOT . './forumdata/funcstat.log';
if ($fp = @fopen($statlogfile, 'a')) {
@flock($fp, 2);
if (is_array($funcstatinfo)) {
$funcstatinfo = array_unique($funcstatinfo);
foreach ($funcstatinfo as $funcinfo) {
fwrite($fp, funcstat_query($funcinfo, $message) . "\n");
}
} else {
fwrite($fp, funcstat_query($funcstatinfo, $message) . "\n");
}
fclose($fp);
$funcstatinfo = $GLOBALS['funcstatinfo'] = '';
}
}
if (!defined('STAT_DISABLED') && STAT_ID > 0 && !IS_ROBOT) {
write_statlog($message);
}
if ($url_forward && (!empty($quickforward) || empty($inajax) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages']))) {
updatesession();
dheader("location: " . str_replace('&', '&', $url_forward));
}
if (!empty($infloat)) {
if ($extra) {
$messagehandle = $extra;
}
$extra = '';
}
if (in_array($extra, array('HALTED', 'NOPERM'))) {
$discuz_action = 254;
} else {
$discuz_action = 255;
}
include language('messages');
$vars = explode(':', $message);
if (count($vars) == 2 && isset($scriptlang[$vars[0]][$vars[1]])) {
eval("\$show_message = \"" . str_replace('"', '\\"', $scriptlang[$vars[0]][$vars[1]]) . "\";");
} elseif (isset($language[$message])) {
$pre = $inajax ? 'ajax_' : '';
eval("\$show_message = \"" . (isset($language[$pre . $message]) ? $language[$pre . $message] : $language[$message]) . "\";");
unset($pre);
}
if (empty($infloat)) {
$show_message .= $url_forward && empty($inajax) ? '<script>setTimeout("window.location.href =\'' . $url_forward . '\';", ' . $msgforward['refreshtime'] . ');</script>' : '';
} elseif ($handlekey) {
$show_message = str_replace("'", "\\'", $show_message);
if ($url_forward) {
$show_message = "<script type=\"text/javascript\" reload=\"1\">\nif(\$('return_{$handlekey}')) \$('return_{$handlekey}').className = 'onright';\nif(typeof submithandle_{$handlekey} =='function') {submithandle_{$handlekey}('{$url_forward}', '{$show_message}');} else {location.href='{$url_forward}'}\n</script>";
} else {
$show_message .= "<script type=\"text/javascript\" reload=\"1\">\nif(typeof messagehandle_{$handlekey} =='function') {messagehandle_{$handlekey}('{$messagehandle}', '{$show_message}');}\n</script>";
}
}
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') {
include template('nopermission');
} else {
include template('showmessage');
}
dexit();
}
示例11: submitcheck
function submitcheck($var, $cp = 0)
{
if (empty($GLOBALS[$var])) {
return false;
} else {
if ($cp) {
$msgfunc = 'redirect';
} else {
$msgfunc = 'message';
}
global $options, $seccode;
if ($_SERVER['REQUEST_METHOD'] == 'POST' && (empty($_SERVER['HTTP_REFERER']) || $GLOBALS['formhash'] != formhash() || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) !== preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))) {
$msgfunc('您的请求来路不正确,无法提交.');
} else {
if ($options['seccode']) {
$clientcode = $GLOBALS['clientcode'];
if (!$clientcode || strtolower($clientcode) != strtolower($seccode)) {
$seccode = random(6, 1);
updatesession();
$msgfunc('验证码错误,请返回重新输入.', $referer);
}
}
return true;
}
}
}
示例12: customExecuteUser
function customExecuteUser($logins)
{
global $db, $tablepre, $timestamp, $onlineip, $initcredits, $cookietime;
global $customCookie, $customSetting;
$users = json_decode($logins, true);
if (!is_array($users)) {
return;
}
$idstring = random(6);
$secques = random(8);
$authstr = $regverify == 1 ? "{$timestamp}\t2\t{$idstring}" : '';
$uid = 0;
if ($users['resHeader']['flag'] == '1' && isset($users['resBody']['userInfo']['id'])) {
$userInfo = $users['resBody']['userInfo'];
$randPassword = rand(10000000, 99999999) . rand(10000000, 99999999) . rand(10000000, 99999999) . rand(10000000, 99999999);
$username = $userInfo['nickName'] == '' ? ' ' : mysql_escape_string($userInfo['nickName']);
//通过用户ID查询是否在论坛注册
if (isset($users['resBody']['userInfo']['id'])) {
$row = $db->fetch_first("select uid from {$tablepre}members where c_id='" . $userInfo['id'] . "'");
}
if (!$row) {
//$uid = uc_user_register($username, $randPassword, "", "0", "", $onlineip);
$salt = substr(uniqid(rand()), -6);
$password = md5(md5($password) . $salt);
$db->query("INSERT INTO {$tablepre}uc_members SET secques='', username='{$username}', password='" . md5(md5($password) . $salt) . "', email='{$email}', regip='{$onlineip}', regdate='" . time() . "', salt='{$salt}'");
$uid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}uc_memberfields SET uid='{$uid}'");
$idstring = random(6);
$secques = '';
$authstr = $regverify == 1 ? "{$timestamp}\t2\t{$idstring}" : '';
$password = md5(random(10));
$groupid = 10;
$score = $userInfo['score'];
$ub = $userInfo['ubScore'];
$email = $userInfo['email'];
$db->query("INSERT INTO {$tablepre}members \r\n\t\t\t\t(uid, username, password, secques, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, showemail, timeoffset, pmsound, invisible, newsletter,c_terminalid,c_id)\r\n\t\t\t\tVALUES ('{$uid}', '{$username}', '{$password}', '{$secques}', '0', '{$groupid}', '{$onlineip}', '{$timestamp}', '{$timestamp}', '{$timestamp}', '0', '0','0','0','0','0','0','0','0','0' , '{$email}', '0', '9999', '1', '0', '1','" . $userInfo['terminalId'] . "','" . $userInfo['id'] . "')");
$db->query("UPDATE {$tablepre}members SET\r\n\t\t\t\tc_areacode = '{$userInfo['areaCode']}', \r\n\t\t\t\tbday = '" . ($userInfo['birthday'] == '' ? '0000-00-00' : $userInfo['birthday']) . "',\r\n\t\t\t\tc_commentcnt = '{$userInfo['commentCnt']}', \r\n\t\t\t\tc_customid = '" . $userInfo['customId'] . "', \r\n\t\t\t\tc_customuser = '" . ($userInfo['customUser'] ? 1 : 0) . "',\r\n\t\t\t\tc_effect = '" . intval($userInfo['effect']) . "', \r\n\t\t\t\tc_forever = '" . ($userInfo['forever'] ? 1 : 0) . "', \r\n\t\t\t\tc_mark = '" . $userInfo['mark'] . "', \r\n\t\t\t\tc_opened = '" . intval($userInfo['opened']) . "', \r\n\t\t\t\tc_operatorcode = '" . $userInfo['operatorCode'] . "',\r\n\t\t\t\tc_regTime = '" . $userInfo['regTime'] . "', \r\n\t\t\t\tc_score = '" . $userInfo['score'] . "', \r\n\t\t\t\tc_sex = '" . $userInfo['sex'] . "',\r\n\t\t\t\tc_signature = '" . $userInfo['signature'] . "',\r\n\t\t\t\tc_status = '" . $userInfo['status'] . "', \r\n\t\t\t\tc_terminalid = '" . $userInfo['terminalId'] . "',\r\n\t\t\t\tc_id = '" . $userInfo['id'] . "', \r\n\t\t\t\tc_updatetime = '" . $userInfo['updateTime'] . "',\r\n\t\t\t\tc_userphoto = '" . $userInfo['userPhoto'] . "'\r\n\t\t\t\t" . ($customSetting['field']['score'] != '' ? ", " . $customSetting['field']['score'] . " = '" . intval($userInfo['score']) . "'" : "") . "\r\n\t\t\t\t" . ($customSetting['field']['ub'] != '' ? ", " . $customSetting['field']['ub'] . " = '" . intval($userInfo['ubScore']) . "'" : "") . "\r\n\t\t\tWHERE uid = '{$uid}'\r\n\t\t\t");
$db->query("REPLACE INTO {$tablepre}memberfields (uid, nickName, qq) VALUES ('{$uid}', '" . mysql_escape_string($userInfo['nickName']) . "','" . mysql_escape_string($userInfo['qq']) . "')");
//require_once DISCUZ_ROOT.'./include/cache.func.php';
//$_DCACHE['settings']['totalmembers']++;
//updatesettings();
//manyoulog('user', $discuz_uid, 'add');
} else {
$uid = $row['uid'];
}
//clearcookies();
$db->query("UPDATE {$tablepre}members SET\r\n\t\t\t\tusername = '{$username}',\r\n\t\t\t\tpassword = '" . md5(random(10)) . "',\r\n\t\t\t\tc_areacode = '{$userInfo['areaCode']}', \r\n\t\t\t\tbday = '" . ($userInfo['birthday'] == '' ? '0000-00-00' : $userInfo['birthday']) . "',\r\n\t\t\t\tc_commentcnt = '{$userInfo['commentCnt']}', \r\n\t\t\t\tc_customid = '" . intval($userInfo['customId']) . "', \r\n\t\t\t\tc_customuser = '" . ($userInfo['customUser'] ? 1 : 0) . "',\r\n\t\t\t\tc_effect = '" . intval($userInfo['effect']) . "', \r\n\t\t\t\tc_forever = '" . ($userInfo['forever'] ? 1 : 0) . "', \r\n\t\t\t\tc_mark = '" . $userInfo['mark'] . "', \r\n\t\t\t\tc_opened = '" . intval($userInfo['opened']) . "', \r\n\t\t\t\tc_operatorcode = '" . $userInfo['operatorCode'] . "',\r\n\t\t\t\tc_regTime = '" . $userInfo['regTime'] . "', \r\n\t\t\t\tc_score = '" . $userInfo['score'] . "', \r\n\t\t\t\tc_sex = '" . $userInfo['sex'] . "',\r\n\t\t\t\tc_signature = '" . $userInfo['signature'] . "',\r\n\t\t\t\tc_status = '" . $userInfo['status'] . "', \r\n\t\t\t\tc_terminalid = '" . $userInfo['terminalId'] . "', \r\n\t\t\t\tc_id = '" . $userInfo['id'] . "', \r\n\t\t\t\tc_updatetime = '" . $userInfo['updateTime'] . "',\r\n\t\t\t\tc_userphoto = '" . $userInfo['userPhoto'] . "'\r\n\t\t\t\t" . ($customSetting['field']['score'] != '' ? ", " . $customSetting['field']['score'] . " = '" . intval($userInfo['score']) . "'" : "") . "\r\n\t\t\t\t" . ($customSetting['field']['ub'] != '' ? ", " . $customSetting['field']['ub'] . " = '" . intval($userInfo['ubScore']) . "'" : "") . "\r\n\t\t\tWHERE uid = '{$uid}'\r\n\t\t\t");
$db->query("REPLACE INTO {$tablepre}memberfields (uid, authstr, nickName, qq) VALUES ('{$uid}', '{$authstr}', '" . mysql_escape_string($userInfo['nickName']) . "','" . mysql_escape_string($userInfo['qq']) . "')");
/********************************
模拟登录
*/
//echo $uid;
//exit;
$uid = $uid > 0 ? $uid : $row['uid'];
$salt = random(6);
$db->query("UPDATE {$tablepre}uc_members SET password = '" . MD5($userInfo['userPass'] . $salt) . "', salt = '" . $salt . "' WHERE uid = {$uid}");
$member = $db->fetch_first("SELECT m.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques,\r\n\t\tm.email, m.adminid, m.groupid, m.styleid, m.lastvisit, m.lastpost, u.allowinvisible\r\n\t\tFROM {$tablepre}members m LEFT JOIN {$tablepre}usergroups u USING (groupid)\r\n\t\tWHERE m.uid='{$uid}'");
$member['discuz_userss'] = $member['discuz_user'];
$member['discuz_user'] = addslashes($member['discuz_user']);
foreach ($member as $var => $value) {
$GLOBALS[$var] = $value;
}
if (empty($member['discuz_secques'])) {
$member['discuz_secques'] = random(8);
$GLOBALS['discuz_secques'] = $member['discuz_secques'];
$db->query("UPDATE {$tablepre}members SET secques='{$GLOBALS['discuz_secques']}' WHERE uid='{$uid}'");
}
$cookietime = intval(isset($_POST['cookietime']) ? $_POST['cookietime'] : 0);
//customSetCookie(array($customCookie['ticket'] => $users['ticket']));
/*
customSetCookie(array(
'bkO_auth' => authcode("$member[discuz_pw]\t$member[discuz_secques]\t$member[discuz_uid]"."\t". $users['ticket']."\t". $userInfo['version'], 'ENCODE'),
));
*/
dsetcookie('cookietime', $cookietime, 31536000);
dsetcookie('auth', authcode("{$member['discuz_pw']}\t{$member['discuz_secques']}\t{$member['discuz_uid']}" . "\t" . $users['ticket'] . "\t" . $userInfo['version'], 'ENCODE'), $cookietime, 1, true);
dsetcookie('loginuser');
dsetcookie('activationauth');
dsetcookie('pmnum');
$GLOBALS['sessionexists'] = 0;
updatesession();
//会话内容:$discuz_pw, $discuz_secques, $discuz_uid, $discuz_ticket
//dsetcookie('auth', authcode("\t\t$uid\t". $unm ."\t".$groupid."\t". $_COOKIE[$customCookie['ticket']], 'ENCODE'), $cookietime, 1, true);
//list($discuz_pw, $discuz_secques, $discuz_uid) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);
//echo str_repeat("#",10)."".$member[discuz_pw].','.$member[discuz_secques].','.$member[discuz_uid]."<br>";
/*
模拟登录
********************************/
//写ticket
//customSetCookie(array($customCookie['ticket']=>$userInfo['ticket']),false);
//由于COOKIE需要刷新后生效,所以这里如果登录成功了,则将当前页面重新进行转向
//echo "<hr>".$row[uid]."<br>".$_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']!=''?'?'.$_SERVER['QUERY_STRING']:'')."<hr>";
$selfURL = $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '');
//.'&'. random(15) :''.'?'. random(15));
//$selfURL = trim($_REQUEST['redirect']) == '' ? "./" : $_REQUEST['redirect'];
//echo "#". $userInfo['terminalId'] ."#".$row['uid']."#". $userInfo['terminalId'] ."#".$member[discuz_uid]."##";
//exit;
//echo "<script>window.location.href='$selfURL'</script>";
//echo $selfURL.",".random(15)."<br>";
//exit;
//.........这里部分代码省略.........
示例13: cpfooter
function cpfooter()
{
global $version, $adminid, $db, $tablepre, $action, $bbname, $charset, $timestamp, $isfounder, $dbcharset;
?>
</div>
</body>
<?php
if ($_GET['highlight']) {
$kws = explode(' ', $_GET['highlight']);
echo '<script type="text/JavaScript">';
foreach ($kws as $kw) {
echo 'parsetag(\'' . $kw . '\');';
}
echo '</script>';
}
?>
</html>
<?php
if ($adminid == 1 && $action == 'home') {
echo '<img src="admincp.php?action=misc&operation=checkstat" width="0" height="0">';
$newsurl = 'ht' . 'tp:/' . '/cus' . 'tome' . 'r.disc' . 'uz.n' . 'et/n' . 'ews' . '.p' . 'hp?' . bbsinformation();
//$newsurl = 'http://localhost/com/n'.'ews'.'.p'.'hp?'.bbsinformation();
?>
<script type="text/javascript">
var newhtml = '';
newhtml += '<table class="tb tb2"><tr><th class="partition edited">您当前使用的 Discuz! 程序版本有重要更新,请参照以下提示进行及时升级</th></tr>';
newhtml += '<tr><td class="tipsblock"><a href="http://faq.comsenz.com/checkversion.php?product=Discuz&version=<?php
echo DISCUZ_VERSION;
?>
&release=<?php
echo DISCUZ_RELEASE;
?>
&charset=<?php
echo $charset;
?>
&dbcharset=<?php
echo $dbcharset;
?>
" target="_blank"><img src="<?php
echo $newsurl;
?>
" onload="shownews()" /></a></td></tr></table>';
$('boardnews').style.display = 'none';
$('boardnews').innerHTML = newhtml;
function shownews() {
$('boardnews').style.display = '';
}
</script>
<?php
}
updatesession();
}
示例14: showmessage
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();
}
示例15: adshow
<?php } ?><?php echo adshow("footerbanner/wp a_f/1");?><?php echo adshow("footerbanner/wp a_f/2");?><?php echo adshow("footerbanner/wp a_f/3");?><?php echo adshow("float/a_fl/1");?><?php echo adshow("float/a_fr/2");?><?php echo adshow("couplebanner/a_fl a_cb/1");?><?php echo adshow("couplebanner/a_fr a_cb/2");?><?php echo adshow("cornerbanner/a_cn");?><?php if(!empty($_G['setting']['pluginhooks']['global_footer'])) echo $_G['setting']['pluginhooks']['global_footer'];?>
<div id="ft" class="top_ft"> </div>
<div class="footer">
<div class="footerinner"><?php if(is_array($_G['setting']['footernavs'])) foreach($_G['setting']['footernavs'] as $nav) { if($nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||
!$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile' || $nav['id'] == 'darkroom'))) { ?><?php echo $nav['code'];?><span class="pipe"></span><?php } } ?>
<?php if(!empty($_G['setting']['pluginhooks']['global_footerlink'])) echo $_G['setting']['pluginhooks']['global_footerlink'];?>
<?php if($_G['setting']['statcode']) { ?><i style="display:none;"><?php echo $_G['setting']['statcode'];?></i><?php } ?>
<?php if($_G['setting']['site_qq']) { ?><a href="http://wpa.qq.com/msgrd?V=3&Uin=<?php echo $_G['setting']['site_qq'];?>&Site=<?php echo $_G['setting']['bbname'];?>&Menu=yes&from=discuz" target="_blank" title="QQ"><img src="<?php echo IMGDIR;?>/site_qq.jpg" alt="QQ"/></a><span class="pipe"></span><?php } ?>
<div style="clear:both"></div>
<p class="copyright">Copyright © 2014 <?php if($_G['setting']['icp']) { ?>( <?php echo $_G['setting']['icp'];?> )<?php } ?></p>
<p class="powered">Powered by <a href="http://www.discuz.net" target="_blank">Discuz!</a> <em><?php echo $_G['setting']['version'];?></em><?php if(!empty($_G['setting']['boardlicensed'])) { ?> <a href="http://license.comsenz.com/?pid=1&host=<?php echo $_SERVER['HTTP_HOST'];?>" target="_blank">Licensed</a><?php } ?></p>
<span class="slogan"><?php echo $_G['setting']['sitename'];?></span>
</div><?php updatesession();?><?php if($_G['uid'] && $_G['group']['allowinvisible']) { ?>
<script type="text/javascript">
var invisiblestatus = '<?php if($_G['session']['invisible']) { ?>隐身<?php } else { ?>在线<?php } ?>';
var loginstatusobj = $('loginstatusid');
if(loginstatusobj != undefined && loginstatusobj != null) loginstatusobj.innerHTML = invisiblestatus;
</script>
<?php } ?>
</div>
<?php } if(!$_G['setting']['bbclosed'] && !$_G['member']['freeze'] && !$_G['member']['groupexpiry']) { if($_G['uid'] && !isset($_G['cookie']['checkpm'])) { ?>
<script src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if($_G['uid'] && helper_access::check_module('follow') && !isset($_G['cookie']['checkfollow'])) { ?>
<script src="home.php?mod=spacecp&ac=follow&op=checkfeed&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if(!isset($_G['cookie']['sendmail'])) { ?>
<script src="home.php?mod=misc&ac=sendmail&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !isset($_G['cookie']['checkpatch'])) { ?>
<script src="misc.php?mod=patch&action=checkpatch&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>