当前位置: 首页>>代码示例>>PHP>>正文


PHP iPHP::str2time方法代码示例

本文整理汇总了PHP中iPHP::str2time方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::str2time方法的具体用法?PHP iPHP::str2time怎么用?PHP iPHP::str2time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iPHP的用法示例。


在下文中一共展示了iPHP::str2time方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_manage

 function do_manage()
 {
     $sql = " where 1=1";
     $cid = (int) $_GET['cid'];
     $tcid = (int) $_GET['tcid'];
     $pid = (int) $_GET['pid'];
     $rootid = (int) $_GET['rootid'];
     $_GET['keywords'] && ($sql .= " AND CONCAT(name,seotitle,subtitle,keywords,description) REGEXP '{$_GET['keywords']}'");
     $sql .= $this->categoryApp->search_sql($cid);
     $sql .= $this->tagcategory->search_sql($tcid, 'tcid');
     $_GET['starttime'] && ($sql .= " AND `pubdate`>='" . iPHP::str2time($_GET['starttime'] . " 00:00:00") . "'");
     $_GET['endtime'] && ($sql .= " AND `pubdate`<='" . iPHP::str2time($_GET['endtime'] . " 23:59:59") . "'");
     $_GET['post_starttime'] && ($sql .= " AND `postime`>='" . iPHP::str2time($_GET['post_starttime'] . " 00:00:00") . "'");
     $_GET['post_endtime'] && ($sql .= " AND `postime`<='" . iPHP::str2time($_GET['post_endtime'] . " 23:59:59") . "'");
     isset($_GET['pic']) && ($sql .= " AND `haspic` ='" . ($_GET['pic'] ? 1 : 0) . "'");
     if (isset($_GET['pid']) && $pid != '-1') {
         $uri_array['pid'] = $pid;
         if ($_GET['pid'] == 0) {
             $sql .= " AND `pid`=''";
         } else {
             iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
             map::init('prop', $this->appid);
             $map_where = map::where($pid);
         }
     }
     if ($map_where) {
         $map_sql = iCMS::map_sql($map_where);
         $sql = ",({$map_sql}) map {$sql} AND `id` = map.`iid`";
     }
     $orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC";
     $maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20;
     $total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__tags` {$sql}", "G");
     iPHP::pagenav($total, $maxperpage, "个标签");
     $limit = 'LIMIT ' . iPHP::$offset . ',' . $maxperpage;
     if ($map_sql || iPHP::$offset) {
         $ids_array = iDB::all("\n                SELECT `id` FROM `#iCMS@__tags` {$sql}\n                ORDER BY {$orderby} {$limit}\n            ");
         //iDB::debug(1);
         $ids = iCMS::get_ids($ids_array);
         $ids = $ids ? $ids : '0';
         $sql = "WHERE `id` IN({$ids})";
         $limit = '';
     }
     $rs = iDB::all("SELECT * FROM `#iCMS@__tags` {$sql} ORDER BY {$orderby} {$limit}");
     $_count = count($rs);
     include iACP::view("tags.manage");
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:46,代码来源:tags.app.php

示例2: do_saveproject

 function do_saveproject()
 {
     $id = (int) $_POST['id'];
     $name = iS::escapeStr($_POST['name']);
     $urls = iS::escapeStr($_POST['urls']);
     $list_url = $_POST['list_url'];
     $cid = iS::escapeStr($_POST['cid']);
     $rid = iS::escapeStr($_POST['rid']);
     $poid = iS::escapeStr($_POST['poid']);
     $poid = iS::escapeStr($_POST['poid']);
     $checker = iS::escapeStr($_POST['checker']);
     $self = isset($_POST['self']) ? '1' : '0';
     $sleep = (int) $_POST['sleep'];
     $auto = iS::escapeStr($_POST['auto']);
     $psleep = (int) $_POST['psleep'];
     $lastupdate = $_POST['lastupdate'] ? iPHP::str2time($_POST['lastupdate']) : '';
     empty($name) && iPHP::alert('名称不能为空!');
     empty($cid) && iPHP::alert('请选择绑定的栏目');
     empty($rid) && iPHP::alert('请选择采集规则');
     //empty($poid)	&& iPHP::alert('请选择发布规则');
     $fields = array('name', 'urls', 'list_url', 'cid', 'rid', 'poid', 'checker', 'self', 'sleep', 'auto', 'lastupdate', 'psleep');
     $data = compact($fields);
     if ($id) {
         iDB::update('spider_project', $data, array('id' => $id));
     } else {
         iDB::insert('spider_project', $data);
     }
     iPHP::success('完成', 'url:' . APP_URI . '&do=project');
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:29,代码来源:spider.app.php

示例3: do_save

 function do_save($callback = false)
 {
     $aid = (int) $_POST['aid'];
     $cid = (int) $_POST['cid'];
     $userid = (int) $_POST['userid'];
     $scid = implode(',', (array) $_POST['scid']);
     $pid = implode(',', (array) $_POST['pid']);
     $status = (int) $_POST['status'];
     $chapter = (int) $_POST['chapter'];
     $ordernum = _int($_POST['ordernum']);
     $_cid = iS::escapeStr($_POST['_cid']);
     $_pid = iS::escapeStr($_POST['_pid']);
     $_scid = iS::escapeStr($_POST['_scid']);
     $_tags = iS::escapeStr($_POST['_tags']);
     $title = iS::escapeStr($_POST['title']);
     $stitle = iS::escapeStr($_POST['stitle']);
     $pic = iS::escapeStr($_POST['pic']);
     $mpic = iS::escapeStr($_POST['mpic']);
     $spic = iS::escapeStr($_POST['spic']);
     $source = iS::escapeStr($_POST['source']);
     $author = iS::escapeStr($_POST['author']);
     $editor = iS::escapeStr($_POST['editor']);
     $description = iS::escapeStr($_POST['description']);
     $keywords = iS::escapeStr($_POST['keywords']);
     $tags = str_replace(',', ',', iS::escapeStr($_POST['tags']));
     $clink = iS::escapeStr($_POST['clink']);
     $url = iS::escapeStr($_POST['url']);
     $tpl = iS::escapeStr($_POST['tpl']);
     $metadata = iS::escapeStr($_POST['metadata']);
     $metadata = $metadata ? addslashes(serialize($metadata)) : '';
     $body = (array) $_POST['body'];
     $creative = (int) $_POST['creative'];
     iACP::CP($cid, $aid ? 'ce' : 'ca', 'alert');
     empty($_POST['pubdate']) && ($_POST['pubdate'] = get_date(0, 'Y-m-d H:i:s'));
     $pubdate = iPHP::str2time($_POST['pubdate']);
     $weight = _int($_POST['weight']);
     $postype = $_POST['postype'] ? $_POST['postype'] : 0;
     $ischapter = isset($_POST['ischapter']) ? 1 : 0;
     isset($_POST['inbox']) && ($status = "0");
     $tags && ($tags = preg_replace('/<[\\/\\!]*?[^<>]*?>/is', '', $tags));
     empty($title) && iPHP::alert('标题不能为空!');
     empty($cid) && iPHP::alert('请选择所属栏目');
     empty($body) && empty($url) && iPHP::alert('文章内容不能为空!');
     $userid or $userid = iMember::$userid;
     iFS::$userid = $userid;
     if (empty($aid) && iCMS::$config['publish']['repeatitle']) {
         articleTable::check_title($title) && iPHP::alert('该标题的文章已经存在!请检查是否重复');
     }
     if (strstr($this->category[$cid]['contentRule'], '{LINK}') !== false) {
         empty($clink) && ($clink = strtolower(pinyin($title)));
         if (empty($aid) && $clink) {
             articleTable::check_clink($clink) && iPHP::alert('该文章自定义链接已经存在!请检查是否重复');
         }
     }
     if (empty($description) && empty($url)) {
         $description = $this->autodesc($body);
     }
     stripos($pic, 'http://') === false or $pic = iFS::http($pic);
     stripos($mpic, 'http://') === false or $mpic = iFS::http($mpic);
     stripos($spic, 'http://') === false or $spic = iFS::http($spic);
     $haspic = empty($pic) ? 0 : 1;
     $SELFURL = __SELF__ . $_POST['REFERER'];
     if (empty($_POST['REFERER']) || strstr($_POST['REFERER'], '=save')) {
         $SELFURL = __SELF__ . '?app=article&do=manage';
     }
     $editor or $editor = empty(iMember::$data->nickname) ? iMember::$data->username : iMember::$data->nickname;
     // if($aid && $ischapter){
     //     $this->article_data($body,$aid);
     //     iDB::query("UPDATE `#iCMS@__article` SET `chapter`=chapter+1  WHERE `id` = '$aid'");
     //     iPHP::success('章节添加完成!','url:'.$SELFURL);
     // }
     iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
     $picdata = '';
     $ucid = 0;
     $fields = articleTable::fields($aid);
     if (empty($aid)) {
         $postime = $pubdate;
         $hits = 0;
         $good = $bad = $comments = 0;
         $ischapter && ($chapter = 1);
         $mobile = 0;
         $aid = articleTable::insert(compact($fields));
         if ($this->callback['primary']) {
             $PCB = $this->callback['primary'];
             $handler = $PCB[0];
             $params = (array) $PCB[1] + array('indexid' => $aid);
             if (is_callable($handler)) {
                 call_user_func_array($handler, $params);
             }
         }
         if ($tags) {
             iPHP::app('tag.class', 'static');
             tag::add($tags, $userid, $aid, $cid);
             //articleTable::update(compact('tags'),array('id'=>$aid));
         }
         map::init('prop', $this->appid);
         $pid && map::add($pid, $aid);
         map::init('category', $this->appid);
         map::add($cid, $aid);
         $scid && map::add($scid, $aid);
//.........这里部分代码省略.........
开发者ID:World3D,项目名称:iCMS,代码行数:101,代码来源:article.app.php

示例4: do_save

 function do_save()
 {
     $id = (int) $_POST['id'];
     $cid = (int) $_POST['cid'];
     $_cid = (int) $_POST['_cid'];
     $userid = (int) $_POST['userid'];
     $pid = (int) $_POST['pid'];
     $editor = iS::escapeStr($_POST['editor']);
     $ordernum = _int($_POST['ordernum']);
     $addtime = iPHP::str2time($_POST['addtime']);
     $title = iS::escapeStr($_POST['title']);
     $pic = $this->getpic($_POST['pic']);
     $description = iS::escapeStr($_POST['description']);
     $url = iS::escapeStr($_POST['url']);
     $title2 = iS::escapeStr($_POST['title2']);
     $pic2 = $this->getpic($_POST['pic2']);
     $description2 = iS::escapeStr($_POST['description2']);
     $url2 = iS::escapeStr($_POST['url2']);
     $title3 = iS::escapeStr($_POST['title3']);
     $pic3 = $this->getpic($_POST['pic3']);
     $description3 = iS::escapeStr($_POST['description3']);
     $url3 = iS::escapeStr($_POST['url3']);
     $metadata = iS::escapeStr($_POST['metadata']);
     $metadata = $metadata ? addslashes(serialize($metadata)) : '';
     empty($userid) && ($userid = iMember::$userid);
     empty($title) && iPHP::alert('1.标题必填');
     empty($cid) && iPHP::alert('请选择所属栏目');
     $haspic = empty($pic) ? 0 : 1;
     $status = 1;
     $fields = array('cid', 'rootid', 'pid', 'haspic', 'editor', 'userid', 'title', 'pic', 'url', 'description', 'title2', 'pic2', 'url2', 'description2', 'title3', 'pic3', 'url3', 'description3', 'ordernum', 'metadata', 'addtime', 'hits', 'status');
     $data = compact($fields);
     if (empty($id)) {
         iDB::insert('push', $data);
         iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 ");
         iPHP::success('推送完成', 'url:' . APP_URI);
     } else {
         iDB::update('push', $data, array('id' => $id));
         if ($_cid != $cid) {
             iDB::query("UPDATE `#iCMS@__category` SET `count` = count-1 WHERE `cid` ='{$_cid}' and `count`>0 LIMIT 1 ");
             iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 ");
         }
         iPHP::success('编辑完成!', 'url:' . APP_URI);
     }
 }
开发者ID:World3D,项目名称:iCMS,代码行数:44,代码来源:push.app.php

示例5: do_save

 function do_save()
 {
     $uid = (int) $_POST['uid'];
     $pid = implode(',', (array) $_POST['pid']);
     $_pid = iS::escapeStr($_POST['_pid']);
     $user = $_POST['user'];
     $userdata = $_POST['userdata'];
     $username = $user['username'];
     $nickname = $user['nickname'];
     $password = $user['password'];
     unset($user['password']);
     $username or iPHP::alert('账号不能为空');
     preg_match("/^[\\w\\-\\.]+@[\\w\\-]+(\\.\\w+)+\$/i", $username) or iPHP::alert('该账号格式不对');
     $nickname or iPHP::alert('昵称不能为空');
     $user['regdate'] = iPHP::str2time($user['regdate']);
     $user['lastlogintime'] = iPHP::str2time($user['lastlogintime']);
     $user['pid'] = $pid;
     iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
     if (empty($uid)) {
         $password or iPHP::alert('密码不能为空');
         $user['password'] = md5($password);
         iDB::value("SELECT `uid` FROM `#iCMS@__user` where `username` ='{$username}' LIMIT 1") && iPHP::alert('该账号已经存在');
         iDB::value("SELECT `uid` FROM `#iCMS@__user` where `nickname` ='{$nickname}' LIMIT 1") && iPHP::alert('该昵称已经存在');
         $uid = iDB::insert('user', $user);
         map::init('prop', iCMS_APP_USER);
         $pid && map::add($pid, $uid);
         $msg = "账号添加完成!";
     } else {
         iDB::value("SELECT `uid` FROM `#iCMS@__user` where `username` ='{$username}' AND `uid` !='{$uid}' LIMIT 1") && iPHP::alert('该账号已经存在');
         iDB::value("SELECT `uid` FROM `#iCMS@__user` where `nickname` ='{$nickname}' AND `uid` !='{$uid}' LIMIT 1") && iPHP::alert('该昵称已经存在');
         $password && ($user['password'] = md5($password));
         iDB::update('user', $user, array('uid' => $uid));
         map::init('prop', iCMS_APP_USER);
         map::diff($pid, $_pid, $uid);
         if (iDB::value("SELECT `uid` FROM `#iCMS@__user_data` where `uid`='{$uid}' LIMIT 1")) {
             iDB::update('user_data', $userdata, array('uid' => $uid));
         } else {
             $userdata['uid'] = $uid;
             iDB::insert('user_data', $userdata);
         }
         $msg = "账号修改完成!";
     }
     iPHP::success($msg, 'url:' . APP_URI);
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:44,代码来源:user.app.php


注:本文中的iPHP::str2time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。