本文整理汇总了PHP中sstrtotime函数的典型用法代码示例。如果您正苦于以下问题:PHP sstrtotime函数的具体用法?PHP sstrtotime怎么用?PHP sstrtotime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sstrtotime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
exit('Access Denied');
}
// Check Permissions
if (!checkperm('managetask')) {
cpmessage('no_authority_management_operation');
}
$list = $thevalue = array();
$taskid = empty($_GET['taskid']) ? 0 : intval($_GET['taskid']);
if (submitcheck('tasksubmit')) {
$_POST['name'] = shtmlspecialchars($_POST['name']);
$_POST['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $_POST['filename']);
if (empty($_POST['filename']) || !is_readable(S_ROOT . './source/task/' . $_POST['filename'])) {
cpmessage('designated_script_file_incorrect');
}
$starttime = empty($_POST['starttime']) ? 0 : sstrtotime($_POST['starttime']);
$endtime = empty($_POST['endtime']) ? 0 : sstrtotime($_POST['endtime']);
$setarr = array('name' => $_POST['name'], 'note' => trim($_POST['note']), 'filename' => $_POST['filename'], 'image' => trim($_POST['image']), 'available' => intval($_POST['available']), 'starttime' => $starttime, 'endtime' => $endtime, 'nexttype' => trim($_POST['nexttype']), 'credit' => intval($_POST['credit']), 'maxnum' => intval($_POST['maxnum']), 'displayorder' => intval($_POST['displayorder']));
$setarr['nexttime'] = $setarr['nexttype'] == 'time' ? intval($_POST['nexttime']) : 0;
if (empty($taskid)) {
//ADD
inserttable('task', $setarr);
// return taskid
} else {
//UPDATE
updatetable('task', $setarr, array('taskid' => $taskid));
}
// update config
include_once S_ROOT . './source/function_cache.php';
task_cache();
cpmessage('do_success', 'admincp.php?ac=task');
}
示例2: swritefile
}
//缓存结果
swritefile($userfile, serialize($results));
} elseif (submitcheck('import2submit')) {
include_once S_ROOT . './source/function_blog.php';
if (empty($results) || empty($_POST['ids'])) {
showmessage('choose_at_least_one_log', 'cp.php?ac=import');
}
$allcount = $incount = 0;
krsort($results);
//倒序
foreach ($results as $key => $value) {
$allcount = $allcount + 1;
if (in_array($key, $_POST['ids'])) {
$value = saddslashes($value);
$dateline = intval(sstrtotime($value['dateCreated']));
$subject = getstr($value['title'], 80, 1, 1, 1);
$message = isset($value['description']) ? $value['description'] : $value['content'];
$message = getstr($message, 0, 1, 1, 1, 0, 1);
$message = checkhtml($message);
if (empty($subject) || empty($message)) {
$results[$key]['status'] = '--';
$results[$key]['blogid'] = 0;
continue;
}
//开始导入
$blogarr = array('uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'subject' => $subject, 'pic' => getmessagepic($message), 'dateline' => $dateline ? $dateline : $_SGLOBAL['timestamp']);
$blogid = inserttable('blog', $blogarr, 1);
//插入内容
$fieldarr = array('blogid' => $blogid, 'message' => $message, 'postip' => getonlineip());
inserttable('blogfield', $fieldarr);
示例3: tname
$fromsql = tname("userevent")." ue, ".tname('event')." e";
$wherearr[] = " ue.eventid = e.eventid";
$joinsql = "";
}
}
//活动分类
if($_GET['classid']){
$_GET['classid'] = intval($_GET['classid']);
$wherearr[] = "e.classid = '$_GET[classid]'";
$theurl .= "&classid=$_GET[classid]";
}
//活动时间
if($_GET['date']){
$daystart = sstrtotime($_GET['date']);
$dayend = $daystart + 86400;
$wherearr[] = "e.starttime <= '$dayend' AND e.endtime >= '$daystart'";
$theurl .= "&date=$_GET[date]";
}
//活动城市
if($_GET['province']) {
$_GET['province'] = getstr($_GET['province'], 20, 1, 1);
$wherearr[] = "e.province = '$_GET[province]'";
$theurl .= "&province=$_GET[province]";
}
if($_GET['city']) {
$_GET['city'] = getstr($_GET['city'], 20, 1, 1);
$wherearr[] = "e.city = '$_GET[city]'";
$theurl .= "&city=$_GET[city]";
示例4: intval
$setsqlarr['pollid'] = $_POST['pollid'];
$setsqlarr['top'] = intval($_POST['top']);
empty($_POST['allowreply']) ? $setsqlarr['allowreply'] = 1 : ($setsqlarr['allowreply'] = intval($_POST['allowreply']));
$setsqlarr['grade'] = intval($_POST['grade']);
//附件
if (!empty($_POST['divupload']) && is_array($_POST['divupload'])) {
$setsqlarr['haveattach'] = 1;
$picflag = 1;
} else {
$setsqlarr['haveattach'] = 0;
}
//发布时间
if (empty($_POST['dateline'])) {
$setsqlarr['dateline'] = $_SGLOBAL['timestamp'];
} else {
$setsqlarr['dateline'] = sstrtotime($_POST['dateline']);
if ($setsqlarr['dateline'] > $_SGLOBAL['timestamp']) {
$setsqlarr['dateline'] = $_SGLOBAL['timestamp'];
}
}
$othercatidarr = array();
if (!empty($_POST['othercatid'])) {
$othercatidarr = $_POST['othercatid'];
}
$othercatidarr = array_unique($othercatidarr);
$setsqlarr['othercatid'] = implode(',', $othercatidarr);
if (empty($itemid)) {
//添加数据
$op = 'add';
$setsqlarr['tid'] = empty($_POST['tid']) ? 0 : intval($_POST['tid']);
$setsqlarr['type'] = $type;
示例5: elseif
} elseif ($op == 'delete') {
//Delete poll
if (submitcheck('deletesubmit')) {
include_once S_ROOT . './source/function_delete.php';
if (deletepolls(array($pid))) {
showmessage('do_success', "space.php?uid={$poll['uid']}&do=poll&view=me");
} else {
showmessage('failed_to_delete_operation');
}
}
} elseif ($op == 'modify') {
//Modify end time
if (submitcheck('modifysubmit')) {
$expiration = 0;
if ($_POST['expiration']) {
$expiration = sstrtotime(trim($_POST['expiration']) . ' 23:59:59');
if ($expiration <= $_SGLOBAL['timestamp']) {
showmessage('time_expired_error', $_POST['refer']);
}
}
updatetable('poll', array('expiration' => $expiration), array('pid' => $pid));
showmessage('do_success', 'space.php?uid=' . $space['uid'] . '&do=poll&pid=' . $pid, 0);
}
} elseif ($op == 'summary') {
//Write poll summary
if (submitcheck('summarysubmit')) {
$summary = getstr($_POST['summary'], 0, 1, 1, 1, 2);
updatetable('pollfield', array('summary' => $summary), array('pid' => $pid));
showmessage('do_success', 'space.php?uid=' . $space['uid'] . '&do=poll&pid=' . $pid, 0);
}
//bbcode transform
示例6: modelpost
/**
* 模型在线投稿提交处理函数
*/
function modelpost($cacheinfo, $cp = 1)
{
global $_SGLOBAL, $theurl, $_SCONFIG;
include_once S_ROOT . './function/upload.func.php';
$_POST['mid'] = !empty($_POST['mid']) ? intval($_POST['mid']) : 0;
$itemid = !empty($_POST['itemid']) ? intval($_POST['itemid']) : 0;
$hash = '';
$op = 'add';
$resultitems = $resultmessage = array();
$modelsinfoarr = $cacheinfo['models'];
$columnsinfoarr = $cacheinfo['columns'];
//获取等级信息
if ($cacheinfo['models']['modelname'] == 'defect') {
switch ($_POST['grade']) {
case 1:
$_POST['grade'] = '64';
break;
case 2:
$_POST['grade'] = '32';
break;
case 3:
$_POST['grade'] = '16';
break;
case 4:
$_POST['grade'] = '9';
break;
case 5:
$_POST['grade'] = '4';
break;
case 6:
$_POST['grade'] = '1';
break;
case 7:
$_POST['grade'] = '-1';
break;
case 8:
$_POST['grade'] = '-2';
break;
case 9:
$_POST['grade'] = '-3';
break;
}
$gradearr = array('0' => $alang['general_state'], '64' => $alang['check_grade_1'], '32' => $alang['check_grade_2'], '16' => $alang['check_grade_3_1'], '9' => $alang['check_grade_3_2'], '4' => $alang['check_grade_3_3'], '1' => $alang['check_grade_4'], '-1' => $alang['check_grade_5'], '-2' => $alang['check_grade_6'], '-3' => $alang['check_grade_7']);
if (!empty($_SCONFIG['checkgrade'])) {
$newgradearr = explode("\t", $_SCONFIG['checkgrade']);
$gradearr['64'] = $newgradearr[0];
$gradearr['32'] = $newgradearr[1];
$gradearr['16'] = $newgradearr[2];
$gradearr['9'] = $newgradearr[3];
$gradearr['4'] = $newgradearr[4];
$gradearr['1'] = $newgradearr[5];
$gradearr['-1'] = $newgradearr[6];
$gradearr['-2'] = $newgradearr[7];
$gradearr['-3'] = $newgradearr[8];
}
} else {
$gradearr = array('0' => $alang['general_state'], '1' => $alang['check_grade_1'], '2' => $alang['check_grade_2'], '3' => $alang['check_grade_3'], '4' => $alang['check_grade_4'], '5' => $alang['check_grade_5'], '6' => $alang['check_grade_6'], '7' => $alang['check_grade_7']);
if (!empty($_SCONFIG['checkgrade'])) {
$newgradearr = explode("\t", $_SCONFIG['checkgrade']);
for ($i = 0; $i < count($newgradearr); $i++) {
if (!empty($newgradearr[$i])) {
$gradearr[$i + 1] = $newgradearr[$i];
}
}
}
}
if (empty($_POST['mid']) || $_POST['mid'] != $modelsinfoarr['mid']) {
showmessage('parameter_error');
}
$feedcolum = array();
foreach ($columnsinfoarr as $result) {
if ($result['isfixed'] == 1) {
$resultitems[] = $result;
} else {
$resultmessage[] = $result;
}
if ($result['formtype'] == 'linkage') {
if (!empty($_POST[$result['fieldname']])) {
$_POST[$result['fieldname']] = $cacheinfo['linkage']['info'][$result['fieldname']][$_POST[$result['fieldname']]];
}
} elseif ($result['formtype'] == 'timestamp') {
if (empty($_POST[$result['fieldname']])) {
$_POST[$result['fieldname']] = $_SGLOBAL['timestamp'];
} else {
$_POST[$result['fieldname']] = sstrtotime($_POST[$result['fieldname']]);
}
}
}
//更新用户最新更新时间
if (empty($itemid) && $_SGLOBAL['supe_uid']) {
updatetable('members', array('updatetime' => $_SGLOBAL['timestamp']), array('uid' => $_SGLOBAL['supe_uid']));
}
//输入检查
$_POST['catid'] = intval($_POST['catid']);
$_POST['allowreply'] = isset($_POST['allowreply']) ? intval($_POST['allowreply']) : checkperm('allowcomment') ? 1 : 0;
$_POST['subject'] = shtmlspecialchars(trim($_POST['subject']));
//检查输入
//.........这里部分代码省略.........
示例7: array
if (!empty($cacheinfo['linkage']['info'][$key][$tmpvalue])) {
$_GET[$tmpkey] = $tmpvalue = $cacheinfo['linkage']['info'][$key][$tmpvalue];
}
}
if ($columnsinfoarr[$key]['formtype'] == 'timestamp') {
if (preg_match("/_from\$/i", $tmpkey)) {
if (empty($sqlbetweenarr[$pre . '`' . $key . '`'][1])) {
$sqlbetweenarr[$pre . '`' . $key . '`'] = array(sstrtotime($tmpvalue), '');
} else {
$sqlbetweenarr[$pre . '`' . $key . '`'][0] = sstrtotime($tmpvalue);
}
} elseif (preg_match("/_to\$/i", $tmpkey)) {
if (empty($sqlbetweenarr[$pre . '`' . $key . '`'][0])) {
$sqlbetweenarr[$pre . '`' . $key . '`'] = array('', sstrtotime($tmpvalue));
} else {
$sqlbetweenarr[$pre . '`' . $key . '`'][1] = sstrtotime($tmpvalue);
}
}
} elseif (preg_match("/^(select|radio|linkage)\$/i", $columnsinfoarr[$key]['formtype']) || !preg_match("/^(VARCHAR|CHAR|TEXT|MEDIUMTEXT|LONGTEXT|)\$/i", $columnsinfoarr[$key]['fieldtype'])) {
//=
if (preg_match("/^(VARCHAR|CHAR|TEXT|MEDIUMTEXT|LONGTEXT|)\$/i", $columnsinfoarr[$key]['fieldtype'])) {
//char
$sqlchararr[$pre . '`' . $key . '`'] = stripsearchkey(shtmlspecialchars($tmpvalue));
} else {
$sqlintarr[$pre . '`' . $key . '`'] = intval($tmpvalue);
}
} elseif (preg_match("/^(text|textarea|checkbox)\$/i", $columnsinfoarr[$key]['formtype'])) {
//like
$sqllikearr[$pre . '`' . $key . '`'] = stripsearchkey(shtmlspecialchars($tmpvalue));
}
}
示例8: elseif
} elseif (submitcheck('valuesubmit')) {
//采集器编辑与添加的提交表单的处理
$postlisturl = addslashes(serialize(array('manual' => $_POST['listurl_manual'], 'auto' => $_POST['listurl_auto'])));
$_POST['autotype'] = !empty($_POST['autotype']) && intval($_POST['autotype']) == 2 ? 2 : 1;
if (empty($_POST['name'])) {
$_POST['name'] = $_SGLOBAL['timestamp'];
}
$_POST['subjectreplace'] = !empty($_POST['subjectreplace']) ? implode("\n", $_POST['subjectreplace']) : '';
$_POST['subjectreplaceto'] = !empty($_POST['subjectreplaceto']) ? implode("\n", $_POST['subjectreplaceto']) : '';
$_POST['messagereplace'] = !empty($_POST['messagereplace']) ? implode("\n", $_POST['messagereplace']) : '';
$_POST['messagereplaceto'] = !empty($_POST['messagereplaceto']) ? implode("\n", $_POST['messagereplaceto']) : '';
#Modify by jiangyanfeng
$_POST['messagesize'] = !empty($_POST['messagesize']) ? intval($_POST['messagesize']) : 0;
#End
$catarr = explode('_', $_POST['import']);
$setsqlarr = array('name' => $_POST['name'], 'dateline' => $_SGLOBAL['timestamp'], 'listurltype' => 'new', 'listurl' => $postlisturl, 'listpagestart' => $_POST['listpagestart'], 'listpageend' => $_POST['listpageend'], 'allnum' => $_POST['allnum'], 'pernum' => $_POST['pernum'], 'importcatid' => intval($catarr[1]), 'importtype' => $catarr[0], 'reverseorder' => intval($_POST['reverseorder']), 'encode' => $_POST['encode'], 'savepic' => $_POST['savepic'], 'saveflash' => $_POST['saveflash'], 'subjecturlrule' => striptbr($_POST['subjecturlrule']), 'subjecturllinkrule' => striptbr($_POST['subjecturllinkrule']), 'subjecturllinkpre' => $_POST['subjecturllinkpre'], 'subjectrule' => striptbr($_POST['subjectrule']), 'subjectfilter' => striptbr($_POST['subjectfilter']), 'subjectreplace' => $_POST['subjectreplace'], 'subjectreplaceto' => $_POST['subjectreplaceto'], 'subjectkey' => $_POST['subjectkey'], 'subjectallowrepeat' => $_POST['subjectallowrepeat'], 'datelinerule' => striptbr($_POST['datelinerule']), 'fromrule' => striptbr($_POST['fromrule']), 'authorrule' => striptbr($_POST['authorrule']), 'messagerule' => striptbr($_POST['messagerule']), 'messagefilter' => striptbr($_POST['messagefilter']), 'messagepagetype' => $_POST['messagepagetype'], 'messagepagerule' => striptbr($_POST['messagepagerule']), 'messagepageurlrule' => striptbr($_POST['messagepageurlrule']), 'messagepageurllinkpre' => $_POST['messagepageurllinkpre'], 'messagereplace' => $_POST['messagereplace'], 'messagereplaceto' => $_POST['messagereplaceto'], 'messagesize' => $_POST['messagesize'], 'picurllinkpre' => $_POST['picurllinkpre'], 'autotype' => $_POST['autotype'], 'wildcardlen' => $_POST['autotype'] == 1 ? $_POST['wildcardlen'] : '', 'subjecturllinkcancel' => striptbr($_POST['subjecturllinkcancel']), 'subjecturllinkfilter' => striptbr($_POST['subjecturllinkfilter']), 'subjecturllinkpf' => $_POST['subjecturllinkpf'], 'subjectkeycancel' => $_POST['subjectkeycancel'], 'messagekey' => $_POST['messagekey'], 'messagekeycancel' => $_POST['messagekeycancel'], 'messageformat' => $_POST['messageformat'], 'messagepageurllinkpf' => $_POST['messagepageurllinkpf'], 'uidrule' => shtmlspecialchars($_POST['uidrule']), 'defaultdateline' => empty($_POST['defaultdateline']) ? 0 : sstrtotime($_POST['defaultdateline']));
//对于新增的采集器与编辑的采集器的分别处理
if (empty($_POST['robotid'])) {
$robotid = 0;
$setsqlarr['uid'] = $_SGLOBAL['supe_uid'];
$robotid = inserttable('robots', $setsqlarr, 1);
updaterobot($robotid);
//更新采集器缓存
showmessage('robot_add_success', $theurl);
} else {
//UPDATE
$wheresqlarr = array('robotid' => $_POST['robotid']);
updatetable('robots', $setsqlarr, $wheresqlarr);
updaterobot($_POST['robotid']);
//更新采集器缓存
showmessage('robot_edit_success', $theurl);
示例9: exit
exit('Access Denied');
}
//权限
if (!checkperm('managesitefeed')) {
cpmessage('no_authority_management_operation');
}
if (submitcheck('feedsubmit')) {
$setarr = array('title_template' => trim($_POST['title_template']), 'body_template' => trim($_POST['body_template']));
if (empty($setarr['title_template']) && empty($setarr['body_template'])) {
cpmessage('sitefeed_error');
}
$feedid = intval($_POST['feedid']);
//时间问题
$_POST['dateline'] = trim($_POST['dateline']);
if ($_POST['dateline']) {
$newtimestamp = sstrtotime($_POST['dateline']);
if ($newtimestamp > $_SGLOBAL['timestamp']) {
$_SGLOBAL['timestamp'] = $newtimestamp;
}
}
if (empty($feedid)) {
$_SGLOBAL['supe_uid'] = 0;
include_once S_ROOT . './source/function_cp.php';
feed_add('sitefeed', trim($_POST['title_template']), array(), trim($_POST['body_template']), array(), trim($_POST['body_general']), array(trim($_POST['image_1']), trim($_POST['image_2']), trim($_POST['image_3']), trim($_POST['image_4'])), array(trim($_POST['image_1_link']), trim($_POST['image_2_link']), trim($_POST['image_3_link']), trim($_POST['image_4_link'])));
} else {
$setarr['body_general'] = trim($_POST['body_general']);
$setarr['image_1'] = trim($_POST['image_1']);
$setarr['image_1_link'] = trim($_POST['image_1_link']);
$setarr['image_2'] = trim($_POST['image_2']);
$setarr['image_2_link'] = trim($_POST['image_2_link']);
$setarr['image_3'] = trim($_POST['image_3']);
示例10: mob_perpage
$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']);
//检查开始数
ckstart($start, $perpage);
//今天时间开始线
$_SGLOBAL['today'] = sstrtotime(sgmdate('Y-m-d'));
//最少热度
$minhot = $_SCONFIG['feedhotmin'] < 1 ? 3 : $_SCONFIG['feedhotmin'];
$_SGLOBAL['gift_appid'] = '1027468';
if ($_GET['view'] == 'all') {
$wheresql = "1";
$ordersql = "dateline DESC";
$theurl = "space.php?uid={$space['uid']}&do={$do}&view=all";
$f_index = '';
} elseif ($_GET['view'] == 'hot') {
$wheresql = "hot>='{$minhot}'";
$ordersql = "dateline DESC";
$theurl = "space.php?uid={$space['uid']}&do={$do}&view=hot";
$f_index = '';
} elseif ($_GET['view'] == 'work') {
$wheresql = "icontype='work'";
示例11: cksearchcredit
$gets['starttime'] = $gets['endtime'] = '';
}
//搜索积分
cksearchcredit($ac);
//开始搜索
$wherearr = array();
if ($gets['username']) {
$wherearr[] = "main.username = '{$gets['username']}'";
}
if ($gets['tagid']) {
$wherearr[] = "main.tagid = '{$gets['tagid']}'";
}
if ($value = sstrtotime($gets['starttime'])) {
$wherearr[] = "main.dateline >= '{$value}'";
}
if ($value = sstrtotime($gets['endtime'])) {
$wherearr[] = "main.dateline <= '{$value}'";
}
//关键字
if ($inkey = stripsearchkey($gets['key'])) {
if (preg_match("/( AND |\\+|&|\\s)/i", $inkey) && !preg_match("/( OR |\\|)/i", $inkey)) {
$keys = preg_replace("/( AND |&| )/i", "+", $inkey);
$andor = ' AND ';
} else {
$keys = preg_replace("/( OR |\\|)/i", "+", $inkey);
$andor = ' OR ';
}
$is = array();
foreach (explode('+', $keys) as $value) {
if ($value = trim($value)) {
$is[] = "main.subject LIKE '%{$value}%'";
示例12: getreward
function getreward($action, $update = 1, $uid = 0, $needle = '', $setcookie = 1)
{
global $_SGLOBAL, $_SCOOKIE;
$reward = array('credit' => 0, 'experience' => 0);
$creditlog = array();
@(include_once S_ROOT . './data/system/creditrule.cache.php');
$rule = $_SGLOBAL['creditrule'][$action];
if ($rule['credit'] || $rule['experience']) {
$uid = $uid ? intval($uid) : $_SGLOBAL['supe_uid'];
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('members') . " WHERE uid='{$uid}'");
if ($member = $_SGLOBAL['db']->fetch_array($query)) {
if ($rule['rewardtype'] == 1) {
//Ôö¼Ó»ý·Ö
$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;
}
}
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($_SGLOBAL['timetemp'], '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($creditlog['starttime'], 'Y-m-d H:00:00'));
$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']}'");
}
//.........这里部分代码省略.........
示例13: uc_user_addprotected
include_once S_ROOT . './uc_client/client.php';
if ($_POST['flag'] == 1) {
$result = uc_user_addprotected(array($member['username']), $_SGLOBAL['supe_username']);
} else {
$_POST['flag'] = 0;
$result = uc_user_deleteprotected(array($member['username']), $_SGLOBAL['supe_username']);
}
if ($result) {
$setarr['flag'] = $_POST['flag'];
}
}
if ($uid != $_SGLOBAL['supe_uid'] || ckfounder($_SGLOBAL['supe_uid'])) {
if (empty($_POST['groupid'])) {
$_POST['groupid'] = getgroupid($_POST['experience'], 0);
} else {
$expiration = $_POST['expiration'] ? sstrtotime($_POST['expiration']) : 0;
if ($expiration && $expiration <= $_SGLOBAL['timestamp']) {
showmessage('time_expired_error');
}
}
include_once S_ROOT . './data/data_usergroup_' . $_POST['groupid'] . '.php';
$group = $_SGLOBAL['usergroup'][$_POST['groupid']];
if ($group['manageconfig'] && !ckfounder($_SGLOBAL['supe_uid'])) {
cpmessage('no_authority_management_operation');
}
//有效期
if ($expiration) {
$setlogarr = array('uid' => $member['uid'], 'username' => addslashes($member['username']), 'opuid' => $_SGLOBAL['supe_uid'], 'opusername' => $_SGLOBAL['supe_username'], 'expiration' => $expiration, 'dateline' => $_SGLOBAL['timestamp'], 'flag' => 1);
inserttable('spacelog', $setlogarr, 0, true);
}
$setarr['groupid'] = intval($_POST['groupid']);
示例14: exit
<?php
if (!defined('iBUAA')) {
exit('Access Denied');
}
//检查参数
$blog = magic_check_idtype($id, $idtype);
//时空机
if (submitcheck("usesubmit")) {
$newdateline = sstrtotime($_POST['newdateline']);
if (!$_POST['newdateline'] || $newdateline < sstrtotime('1970-1-1') || $newdateline > $blog['dateline']) {
showmessage('magicuse_bad_dateline');
//输入的时间无效
}
//修改对象时间
$tablename = gettablebyidtype($idtype);
$_SGLOBAL['db']->query("UPDATE " . tname($tablename) . " SET dateline='{$newdateline}' WHERE {$idtype}='{$id}' AND uid='{$_SGLOBAL['supe_uid']}'");
//同时修改feed的时间
$_SGLOBAL['db']->query("UPDATE " . tname('feed') . " SET dateline='{$newdateline}' WHERE id='{$id}' AND idtype='{$idtype}' AND uid='{$_SGLOBAL['supe_uid']}'");
magic_use($mid, array('id' => $id, 'idtype' => $idtype), true);
showmessage('magicuse_success', $_POST['refer'], 0);
}
示例15: ckspacelog
ckspacelog();
showmessage('no_privilege');
}
}
$topicid = 0;
} else {
if ($_GET['op'] != 'join') {
if ($_SGLOBAL['supe_uid'] != $topic['uid'] && !checkperm('managetopic')) {
showmessage('no_privilege');
}
}
$topic['pic'] = pic_get($topic['pic'], $topic['thumb'], $topic['remote'], 1);
}
//添加编辑操作
if (submitcheck('topicsubmit')) {
$setarr = array('subject' => getstr($_POST['subject'], 80, 1, 1, 1), 'message' => getstr($_POST['message'], 0, 1, 1, 1), 'jointype' => empty($_POST['jointype']) ? '' : implode(',', $_POST['jointype']), 'joingid' => empty($_POST['joingid']) ? '' : implode(',', $_POST['joingid']), 'endtime' => $_POST['endtime'] ? sstrtotime($_POST['endtime']) : 0);
if (strlen($setarr['subject']) < 4) {
showmessage('topic_subject_error');
}
//封面
if ($_FILES['pic']['size'] && ($filearr = pic_save($_FILES['pic'], -1))) {
$setarr['pic'] = $filearr['filepath'];
$setarr['thumb'] = $filearr['thumb'];
$setarr['remote'] = $filearr['remote'];
}
if (empty($topicid)) {
$setarr['uid'] = $_SGLOBAL['supe_uid'];
$setarr['username'] = $_SGLOBAL['supe_username'];
$setarr['dateline'] = $setarr['lastpost'] = $_SGLOBAL['timestamp'];
$topicid = inserttable('topic', $setarr, 1);
} else {