本文整理汇总了PHP中PwStrtoTime函数的典型用法代码示例。如果您正苦于以下问题:PHP PwStrtoTime函数的具体用法?PHP PwStrtoTime怎么用?PHP PwStrtoTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PwStrtoTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ifUpdateCache
/**
* @param $tag
* @param $result
* @return unknown_type
*/
function ifUpdateCache($md5key)
{
if (file_exists($this->filepath)) {
$dcache = L::config(null, $this->filename);
$overtime = (int) ($dcache['_overtime'] + 60 * 10);
$nowtime = PwStrtoTime(get_date(time(), "Y-m-d H:i:s"));
if ($overtime <= $nowtime || $md5key != $dcache['_md5key']) {
return true;
}
return false;
} else {
return true;
}
}
示例2: _getHotArticle
function _getHotArticle($type, $columnid, $num)
{
global $timestamp;
$date = PwStrtoTime(get_date($timestamp, 'Y-m-d'));
$tempDate = $type == 'hotday' ? 1 : 30;
$date = $date - $tempDate * 86400;
$datanalyseService = $this->_getDatanalyseService();
$_action = array();
foreach ($columnid as $value) {
$_action[] = 'article_' . $value;
}
if (!$columnid) {
$_action = $datanalyseService->getAllActions('article');
}
return $datanalyseService->getHotArticleByAction('article', $_action, $num, $date);
}
示例3: _updateDb
/**
* 更新到pw_searchstatistic表中
*/
function _updateDb()
{
$fileContent = $this->_getAllKeywords();
$data = s::isArray($fileContent) ? array_count_values($fileContent) : array();
$nowtime = PwStrtoTime(get_date($this->_timestamp, 'Y-m-d'));
$sql = array();
foreach ($data as $key => $val) {
$key = trim($this->_filterCheckKeyword($key));
if (!$key) {
continue;
}
$sql[] = array($key, $val, $nowtime);
}
if (!$sql) {
return false;
}
$this->_db->query("INSERT INTO pw_searchstatistic(keyword,num,created_time) VALUES " . S::sqlMulti($sql));
$deleteTime = $this->_timestamp - 86400 * 90;
$this->_db->query("DELETE FROM pw_searchstatistic WHERE created_time < {$deleteTime}");
return true;
}
示例4: _setData
function _setData()
{
$this->data['subject'] = S::escapeChar(S::getGP('act_subject', 'P'));
$this->data['location'] = S::escapeChar(S::getGP('act_location', 'P'));
$this->data['sexneed'] = intval(S::getGP('act_sex'));
$act_starttime = S::escapeChar(S::getGP('act_starttime'));
$act_deadline = S::escapeChar(S::getGP('act_deadline'));
$act_endtime = S::escapeChar(S::getGP('act_endtime'));
$act_num = intval(S::getGP('act_num'));
$act_costs = intval(S::getGP('act_costs'));
!($this->data['subject'] && $act_starttime && $act_deadline) && Showmsg('active_data_empty');
$act_starttime = PwStrtoTime($act_starttime);
$act_endtime = PwStrtoTime($act_endtime);
$act_deadline = PwStrtoTime($act_deadline);
$act_num < 1 && ($act_num = 0);
$act_costs < 1 && ($act_costs = 0);
$this->data['starttime'] = $act_starttime;
$this->data['deadline'] = $act_deadline;
$this->data['endtime'] = $act_endtime;
$this->data['num'] = $act_num;
$this->data['costs'] = $act_costs;
}
示例5: _setData
function _setData()
{
global $timestamp;
$endtime = S::escapeChar(S::getGP('endtime'));
$obtitle = S::escapeChar(S::getGP('obtitle'));
$retitle = S::escapeChar(S::getGP('retitle'));
$umpire = S::escapeChar(S::getGP('umpire'));
$endtime = PwStrtoTime($endtime);
$endtime < $timestamp && Showmsg('debate_time');
if (empty($obtitle) || empty($retitle)) {
Showmsg('debate_notitle');
} elseif (strlen($obtitle) > 255 || strlen($retitle) > 255) {
Showmsg('debate_titlelen');
}
if ($umpire) {
$umpireuid = $this->db->get_value("SELECT uid FROM pw_members WHERE username=" . S::sqlEscape($umpire));
empty($umpireuid) && Showmsg('debate_noumpire');
}
$this->data['endtime'] = $endtime;
$this->data['obtitle'] = $obtitle;
$this->data['retitle'] = $retitle;
$this->data['umpire'] = $umpire;
$this->data['postdate'] = $timestamp;
}
示例6: getPosition
}
$pagePosition = getPosition($articleModule->columnId, '', '', $cms_sitename);
$columnService = C::loadClass('columnservice');
/* @var $columnService PW_columnService */
$columns = $columnService->getAllOrderColumns(0, $windid);
$attach = initAttach($articleModule->attach);
$postdate = get_date($articleModule->postDate);
$atc_content = $articleModule->getPageContent($page);
$articleModule->showError();
$pages = $articleModule->getPages($page, CMS_BASEURL . 'q=post&action=edit&id=' . $id . '&');
list($attachAllow, $imageAllow) = initFileTypeInfo($db_uploadfiletype);
require_once M_P . 'require/header.php';
} else {
S::gp(array('cms_subject', 'atc_content', 'cms_descrip'), 'P', 0);
S::gp(array('cms_sourcetype', 'cms_sourceid', 'cid', 'cms_jumpurl', 'cms_author', 'cms_frominfo', 'cms_fromurl', 'cms_relate', 'flashatt', 'oldatt_desc', 'addnewpage', 'cms_timelimit'));
$cms_timelimit = $cms_timelimit && (isGM($windid) || checkEditPurview($windid)) ? PwStrtoTime($cms_timelimit) : $timestamp;
$cms_jumpurl = $cms_jumpurl && (isGM($windid) || checkEditPurview($windid)) ? $cms_jumpurl : '';
PostCheck();
$articleModule->setSubject($cms_subject);
$articleModule->setContent($atc_content, $page);
$articleModule->setDescrip($cms_descrip);
$articleModule->setColumnId($cid);
$articleModule->setJumpUrl($cms_jumpurl);
$articleModule->setPostDate($cms_timelimit);
$articleModule->setModifyDate($timestamp);
$articleModule->setFromInfo($cms_frominfo);
$articleModule->setFromUrl($cms_fromurl);
$articleModule->setAuthor($cms_author);
$articleModule->setUser($windid);
$articleModule->setUserId($winduid);
$articleModule->setRelate($cms_relate);
示例7: _getTodayThreads
/**
* 获取当日帖子
* @param $page
* @param $perpage
* @return unknown_type
*/
function _getTodayThreads($page, $perpage = 50)
{
$page = intval($page);
$perpage = intval($perpage);
if (1 > $page || 1 > $perpage) {
return false;
}
$offset = ($page - 1) * $perpage;
$posttime = PwStrtoTime(get_date($this->_timestamp, 'Y-m-d'));
$threadsDao = $this->getThreadsDao();
if (!($total = $threadsDao->getThreadsCountByPostdate($posttime))) {
return array(false, false);
}
$result = $threadsDao->getThreadsByPostdate($offset, $perpage, $posttime);
return array($total, $this->_buildThreads($result, array()));
}
示例8: _getdate
/**
* 处理日期
*
* @param string $day 'Y-m-d'
* @return int
*/
function _getdate($day)
{
$this->day = $day == null ? get_date($GLOBALS['timestamp'], 'Y-m-d') : get_date(PwStrtoTime($day), 'Y-m-d');
}
示例9: Showmsg
Showmsg('illegal_customimg');
}
$proicon = $httpurl[0];
$httpurl[1] = '';
$httpurl[2] = '';
$httpurl[3] = (int) $httpurl[3];
$httpurl[4] = (int) $httpurl[4];
list($user_a[2], $user_a[3]) = flexlen($httpurl[1], $httpurl[2], $httpurl[3], $httpurl[4]);
$usericon = setIcon($proicon, $facetype, $user_a);
unset($httpurl);
}
pwFtpClose($ftp);
$usericon && ($upmembers['icon'] = $usericon);
$bday = $year . "-" . $month . "-" . $day;
//$rvrc*=10;
$regdate = PwStrtoTime($regdate);
if ($oldinfo['username'] != stripcslashes($username)) {
if (!$username) {
Showmsg('username_empty');
}
if (strlen($username) > 15) {
adminmsg('用户名长度不能大于15个字符');
}
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$isUsernameExist = $userService->getUserIdByUserName($username);
if ($isUsernameExist > 0) {
adminmsg('username_exists');
}
$uc_edit['username'] = $username;
}
示例10: attachcheck
function attachcheck($file)
{
global $cache_file, $attachdir, $admin_pwd, $filename, $filesize, $ifless, $postdate1, $postdate2, $direct, $attachdir;
if ($filename && strpos($file, $filename) === false) {
return;
}
if ($filesize) {
if ($ifless && filesize("{$attachdir}/{$file}") >= $filesize * 1024) {
return;
} elseif (!$ifless && filesize("{$attachdir}/{$file}") <= $filesize * 1024) {
return;
}
}
if ($postdate1) {
$visittime = PwStrtoTime($postdate1);
if (is_numeric($visittime) && fileatime("{$attachdir}/{$file}") < $visittime) {
return;
}
}
if ($postdate2) {
$visittime = PwStrtoTime($postdate2);
if (is_numeric($visittime) && fileatime("{$attachdir}/{$file}") > $visittime) {
return;
}
}
if ($_POST['direct']) {
P_unlink("{$attachdir}/{$file}");
P_unlink("{$attachdir}/thumb/{$file}");
} else {
strlen($file) > 49 && ($file = substr($file, 0, 49));
writeover($cache_file, str_pad($file, 49) . "\n", "ab");
//* pwCache::setData($cache_file,str_pad($file,49)."\n", false, "ab");
}
}
示例11: PrintEot
$a = 'toptopic';
require_once PrintEot('m_ajax');
footer();
} else {
if (is_numeric($seltid)) {
${'topped_' . intval($threaddb[$seltid]['topped'])} = 'checked';
}
require_once PrintEot('m_topicadmin');
footer();
}
} else {
S::gp(array('ifmsg', 'timelimit'));
PostCheck();
is_null($topped) && Showmsg('mawhole_notopped');
$msgdb = $logdb = array();
$timelimit = PwStrtoTime($timelimit);
$toolfield = $timelimit > $timestamp && $topped ? $timelimit : '';
$query = $db->query("SELECT t.tid,t.fid,t.postdate,t.author,t.authorid,t.subject,a.topped,a.toolfield FROM pw_threads t LEFT JOIN pw_argument a ON t.tid=a.tid WHERE t.tid IN(" . S::sqlImplode($selids) . ")");
$tid_fid = array();
while ($rt = $db->fetch_array($query)) {
$tid_fid[$rt['tid']] = $rt['fid'];
if ($topped && $topped != $rt['topped']) {
if ($ifmsg) {
$msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'top_title'), 'content' => getLangInfo('writemsg', 'top_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
}
$logdb[] = array('type' => 'topped', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $tid, 'field3' => '', 'descrip' => 'topped_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'topped' => $topped, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
} elseif ($rt['topped'] && !$topped) {
if ($ifmsg) {
$msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'untop_title'), 'content' => getLangInfo('writemsg', 'untop_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
}
$logdb[] = array('type' => 'topped', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => 'untopped_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
示例12: adminmsg
adminmsg('advert_flash_error');
}
if ($config['type'] == 'flash') {
$config['width'] = $config['width'] == "" ? "120" : $config['width'];
$config['height'] = $config['height'] == "" ? "120" : $config['height'];
}
if (empty($advert['descrip'])) {
if ($config['type'] == 'code') {
$advert['descrip'] = substrs(strip_tags($config['htmlcode']), 250);
} elseif ($config['type'] == 'txt') {
$advert['descrip'] = substrs($config['title'], 250);
}
empty($advert['descrip']) && ($basename = "javascript:history.go(-1);" && adminmsg('advert_descrip'));
}
$advert['stime'] = PwStrtoTime($advert['stime']);
$advert['etime'] = PwStrtoTime($advert['etime']) + 86399;
if ($advert['stime'] > $advert['etime']) {
$basename = "javascript:history.go(-1);";
adminmsg('advert_time_error');
}
$config['ddate'] = $config['dweek'] = $config['dtime'] = '';
if (is_array($ddate)) {
$config['ddate'] = implode(',', $ddate);
}
if (is_array($dweek)) {
$config['dweek'] = implode(',', $dweek);
}
if (is_array($dtime) && count($dtime) < 24) {
$config['dtime'] = implode(',', $dtime);
}
$advert['orderby'] = (int) $advert['orderby'];
示例13: getValueForDb
/**
* 生成字段保存于数据库的值
* @param string $fieldType 字段类型
* @param mix $data 值
* @return string 保存于数据库的值
*/
function getValueForDb($fieldType, $data)
{
$returnValue = $data;
switch ($fieldType) {
case 'number':
case 'range':
break;
case 'text':
case 'textarea':
break;
case 'radio':
//radio和select使用同一方法
//radio和select使用同一方法
case 'select':
$returnValue = (int) $data;
break;
case 'checkbox':
$returnValue = '';
foreach ($data as $selection) {
$returnValue .= (int) $selection . ',';
}
break;
case 'calendar':
$returnValue = PwStrtoTime($data);
break;
case 'email':
case 'url':
case 'img':
case 'upload':
default:
break;
}
return $returnValue;
}
示例14: intval
$online = 'no';
} else {
$db_online = intval($db_online);
include_once Pcv(R_P . "require/online_{$db_online}.php");
}
}
Cookie('online', $online);
}
$usertotal = $guestinbbs + $userinbbs;
$showgroup = $db_showgroup ? explode(',', $db_showgroup) : array();
// Share union
if ($db_indexmqshare && $sharelink[1]) {
$sharelink[1] = "<marquee scrolldelay=\"100\" scrollamount=\"4\" onmouseout=\"if (document.all!=null){this.start()}\" onmouseover=\"if (document.all!=null){this.stop()}\" behavior=\"alternate\">{$sharelink['1']}</marquee>";
}
//update pw_feed
if ($winduid && PwStrtoTime(get_date($lastvisit, 'Y-m-d')) < $tdtime && $db_hostweb == 1 && !$cateid && $groupid != 'guest' && !defined('M_P')) {
$_flag = $db->get_value("SELECT id FROM pw_feed WHERE uid = " . pwEscape($winduid) . " ORDER BY id DESC LIMIT 29,1");
$_flag && $db->update("DELETE FROM pw_feed WHERE uid = " . pwEscape($winduid) . " AND id < " . pwEscape($_flag));
}
if ($tdtcontrol < $tdtime && $db_hostweb == 1 && !$cateid && $groupid != 'guest' && !defined('M_P')) {
require_once R_P . 'require/updateforum.php';
updateshortcut();
$db->update("UPDATE pw_bbsinfo SET" . pwSqlSingle(array('yposts' => $tposts, 'tdtcontrol' => $tdtime, 'o_tpost' => 0)) . "WHERE id='1'");
$db->update("UPDATE pw_forumdata SET tpost=0 WHERE tpost<>'0'");
// $db->update("DELETE FROM pw_feed WHERE timestamp<".pwEscape($tdtime - 604800));
}
// update posts hits
if ($c_htm || $db_hithour) {
$db_hithour == 0 && ($db_hithour = 4);
$hit_wtime = $hit_control * $db_hithour;
$hit_wtime > 24 && ($hit_wtime = 0);
示例15: _isValidStartAndEndTime
/**
* 开始时间是否早于结束时间
* @param string $start 开始时间,如'2010-04-09 11:00:00'
* @param string $end 结束时间,如'2010-04-09 12:00:00'
* @access protected
* @return bool 时间是否有效
*/
function _isValidStartAndEndTime($start, $end)
{
if ($this->getCalendarError($start) || $this->getCalendarError($end)) {
return false;
} else {
$startTimestamp = PwStrtoTime($start);
$endTimestamp = PwStrtoTime($end);
if ($startTimestamp > $endTimestamp) {
return false;
} else {
return true;
}
}
}