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


PHP CMS::time方法代码示例

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


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

示例1: afterFind

 public function afterFind()
 {
     parent::afterFind();
     if (CMS::time() >= strtotime($this->date_end)) {
         $this->switch = 0;
         $this->save(false);
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:BSAds.php

示例2: beforeSave

 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         //create
         if ($this->isNewRecord) {
             if (isset($this->tableSchema->columns['ip_create'])) {
                 //Текущий IP адресс, автора добавление
                 $this->ip_create = Yii::app()->request->userHostAddress;
             }
             if (isset($this->tableSchema->columns['user_id'])) {
                 $this->user_id = Yii::app()->user->isGuest ? 0 : Yii::app()->user->id;
             }
             if (isset($this->tableSchema->columns['user_agent'])) {
                 $this->user_agent = Yii::app()->request->userAgent;
             }
             if (isset($this->tableSchema->columns['date_create'])) {
                 // $this->date_create = date('Y-m-d H:i:s');
                 $this->date_create = date('Y-m-d H:i:s', CMS::time());
             }
             if (isset($this->tableSchema->columns['ordern'])) {
                 if (!isset($this->ordern)) {
                     $row = $this->model()->find(array('select' => 'max(ordern) AS maxOrdern'));
                     $this->ordern = $row['maxOrdern'] + 1;
                 }
             }
         } else {
             //update
             if (isset($this->tableSchema->columns['date_update'])) {
                 $this->date_update = date('Y-m-d H:i:s');
             }
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:36,代码来源:BSAbstractDb.php

示例3: controlTimeout

 /**
  * Определяет таймаут управление комментарием
  * @return bool
  */
 public function controlTimeout()
 {
     $stime = strtotime($this->date_create) + Yii::app()->settings->get('comments', 'control_timeout');
     return CMS::time() < $stime || Yii::app()->user->isSuperuser ? true : false;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:9,代码来源:Comments.php

示例4: actionCreate

 public function actionCreate()
 {
     $owner_title = $_POST['owner_title'];
     $modelName = $_POST['model'];
     $objID = $_POST['object_id'];
     $comment = new Comments();
     $request = Yii::app()->request;
     if ($request->isPostRequest && $request->isAjaxRequest) {
         $comment->attributes = $request->getPost('Comments');
         $comment->model = $modelName;
         $comment->owner_title = $owner_title;
         $comment->object_id = $objID;
         if ($comment->validate()) {
             $comment->saveNode();
             echo CJSON::encode(array('success' => true, 'message' => 'Комментарий будет опубликован после проверки'));
             Yii::app()->end();
             Yii::app()->session['caf'] = CMS::time();
         }
     }
     return $comment;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:21,代码来源:DefaultController.php


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