function clearcookie() { global $_SGLOBAL; obclean(); ssetcookie('auth', '', -86400 * 365); $_SGLOBAL['supe_uid'] = 0; $_SGLOBAL['supe_username'] = ''; $_SGLOBAL['member'] = array(); }
function freshcookie($itemid) { global $_SC, $_SGLOBAL; $isupdate = 1; $old = empty($_COOKIE[$_SC['cookiepre'] . 'supe_refresh_items']) ? 0 : trim($_COOKIE[$_SC['cookiepre'] . 'supe_refresh_items']); $itemidarr = explode('_', $old); if (in_array($itemid, $itemidarr)) { $isupdate = 0; } else { $itemidarr[] = trim($itemid); ssetcookie('supe_refresh_items', implode('_', $itemidarr)); } if (empty($_COOKIE)) { $isupdate = 0; } return $isupdate; }
function wz_checkauth($wxid, $token, $mid, $op_wxid) { global $_SGLOBAL; if ($_COOKIE['site_auth']) { @(list($password, $token_id) = explode(" ", authcode($_COOKIE['site_auth'], 'DECODE'))); $_SGLOBAL['supe_token_id'] = intval($token_id); if ($password && $_SGLOBAL['supe_token_id']) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_session") . " WHERE token_id=" . $_SGLOBAL['supe_token_id']); if ($session = $_SGLOBAL['db']->fetch_array($query)) { if ($session['password'] == $password) { $token_mid = $_SGLOBAL['db']->getone('select mid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']); $token_op_wxid = $_SGLOBAL['db']->getone('select op_wxid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']); if ($token_mid == $mid && $token_op_wxid == $op_wxid) { updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $session['wxid'], 'mid' => $mid, 'op_wxid' => $op_wxid)); $_SGLOBAL['supe_wxid'] = addslashes($session['wxid']); wz_insertsession($session); //更新session return $_SGLOBAL['supe_token_id']; } } } } } $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_token") . " WHERE wxid='" . $wxid . "' and mid=" . $mid . " and op_wxid=" . $op_wxid . " and state=0"); if ($wz = $_SGLOBAL['db']->fetch_array($query)) { if ($wz['token'] == $token) { updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $wxid, 'mid' => $mid, 'op_wxid' => $op_wxid)); $_SGLOBAL['supe_wxid'] = addslashes($wz['wxid']); $session = array('token_id' => $wz['id'], 'wxid' => $_SGLOBAL['supe_wxid'], 'password' => $token); wz_insertsession($session); //登录 $cookietime = 3600; //3600 * 24 * 15; //设置cookie ssetcookie('site_auth', authcode($session["password"] . ' ' . $session["token_id"], 'ENCODE'), $cookietime); $_SGLOBAL['supe_token_id'] = $session['token_id']; return $_SGLOBAL['supe_token_id']; } } obclean(); ssetcookie('site_auth', '', -86400 * 365); return 0; }
updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid)); updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid)); //更新默认用户好友缓存 include_once S_ROOT . './source/function_cp.php'; foreach ($fuids as $fuid) { friend_cache($fuid); } } } } //在线session insertsession($setarr); //设置cookie ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000); ssetcookie('loginuser', $username, 31536000); ssetcookie('_refer', ''); //好友邀请 if ($invitearr) { include_once S_ROOT . './source/function_cp.php'; invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app); //如果提交的邮箱地址与邀请相符的则直接通过邮箱验证 if ($invitearr['email'] == $email) { updatetable('spacefield', array('emailcheck' => 1), array('uid' => $newuid)); } //统计更新 include_once S_ROOT . './source/function_cp.php'; if ($app) { updatestat('appinvite'); } else { updatestat('invite'); }
realname_set($value['vuid'], $value['vusername']); } $value['isfriend'] = 0; if ($space['friends'] && in_array($value['vuid'], $space['friends'])) { $value['isfriend'] = 1; } $oluids[$value['vuid']] = $value['vuid']; $visitorlist[$value['vuid']] = $value; } //애ᅫᅧᅪᄈ터 $viewuids = $_SCOOKIE['viewuids'] ? explode('_', $_SCOOKIE['viewuids']) : array(); if ($_SGLOBAL['supe_uid'] && !$space['self'] && !in_array($space['uid'], $viewuids)) { $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET viewnum=viewnum+1 WHERE uid='{$space['uid']}'"); //애ᅨ까 $viewuids[$space['uid']] = $space['uid']; ssetcookie('viewuids', implode('_', $viewuids)); } //ᅰᅱᄒ $bloglist = array(); if ($_SGLOBAL['mygroupid'] == 3 || $space['blognum'] && ckprivacy('blog')) { $query = $_SGLOBAL['db']->query("SELECT b.uid, b.blogid, b.subject, b.dateline, b.pic, b.picflag, b.viewnum, b.replynum, b.friend, b.password, bf.message, bf.target_ids\r\n\t\tFROM " . tname('blog') . " b\r\n\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\tWHERE b.uid='{$space['uid']}'\r\n\t\tORDER BY b.weight DESC, b.dateline DESC LIMIT 0,5"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) { if ($value['pic']) { $value['pic'] = pic_cover_get($value['pic'], $value['picflag']); } $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1); $bloglist[] = $value; } } $blognum = count($bloglist);
if ($multi_mode) { $c_sql = "SELECT COUNT(*) FROM " . tname('space'); } else { $count = 100; $cache_file = S_ROOT . './data/cache_top_viewnum.txt'; } $sql = "SELECT main.*, field.* FROM " . tname('space') . " main\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.viewnum DESC"; //我的位置 $cookie_name = 'space_top_' . $_GET['view']; if ($_SCOOKIE[$cookie_name]) { $now_pos = $_SCOOKIE[$cookie_name]; } else { $pos_sql = "SELECT COUNT(*) FROM " . tname('space') . " s WHERE s.viewnum>'{$space['viewnum']}'"; $now_pos = $_SGLOBAL['db']->result($_SGLOBAL['db']->query($pos_sql), 0); $now_pos++; ssetcookie($cookie_name, $now_pos); } } elseif ($_GET['view'] == 'online') { $c_sql = "SELECT COUNT(*) FROM " . tname('session'); $sql = "SELECT field.*, space.*, main.*\r\n\t\tFROM " . tname('session') . " main USE INDEX (lastactivity)\r\n\t\tLEFT JOIN " . tname('space') . " space ON space.uid=main.uid\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.lastactivity DESC"; $now_pos = -1; } elseif ($_GET['view'] == 'updatetime') { $c_sql = "SELECT COUNT(*) FROM " . tname('space'); $sql = "SELECT main.*, field.* FROM " . tname('space') . " main USE INDEX (updatetime)\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.updatetime DESC"; $now_pos = -1; } $list = array(); if (empty($count)) { $cache_mode = false; $count = empty($_SCONFIG['networkpage']) ? 1 : $_SGLOBAL['db']->result($_SGLOBAL['db']->query($c_sql), 0); $multi = multi($count, $perpage, $page, "space.php?do=top&view={$_GET['view']}");
function synlogin($get, $post) { global $_SGLOBAL; if (!API_SYNLOGIN) { return API_RETURN_FORBIDDEN; } //note 同步登录 API 接口 obclean(); header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); $cookietime = 31536000; $uid = intval($get['uid']); $query = $_SGLOBAL['db']->query("SELECT uid, username, password FROM " . tname('member') . " WHERE uid='{$uid}'"); if ($member = $_SGLOBAL['db']->fetch_array($query)) { include_once S_ROOT . './source/function_space.php'; $member = saddslashes($member); $space = insertsession($member); //设置cookie ssetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime); } ssetcookie('loginuser', $get['username'], $cookietime); }
if ($mname == 'shop' && $_GET['action'] == 'edit' && empty($_POST['valuesubmit']) && empty($_GET['op'])) { if (!empty($_GET['itemid'])) { ssetcookie('shopid', $_GET['itemid'], 3600 * 10); getpanelinfo($_GET['itemid']); if (!empty($_G['cookie']['i_referer'])) { header('Location: ' . $_G['cookie']['i_referer']); } } elseif (!empty($_G['cookie']['shopid'])) { getpanelinfo(intval($_G['cookie']['shopid'])); } if (!empty($_SGLOBAL['panelinfo'])) { echo '<script type="text/javascript" charset="' . $_G['charset'] . '">var leftmenu = $(window.parent.document).find("#leftmenu");leftmenu.find("ul").css("display", "none");$(window.parent.document).find("#menu_paneladd").css("display", "");</script>'; } } elseif (in_array($mname, array('good', 'notice', 'album', 'consume', 'groupbuy')) && $_GET['shopid']) { getpanelinfo($_GET['shopid']); ssetcookie('shopid', $_GET['shopid'], 3600 * 10); } if (!ckfounder($_G['uid'])) { if (!check_itemaccess($_GET['itemid'], $mname)) { cpmsg('no_' . $mname . '_itemaccess', 'admin.php?action=list&m=' . $mname); } } if (empty($_SGLOBAL['panelinfo']) && !empty($_REQUEST['shopid'])) { getpanelinfo($_REQUEST['shopid']); } if (!empty($_POST['valuesubmit'])) { $checkresults = array(); if ($mname == "notice" || $mname == "shop") { //標題樣式 empty($_POST['strongsubject']) ? $_POST['strongsubject'] = '' : ($_POST['strongsubject'] = 1); empty($_POST['underlinesubject']) ? $_POST['underlinesubject'] = '' : ($_POST['underlinesubject'] = 1);
realname_set($value['authorid'], $value['author']); //实名 $value['message'] = strip_tags($value['message']); //剥去字符串中的 HTML 标签 $value['avatar_url'] = avatar($value['authorid'], 'middle', TRUE); $list[] = $value; } } //分页 $multi = multi($count, $perpage, $page, "space.php?uid={$bwzt['uid']}&do={$do}&id={$id}", '', 'content'); //访问统计 if (!$space['self'] && $_SCOOKIE['view_bwztid'] != $bwzt['bwztid']) { $_SGLOBAL['db']->query("UPDATE " . tname('bwzt') . " SET viewnum=viewnum+1 WHERE bwztid='{$bwzt['bwztid']}'"); inserttable('log', array('id' => $space['uid'], 'idtype' => 'uid')); //延迟更新 ssetcookie('view_bwztid', $bwzt['bwztid']); } //表态 $hash = md5($bwzt['uid'] . "\t" . $bwzt['dateline']); $id = $bwzt['bwztid']; $idtype = 'bwztid'; foreach ($clicks as $key => $value) { $value['clicknum'] = $bwzt["click_{$key}"]; $value['bwztclassid'] = mt_rand(1, 4); $value['bwztdivisionid'] = mt_rand(1, 4); if ($value['clicknum'] > $maxclicknum) { $maxclicknum = $value['clicknum']; } $clicks[$key] = $value; } //点评
END; } } } else { $pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0; if ($pid && $avatarfeedstr && $updatetime < 86400) { //验证用户是否有更新 $prelength = strlen($_SC['cookiepre']); foreach ($_COOKIE as $key => $val) { if (substr($key, 0, $prelength) == $_SC['cookiepre']) { $_SCOOKIE[substr($key, $prelength)] = empty($magic_quote) ? saddslashes($val) : $val; } } if (!isset($_SCOOKIE['viewuserid']) || !in_array($updateuid, explode(',', $_SCOOKIE['viewuserid']))) { $_SCOOKIE['viewuserid'] = empty($_SCOOKIE['viewuserid']) ? $updateuid : $_SCOOKIE['viewuserid'] . ",{$updateuid}"; ssetcookie('viewuserid', $_SCOOKIE['viewuserid'], $_SGLOBAL['timestamp'] + 43200); if (!empty($_GET['plugin'])) { print <<<END \$('authorfeed').innerHTML = '<span id="authornewfeed" onmouseover="showMenu(this.id);">有新动态</span>'; \$('authornewfeed_menu').innerHTML = '<div>{$avatarfeedstr}</div>'; END; } else { print <<<END var authorPostonObj = \$('authorposton{$pid}'); if(authorPostonObj != null && typeof authorPostonObj == 'object') { \tvar oSpan = document.createElement("span"); \toSpan.id = "authornewfeed" \toSpan.innerHTML = "有新动态"; \toSpan.onmouseover = function(){showMenu(this.id);} \tauthorPostonObj.parentNode.insertBefore(oSpan, authorPostonObj); }
echo "<br />"; echo "$filenameandpath"; echo "<br />"; echo "$filename"; echo "<br />"; */ /* $IAUTH_SERVER_ROOT=substr(dirname(__FILE__),0,8); */ /* echo $IAUTH_SERVER_ROOT; */ /* chdir($IAUTH_SERVER_ROOT); */ /* print_r($_SERVER); */ /* chdir(dirname(__FILE__).'../../'); */ /* chdir("../../"); */ /* echo getcwd(); */ //include_once('common.php'); /* exit(); */ //header("location: ../../index.php"); //showmessage('aa'); //使用location函数比较难跳回来,或者是传些参数去用户客户端吧 include_once $_SERVER['DOCUMENT_ROOT'] . '/common.php'; /* //是否关闭站点 checkclose(); */ //简化supe_uid $uid = $_SGLOBAL['supe_uid']; //如果存在,则跳转到之前的那个文件 if (!$uid) { ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI'])); showmessage('to_login', 'http://' . $_SERVER['SERVER_NAME'] . '/do.php?ac=' . $_SCONFIG['login_action'], 0); } /* chdir(dirname(__FILE__)); */
showmessage('magicuse_bad_object'); } elseif ($value['author'] == '') { showmessage('magicuse_object_once_limit'); } } else { $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('clickuser') . " WHERE id = '{$id}' AND idtype = '{$idtype}' AND uid = '{$_SGLOBAL['supe_uid']}'"); $value = $_SGLOBAL['db']->fetch_array($query); if (empty($value)) { showmessage('magicuse_bad_object'); } elseif ($value['username'] == '') { showmessage('magicuse_object_once_limit'); } } //匿名卡 if (submitcheck("usesubmit")) { $second = 1; if ($idtype == 'uid') { //空间脚印 ssetcookie('anonymous_visit_' . $_SGLOBAL['supe_uid'] . '_' . $id, '1'); updatetable('visitor', array('vusername' => ''), array('uid' => $id, 'vuid' => $_SGLOBAL['supe_uid'])); $second = 0; } elseif ($idtype == 'cid') { //评论/留言 updatetable('comment', array('author' => ''), array('cid' => $id, 'authorid' => $_SGLOBAL['supe_uid'])); } else { //表态 updatetable('clickuser', array('username' => ''), array('id' => $id, 'idtype' => $idtype, 'uid' => $_SGLOBAL['supe_uid'])); } magic_use($mid, array('id' => $id, 'idtype' => $idtype), true); showmessage('magicuse_success', $_POST['refer'], $second); }
switch ($post['action']) { case 'usecookie': $si_string = ''; if (isset($_COOKIE['si_string'])) { $si_string = explode("\t", authcode($_COOKIE['si_string'])); } if (!!$si_string) { list($email, $password) = $si_string; } case 'login': if (!preg_match('#\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*#', $email)) { $json->setMsg('invailed email'); break; } if ($remember) { ssetcookie('si_string', authcode(implode("\t", [$email, $password]), 'ENCODE')); } $gamelogin = new kanlogin($email, $password, $lode_type, $remember); $login_result = $gamelogin->login(); if ($login_result) { $json->success(); } break; default: $json->setMsg('watch your magic'); break; } } else { $json->setMsg('watch your magic'); } exit($json);
function DB_Set_Logined($uid) { global $db, $_SGLOBAL, $_SN; // echo var_dump($_SN)."--_SN0<br>"; $setarr = array('uid' => $uid, 'username' => '', 'password' => ''); $query = $db->query("SELECT username,password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'"); if ($value = $db->fetch_array($query)) { $setarr['username'] = addslashes($value['username']); $setarr['password'] = addslashes($value['password']); } $invitearr = $_SESSION['invitearr']; //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取 $url_plus = $_SESSION['url_plus']; //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取 $app = $_SESSION['app']; //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取 $_SN = $_SESSION['SN']; //从会话里取出后边要用的这个变量 // echo var_dump($invitearr)."--invitearr<br>"; // echo var_dump($url_plus)."--url_plus<br>"; // echo var_dump($app)."--app<br>"; // echo var_dump($_SN)."--_SN1<br>"; include_once S_ROOT . './source/function_space.php'; //开通空间 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'"); if (!($space = $_SGLOBAL['db']->fetch_array($query))) { $space = space_open($setarr['uid'], $setarr['username'], 0, $passport['email']); } $_SGLOBAL['member'] = $space; //实名 realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']); //这里$_SN再次被赋值 // echo var_dump($_SN)."--_SN2<br>"; //设置cookie ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), $cookietime); ssetcookie('loginuser', $passport['username'], 31536000); ssetcookie('_refer', ''); //同步登录 include_once S_ROOT . './uc_client/client.php'; $ucsynlogin = uc_user_synlogin($setarr['uid']); // echo var_dump($ucsynlogin)."--ucsynlogin<br>"; //好友邀请 if ($invitearr) { // echo $_SGLOBAL."--_SGLOBAL1<br>"; // echo var_dump($_SN)."--_SN1<br>"; // echo var_dump($invitearr['id'])."--invitearr['id']<br>"; // echo var_dump($setarr['uid'])."--setarr['uid']<br>"; // echo var_dump($setarr['username'])."--setarr['username']<br>"; // echo var_dump($invitearr['uid'])."--invitearr['uid']<br>"; // echo var_dump($invitearr['username'])."--invitearr['username']<br>"; //成为好友 invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app); } // echo var_dump($_SGLOBAL['supe_uid'])."--_SGLOBAL['supe_uid']<br>"; // echo var_dump($space['uid'])."--space['uid']<br>"; //判断用户是否设置了头像 $_SGLOBAL['supe_uid'] = $space['uid']; $reward = $setarr = array(); $experience = $credit = 0; $avatar_exists = ckavatar($space['uid']); if ($avatar_exists) { if (!$space['avatar']) { //奖励积分 $reward = getreward('setavatar', 0); $credit = $reward['credit']; $experience = $reward['experience']; if ($credit) { $setarr['credit'] = "credit=credit+{$credit}"; } if ($experience) { $setarr['experience'] = "experience=experience+{$experience}"; } $setarr['avatar'] = 'avatar=1'; $setarr['updatetime'] = "updatetime={$_SGLOBAL['timestamp']}"; } } else { if ($space['avatar']) { $setarr['avatar'] = 'avatar=0'; } } if (empty($_POST['refer'])) { $_POST['refer'] = 'space.php?do=home'; } realname_get(); showmessage('login_success', $app ? "userapp.php?id={$app}" : $_POST['refer'], 1, array($ucsynlogin)); }
<?php if (!defined('iBUAA')) { exit('Access Denied'); } $user = $_SGLOBAL['db']->query("select usertype from " . tname(baseprofile) . " WHERE uid = " . $space[uid] . " and collegeid like '0%' LIMIT 1 "); $usertype = $_SGLOBAL['db']->result($user); ssetcookie('mytemplate', S_ROOT . './template/default/style.css', 3600 * 24 * 365); //长期有效 //显示全站动态的好友数 if (empty($_SCONFIG['showallfriendnum']) || $_SCONFIG['showallfriendnum'] < 1) { $_SCONFIG['showallfriendnum'] = 10; } //默认热点天数 if (empty($_SCONFIG['feedhotday'])) { $_SCONFIG['feedhotday'] = 2; } //网站近况 $isnewer = $space['friendnum'] < $_SCONFIG['showallfriendnum'] ? 1 : 0; if (empty($_GET['view']) && $space['self'] && $isnewer) { $_GET['view'] = 'ours'; //默认显示 } //分页 $perpage = $_SCONFIG['feedmaxnum'] < 50 ? 50 : $_SCONFIG['feedmaxnum']; $perpage = mob_perpage($perpage); if ($_GET['view'] == 'hot') { $perpage = 50; } $start = empty($_GET['start']) ? 0 : intval($_GET['start']); //检查开始数
<?php if (!defined('iBUAA')) { exit('Access Denied'); } //配置 $seccodedata = array('width' => 100, 'height' => 40, 'adulterate' => '1', 'angle' => '0', 'shadow' => '1'); //验证码 $seccode = mkseccode(); //设定cookie ssetcookie('seccode', authcode($seccode, 'ENCODE')); if (function_exists('imagecreate') && function_exists('imagecolorset') && function_exists('imagecopyresized') && function_exists('imagecolorallocate') && function_exists('imagechar') && function_exists('imagecolorsforindex') && function_exists('imageline') && function_exists('imagecreatefromstring') && (function_exists('imagegif') || function_exists('imagepng') || function_exists('imagejpeg'))) { $bgcontent = seccode_background(); $im = imagecreatefromstring($bgcontent); if ($seccodedata['adulterate']) { seccode_adulterate(); } seccode_giffont(); if (function_exists('imagepng')) { header('Content-type: image/png'); imagepng($im); } else { header('Content-type: image/jpeg'); imagejpeg($im, '', 100); } imagedestroy($im); } else { $numbers = array('B' => array('00', 'fc', '66', '66', '66', '7c', '66', '66', 'fc', '00'), 'C' => array('00', '38', '64', 'c0', 'c0', 'c0', 'c4', '64', '3c', '00'), 'E' => array('00', 'fe', '62', '62', '68', '78', '6a', '62', 'fe', '00'), 'F' => array('00', 'f8', '60', '60', '68', '78', '6a', '62', 'fe', '00'), 'G' => array('00', '78', 'cc', 'cc', 'de', 'c0', 'c4', 'c4', '7c', '00'), 'H' => array('00', 'e7', '66', '66', '66', '7e', '66', '66', 'e7', '00'), 'J' => array('00', 'f8', 'cc', 'cc', 'cc', '0c', '0c', '0c', '7f', '00'), 'K' => array('00', 'f3', '66', '66', '7c', '78', '6c', '66', 'f7', '00'), 'M' => array('00', 'f7', '63', '6b', '6b', '77', '77', '77', 'e3', '00'), 'P' => array('00', 'f8', '60', '60', '7c', '66', '66', '66', 'fc', '00'), 'Q' => array('00', '78', 'cc', 'cc', 'cc', 'cc', 'cc', 'cc', '78', '00'), 'R' => array('00', 'f3', '66', '6c', '7c', '66', '66', '66', 'fc', '00'), 'T' => array('00', '78', '30', '30', '30', '30', 'b4', 'b4', 'fc', '00'), 'V' => array('00', '1c', '1c', '36', '36', '36', '63', '63', 'f7', '00'), 'W' => array('00', '36', '36', '36', '77', '7f', '6b', '63', 'f7', '00'), 'X' => array('00', 'f7', '66', '3c', '18', '18', '3c', '66', 'ef', '00'), 'Y' => array('00', '7e', '18', '18', '18', '3c', '24', '66', 'ef', '00'), '2' => array('fc', 'c0', '60', '30', '18', '0c', 'cc', 'cc', '78', '00'), '3' => array('78', '8c', '0c', '0c', '38', '0c', '0c', '8c', '78', '00'), '4' => array('00', '3e', '0c', 'fe', '4c', '6c', '2c', '3c', '1c', '1c'), '6' => array('78', 'cc', 'cc', 'cc', 'ec', 'd8', 'c0', '60', '3c', '00'), '7' => array('30', '30', '38', '18', '18', '18', '1c', '8c', 'fc', '00'), '8' => array('78', 'cc', 'cc', 'cc', '78', 'cc', 'cc', 'cc', '78', '00'), '9' => array('f0', '18', '0c', '6c', 'dc', 'cc', 'cc', 'cc', '78', '00')); foreach ($numbers as $i => $number) { for ($j = 0; $j < 6; $j++) { $a1 = substr('012', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1);
function getreward($action, $update = 1, $uid = 0, $needle = '', $setcookie = 1) { global $_SGLOBAL, $_SCOOKIE; $credit = 0; $reward = array('credit' => 0, 'experience' => 0); $creditlog = array(); @(include_once S_ROOT . './data/data_creditrule.php'); $rule = $_SGLOBAL['creditrule'][$action]; if ($rule['credit'] || $rule['experience']) { $uid = $uid ? intval($uid) : $_SGLOBAL['supe_uid']; if ($rule['rewardtype']) { //增加积分 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('creditlog') . " WHERE uid='{$uid}' AND rid='{$rule['rid']}'"); $creditlog = $_SGLOBAL['db']->fetch_array($query); if (empty($creditlog)) { $reward['credit'] = $rule['credit']; $reward['experience'] = $rule['experience']; $setarr = array('uid' => $uid, 'rid' => $rule['rid'], 'total' => 1, 'cyclenum' => 1, 'credit' => $rule['credit'], 'experience' => $rule['experience'], 'dateline' => $_SGLOBAL['timestamp']); //判断是否需要去重 if ($rule['norepeat']) { if ($rule['norepeat'] == 1) { $setarr['info'] = $needle; } elseif ($rule['norepeat'] == 2) { $setarr['user'] = $needle; } elseif ($rule['norepeat'] == 3) { $setarr['app'] = $needle; } } if (in_array($rule['cycletype'], array(2, 3))) { $setarr['starttime'] = $_SGLOBAL['timestamp']; } $clid = inserttable('creditlog', $setarr, 1); } else { $newcycle = false; $setarr = array(); $clid = $creditlog['clid']; switch ($rule['cycletype']) { case 0: //一次性奖励 break; case 1: //每天限次数 //每天限次数 case 4: //不限周期 $sql = 'cyclenum+1'; if ($rule['cycletype'] == 1) { $today = sstrtotime(sgmdate('Y-m-d')); //判断是否为昨天 if ($creditlog['dateline'] < $today && $rule['rewardnum']) { $creditlog['cyclenum'] = 0; $sql = 1; $newcycle = true; } } if (empty($rule['rewardnum']) || $creditlog['cyclenum'] < $rule['rewardnum']) { //验证是否为需要去重操作 if ($rule['norepeat']) { $repeat = checkcheating($creditlog, $needle, $rule['norepeat']); if ($repeat && !$newcycle) { return $reward; } } $reward['credit'] = $rule['credit']; $reward['experience'] = $rule['experience']; //更新次数 $setarr = array('cyclenum' => "cyclenum={$sql}", 'total' => 'total=total+1', 'dateline' => "dateline='{$_SGLOBAL['timestamp']}'", 'credit' => "credit='{$reward['credit']}'", 'experience' => "experience='{$reward['experience']}'"); } break; case 2: //整点 //整点 case 3: //间隔分钟 $nextcycle = 0; if ($creditlog['starttime']) { if ($rule['cycletype'] == 2) { //上一次执行时间 $start = sstrtotime(sgmdate('Y-m-d H:00:00', $creditlog['starttime'])); $nextcycle = $start + $rule['cycletime'] * 3600; } else { $nextcycle = $creditlog['starttime'] + $rule['cycletime'] * 60; } } if ($_SGLOBAL['timestamp'] <= $nextcycle && $creditlog['cyclenum'] < $rule['rewardnum']) { //验证是否为需要去重操作 if ($rule['norepeat']) { $repeat = checkcheating($creditlog, $needle, $rule['norepeat']); if ($repeat && !$newcycle) { return $reward; } } $reward['experience'] = $rule['experience']; $reward['credit'] = $rule['credit']; $setarr = array('cyclenum' => "cyclenum=cyclenum+1", 'total' => 'total=total+1', 'dateline' => "dateline='{$_SGLOBAL['timestamp']}'", 'credit' => "credit='{$reward['credit']}'", 'experience' => "experience='{$reward['experience']}'"); } elseif ($_SGLOBAL['timestamp'] >= $nextcycle) { $newcycle = true; $reward['experience'] = $rule['experience']; $reward['credit'] = $rule['credit']; $setarr = array('cyclenum' => "cyclenum=1", 'total' => 'total=total+1', 'dateline' => "dateline='{$_SGLOBAL['timestamp']}'", 'credit' => "credit='{$reward['credit']}'", 'starttime' => "starttime='{$_SGLOBAL['timestamp']}'", 'experience' => "experience='{$reward['experience']}'"); } break; } //记录操作历史 if ($rule['norepeat'] && $needle) { switch ($rule['norepeat']) { case 0: break; case 1: //信息去重 $info = empty($creditlog['info']) || $newcycle ? $needle : $creditlog['info'] . ',' . $needle; $setarr['info'] = "`info`='{$info}'"; break; case 2: //用户去重 $user = empty($creditlog['user']) || $newcycle ? $needle : $creditlog['user'] . ',' . $needle; $setarr['user'] = "******"; break; case 3: //应用去重 $app = empty($creditlog['app']) || $newcycle ? $needle : $creditlog['app'] . ',' . $needle; $setarr['app'] = "`app`='{$app}'"; break; } } if ($setarr) { $_SGLOBAL['db']->query("UPDATE " . tname('creditlog') . " SET " . implode(',', $setarr) . " WHERE clid='{$creditlog['clid']}'"); } } if ($setcookie && ($uid = $_SGLOBAL['supe_uid'])) { //其中有新值时才重写cookie值 if ($reward['credit'] || $reward['experience']) { $logstr = $action . ',' . $clid; ssetcookie('reward_log', $logstr); $_SCOOKIE['reward_log'] = $logstr; } } } else { //扣除积分 $reward['credit'] = "-{$rule['credit']}"; $reward['experience'] = "-{$rule['experience']}"; } if ($update && ($reward['credit'] || $reward['experience'])) { $setarr = array(); if ($reward['credit']) { $setarr['credit'] = "credit=credit+{$reward['credit']}"; } if ($reward['experience']) { $setarr['experience'] = "experience=experience+{$reward['experience']}"; } $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET " . implode(',', $setarr) . " WHERE uid='{$uid}'"); } } return array('credit' => abs($reward['credit']), 'experience' => abs($reward['experience'])); }
//更新本地用户库 inserttable('member', $setarr, 0, true); //开通空间 include_once(S_ROOT.'./source/function_space.php'); $space = space_open($setarr['uid'], $_POST['username'], 1); //反馈受保护 $result = uc_user_addprotected($_POST['username'], $_POST['username']); $_SGLOBAL['db']->query("UPDATE ".tname('space')." SET flag=1 WHERE username='******'"); //清理在线session insertsession($setarr); //设置cookie ssetcookie('auth', authcode("$setarr[password]\t$setarr[uid]", 'ENCODE'), 2592000); //写log if(@$fp = fopen($lockfile, 'w')) { fwrite($fp, 'UCenter Home'); fclose($fp); } show_msg('<font color="red">恭喜! UCenter Home安装全部完成!</font> <br>为了您的数据安全,请登录ftp,删除install目录<br><br> 您的管理员身份已经成功确认,并已经开通空间。接下来,您可以:<br> <br><a href="../space.php" target="_blank">进入我的空间</a> <br>进入我的主页,开始UCenter Home之旅 <br><a href="../admincp.php" target="_blank">进入管理平台</a> <br>以管理员身份对站点参数进行设置', 999);
$csql = $cid ? "cid='{$cid}' AND" : ''; $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('comment') . " WHERE {$csql} id='{$id}' AND idtype='arrangementid' ORDER BY dateline desc LIMIT {$start},{$perpage}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['authorid'], $value['author']); //实名 $list[] = $value; } } //分页 $multi = multi($count, $perpage, $page, "space.php?uid={$arrangement['uid']}&do={$do}&id={$id}", '', 'content'); //访问统计 if (!$space['self'] && $_SCOOKIE['view_arrangementid'] != $arrangement['arrangementid']) { $_SGLOBAL['db']->query("UPDATE " . tname('arrangement') . " SET viewnum=viewnum+1 WHERE arrangementid='{$arrangement['arrangementid']}'"); inserttable('log', array('id' => $space['uid'], 'idtype' => 'uid')); //延迟更新 ssetcookie('view_arrangementid', $arrangement['arrangementid']); } //实名 realname_get(); $_TPL['css'] = 'blog'; //靠 $hash = md5($arrangement['uid'] . "\t" . $arrangement['dateline']); $id = $arrangement['arrangementid']; $idtype = 'arrangementid'; foreach ($clicks as $key => $value) { $value['clicknum'] = $arrangement["click_{$key}"]; if ($value['clicknum'] > $maxclicknum) { $maxclicknum = $value['clicknum']; } $clicks[$key] = $value; }
if ($uid) { $touid = $uid; } else { $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']); } $daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']); include_once S_ROOT . './uc_client/client.php'; if ($_GET['op'] == 'checknewpm') { //检查当前用户 if ($_SGLOBAL['supe_uid']) { $ucnewpm = uc_pm_checknew($_SGLOBAL['supe_uid']); if ($_SGLOBAL['member']['newpm'] != $ucnewpm) { updatetable('space', array('newpm' => $ucnewpm), array('uid' => $_SGLOBAL['supe_uid'])); } } ssetcookie('checkpm', 1, 30); exit; } elseif ($_GET['op'] == 'delete') { $pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']); $folder = $_GET['folder'] == 'inbox' ? 'inbox' : 'outbox'; if (submitcheck('deletesubmit')) { $retrun = uc_pm_delete($_SGLOBAL['supe_uid'], $folder, array($pmid)); if ($retrun > 0) { showmessage('do_success', $_POST['refer'], 0); } else { showmessage('this_message_could_not_be_deleted'); } } } elseif ($_GET['op'] == 'send') { //判断是否发布太快 $waittime = interval_check('post');
} else { //别人加我 $addnum++; $inserts[] = "('{$value['uid']}','{$_SGLOBAL['supe_uid']}','{$_SGLOBAL['supe_username']}','0','{$_SGLOBAL['timestamp']}')"; } } } } if ($inserts) { $_SGLOBAL['db']->query("REPLACE INTO " . tname('friend') . " (uid,fuid,fusername,status,dateline) VALUES " . implode(',', $inserts)); friend_cache($_SGLOBAL['supe_uid']); } if ($addnum) { $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET addfriendnum=addfriendnum+{$addnum} WHERE uid='{$_SGLOBAL['supe_uid']}'"); } ssetcookie('synfriend', 1, 1800); //30分钟检查一次 exit; } elseif ($op == 'find') { //自动找好友 $maxnum = 18; $nouids = $space['friends']; $nouids[] = $space['uid']; //就在您附近的 $nearlist = array(); $i = 0; $myip = getonlineip(1); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('session') . "\n\t\tWHERE ip='{$myip}' LIMIT 0,200"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if (!in_array($value['uid'], $nouids)) { realname_set($value['uid'], $value['username']);
if ($_GET['goto'] == 'down') { $sequence = empty($_SCOOKIE['pic_sequence']) ? $album['picnum'] : intval($_SCOOKIE['pic_sequence']); $sequence++; if ($sequence > $album['picnum']) { $sequence = 1; } } elseif ($_GET['goto'] == 'up') { $sequence = empty($_SCOOKIE['pic_sequence']) ? $album['picnum'] : intval($_SCOOKIE['pic_sequence']); $sequence--; if ($sequence < 1) { $sequence = $album['picnum']; } } else { $sequence = 1; } ssetcookie('pic_sequence', $sequence); } //图片地址 $pic['pic'] = pic_get($pic['filepath'], $pic['thumb'], $pic['remote'], 0); $pic['size'] = formatsize($pic['size']); //图片的EXIF信息 $exifs = array(); $allowexif = function_exists('exif_read_data'); if (isset($_GET['exif']) && $allowexif) { include_once S_ROOT . './source/function_exif.php'; $exifs = getexif($pic['pic']); } //图片评论 $perpage = 5; $perpage = mob_perpage($perpage); $start = ($page - 1) * $perpage;
<?php if (!defined('iBUAA')) { exit('Access Denied'); } if (empty($_SCONFIG['updatestat'])) { showmessage('not_open_updatestat'); } if ($_GET['hash']) { //ÉèÖÃhash ssetcookie('stat_hash', $_GET['hash']); showmessage('do_success', 'do.php?ac=stat', 0); } $stat_hash = md5($_SCONFIG['sitekey'] . "\t" . substr($_SGLOBAL['timestamp'], 0, 6)); $isfounder = ckfounder($_SGLOBAL['supe_uid']); if (!$isfounder) { $isProxy = 0; $q = $_SGLOBAL['db']->query("select * from " . tname('proxy') . " where uid={$_SGLOBAL['supe_uid']} and menu_0=1"); if ($r = $_SGLOBAL['db']->fetch_array($q)) { $isProxy = 1; } if (!checkperm('allowstat') && $_SCOOKIE['stat_hash'] != $stat_hash && !$isProxy) { showmessage('no_privilege'); } } $cols = array(); $cols['login'] = array('login', 'register', 'invite', 'appinvite'); $cols['add'] = array('doing', 'blog', 'pic', 'poll', 'event', 'share', 'thread'); $cols['comment'] = array('docomment', 'blogcomment', 'piccomment', 'pollcomment', 'pollvote', 'eventcomment', 'eventjoin', 'sharecomment', 'post', 'click'); $cols['space'] = array('wall', 'poke'); $type = empty($_GET['type']) ? 'all' : $_GET['type'];
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('comment') . " WHERE {$csql} id='{$id}' AND idtype='blogid' ORDER BY dateline desc LIMIT {$start},{$perpage}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['authorid'], $value['author']); //实名 $list[] = $value; } } //分页 $ajaxdiv = 'space_' . $_GET['do']; $multi = multi($count, $perpage, $page, "space.php?uid={$blog['uid']}&do={$do}&id={$id}", $ajaxdiv, 'content'); //访问统计 if (!$space['self'] && $_SCOOKIE['view_blogid'] != $blog['blogid']) { $_SGLOBAL['db']->query("UPDATE " . tname('blog') . " SET viewnum=viewnum+1 WHERE blogid='{$blog['blogid']}'"); inserttable('log', array('id' => $space['uid'], 'idtype' => 'uid')); //延迟更新 ssetcookie('view_blogid', $blog['blogid']); } //表态 $hash = md5($blog['uid'] . "\t" . $blog['dateline']); $id = $blog['blogid']; $idtype = 'blogid'; foreach ($clicks as $key => $value) { $value['clicknum'] = $blog["click_{$key}"]; $value['classid'] = mt_rand(1, 4); if ($value['clicknum'] > $maxclicknum) { $maxclicknum = $value['clicknum']; } $clicks[$key] = $value; } //点评 $clickuserlist = array();
$Id: cp.php 13003 2009-08-05 06:46:06Z liguode $ */ //Common files include_once './common.php'; include_once S_ROOT . './source/function_cp.php'; include_once S_ROOT . './source/function_magic.php'; //Allowed methods $acs = array('space', 'doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class', 'swfupload', 'thread', 'mtag', 'poke', 'friend', 'avatar', 'profile', 'theme', 'import', 'feed', 'privacy', 'pm', 'share', 'advance', 'invite', 'sendmail', 'userapp', 'task', 'credit', 'password', 'domain', 'event', 'poll', 'topic', 'click', 'magic', 'top', 'videophoto'); $ac = empty($_GET['ac']) || !in_array($_GET['ac'], $acs) ? 'profile' : $_GET['ac']; $op = empty($_GET['op']) ? '' : $_GET['op']; //Check Permissions if (empty($_SGLOBAL['supe_uid'])) { if ($_SERVER['REQUEST_METHOD'] == 'GET') { ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI'])); } else { ssetcookie('_refer', rawurlencode('cp.php?ac=' . $ac)); } if ($op != 'changelng' && $op != 'changetpl') { //vot showmessage('to_login', 'do.php?ac=' . $_SCONFIG['login_action']); } } // Get the Space Info $space = getspace($_SGLOBAL['supe_uid']); if (empty($space)) { if ($op != 'changelng' && $op != 'changetpl') { //vot showmessage('space_does_not_exist'); } } // Check for site closed
if (empty($_SCONFIG['login_action'])) { $_SCONFIG['login_action'] = md5('login' . md5($_SCONFIG['sitekey'])); } if (empty($_SCONFIG['register_action'])) { $_SCONFIG['register_action'] = md5('register' . md5($_SCONFIG['sitekey'])); } //整站风格 if (empty($_SCONFIG['template'])) { $_SCONFIG['template'] = 'default'; } if ($_SCOOKIE['mytemplate']) { $_SCOOKIE['mytemplate'] = str_replace('.', '', trim($_SCOOKIE['mytemplate'])); if (file_exists(S_ROOT . './template/' . $_SCOOKIE['mytemplate'] . '/style.css')) { $_SCONFIG['template'] = $_SCOOKIE['mytemplate']; } else { ssetcookie('mytemplate', '', 365000); } } //处理REQUEST_URI if (!isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } } if ($_SERVER['REQUEST_URI']) { $temp = urldecode($_SERVER['REQUEST_URI']); if (strexists($temp, '<') || strexists($temp, '"')) { $_GET = shtmlspecialchars($_GET); //XSS }
$_SGLOBAL['db']->query("UPDATE " . tname('adminsession') . " SET errorcount=errorcount+1 WHERE uid='{$_SGLOBAL['supe_uid']}'"); cpmessage('enter_the_password_is_incorrect', 'admincp.php'); } else { $_SGLOBAL['db']->query("UPDATE " . tname('adminsession') . " SET errorcount='-1' WHERE uid='{$_SGLOBAL['supe_uid']}'"); $refer = empty($_SCOOKIE['_refer']) ? $_SGLOBAL['refer'] : rawurldecode($_SCOOKIE['_refer']); if (empty($refer) || preg_match("/(login)/i", $refer)) { $refer = 'admincp.php'; } ssetcookie('_refer', ''); showmessage('login_success', $refer, 0); } } else { if ($_SERVER['REQUEST_METHOD'] == 'GET') { ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI'])); } else { ssetcookie('_refer', rawurlencode('admincp.php?ac=' . $_GET['ac'])); } $actives = array('advance' => ' class="active"'); include template('cp_advance'); exit; } break; case '2': //登录成功 break; default: //尝试次数太多禁止登录 cpmessage('excessive_number_of_attempts_to_sign'); break; } if ($ac == 'defaultuser') {
if ($_SGLOBAL['db']->fetch_array($query)) { showmessage('user_delete', geturl('action/login')); } $password = md5($uid . '|' . random(8)); $groupid = 2; $dateline = $_SGLOBAL['timestamp']; $updatetime = $_SGLOBAL['timestamp']; } $insertsqlarr = array('uid' => $uid, 'username' => addslashes($members['username']), 'password' => $password, 'groupid' => $groupid, 'email' => $email, 'dateline' => $dateline, 'updatetime' => $updatetime, 'lastlogin' => $_SGLOBAL['timestamp'], 'ip' => $_SGLOBAL['onlineip']); if (empty($oldmember)) { inserttable('members', $insertsqlarr); } else { updatetable('members', $insertsqlarr, array('uid' => $_SGLOBAL['supe_uid'])); } $cookievalue = authcode("{$password}\t{$uid}", 'ENCODE'); ssetcookie('auth', $cookievalue, $cookietime); setcookie('_refer', ''); $msg = $lang['login_succeed'] . uc_user_synlogin($members['uid']); showmessage($msg, rawurldecode($refer)); } break; case 'logout': obclean(); sclearcookie(); setcookie('_refer', ''); $msg = $lang['logout_succeed'] . uc_user_synlogout(); $_SGLOBAL['db']->query("DELETE FROM " . tname('adminsession') . " WHERE uid='{$_SGLOBAL['supe_uid']}'"); showmessage($msg, rawurldecode($refer)); break; default: break;
show_msg('输入的用户名无法注册,请重新确认'); } $setarr['dateline'] = $_SGLOBAL['timestamp']; $setarr['updatetime'] = $_SGLOBAL['timestamp']; $setarr['lastlogin'] = $_SGLOBAL['timestamp']; $setarr['ip'] = $_SGLOBAL['onlineip']; $setarr['password'] = md5("{$setarr['uid']}|{$_SGLOBAL['timestamp']}"); //本地密码随机生成 $setarr['groupid'] = 1; //管理员 //更新本地用户库 inserttable('members', $setarr, 0, true); //反馈受保护 $result = uc_user_addprotected($_POST['username'], $_POST['username']); //设置cookie ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000); //写log if (@($fp = fopen($lockfile, 'w'))) { fwrite($fp, 'SupeSite'); fclose($fp); } show_msg('<font color="red">恭喜! SupeSite安装全部完成!</font> <br>为了您的数据安全,请登录ftp,删除本安装文件<br><br> 您的管理员身份已经成功确认。接下来,您可以:<br> <br><a href="../admincp.php" target="_blank">进入站点管理平台</a> <br>以管理员身份对站点参数进行设置 <br><a href="../index.php" target="_blank">访问站点首页</a> <br>立即访问自己的站点首页', 999); } if (empty($step)) { show_header();
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: do_login.php 8543 2008-08-21 05:51:48Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $pernum = 1;//一次发送邮件个数,太多容易超时和服务器被封杀 ssetcookie('sendmail', '1', 300);//用户每5分钟调用本程序 $lockfile = S_ROOT.'./data/sendmail.lock'; @$filemtime = filemtime($lockfile); if($_SGLOBAL['timestamp'] - $filemtime < 5) exit(); touch($lockfile); //防止超时 set_time_limit(0); //获取发送队列 $list = $sublist = $cids = $touids = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('mailcron')." WHERE sendtime<='$_SGLOBAL[timestamp]' ORDER BY sendtime LIMIT 0,$pernum"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if($value['touid']) $touids[$value['touid']] = $value['touid']; $cids[] = $value['cid']; $list[$value['cid']] = $value; }