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


PHP Utility::dateFormat方法代码示例

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


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

示例1: actionIndexing

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndexing()
 {
     ini_set('max_execution_time', 0);
     ob_start();
     $index = new Zend_Search_Lucene(Yii::getPathOfAlias($this->_indexFilesPath), true);
     $criteria = new CDbCriteria();
     $criteria->compare('t.publish', 1);
     $criteria->order = 'album_id DESC';
     //$criteria->limit = 10;
     $model = Albums::model()->findAll($criteria);
     foreach ($model as $key => $item) {
         if ($item->media_id != 0) {
             $images = Yii::app()->request->baseUrl . '/public/album/' . $item->album_id . '/' . $item->cover->media;
         } else {
             $images = '';
         }
         $doc = new Zend_Search_Lucene_Document();
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('id', CHtml::encode($item->album_id), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('media', CHtml::encode($images), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('title', CHtml::encode($item->title), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('body', CHtml::encode(Utility::hardDecode(Utility::softDecode($item->body))), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('url', CHtml::encode(Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('album/site/view', array('id' => $item->album_id, 't' => Utility::getUrlTitle($item->title)))), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('date', CHtml::encode(Utility::dateFormat($item->creation_date, true) . ' WIB'), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('creation', CHtml::encode($item->user->displayname), 'utf-8'));
         $index->addDocument($doc);
     }
     echo 'Album Lucene index created';
     $index->commit();
     $this->redirect(Yii::app()->createUrl('article/search/indexing'));
     ob_end_flush();
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:35,代码来源:SearchController.php

示例2: array

<?php

/**
 * Banners (banners)
 * @var $this AdminController
 * @var $model Banners
 *
 * @author Putra Sudaryanto <putra@sudaryanto.id>
 * @copyright Copyright (c) 2014 Ommu Platform (ommu.co)
 * @link https://github.com/oMMu/Ommu-Banner
 * @contect (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Banners' => array('manage'), $model->title);
?>

<div class="box">
	<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array(array('name' => 'cat_id', 'value' => Phrase::trans($model->category_relation->name, 2)), 'title', array('name' => 'url', 'value' => CHtml::link($model->url, $model->url, array('target' => '_blank')), 'type' => 'raw'), array('name' => 'url', 'value' => CHtml::link($model->media, Yii::app()->request->baseUrl . '/public/banner/' . $model->media, array('target' => '_blank')), 'type' => 'raw'), array('name' => 'published_date', 'value' => Utility::dateFormat($model->published_date)), array('name' => 'expired_date', 'value' => Utility::dateFormat($model->expired_date)), 'view', 'click', array('name' => 'creation_date', 'value' => Utility::dateFormat($model->creation_date, true)), array('name' => 'creation_id', 'value' => $model->creation_relation->displayname), array('name' => 'modified_date', 'value' => Utility::dateFormat($model->modified_date, true)), array('name' => 'modified_id', 'value' => $model->modified_relation->displayname), array('name' => 'publish', 'value' => $model->publish == 1 ? Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/publish.png') : Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/unpublish.png'), 'type' => 'raw'))));
?>
</div>
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:21,代码来源:admin_view.php

示例3:

?>
"><img src="<?php 
echo $images;
?>
" alt="<?php 
echo $data->user->displayname;
?>
"></a>
	</div>
	<div class="comment">
		<h4>
			<?php 
if ($data->modified_date == '0000-00-00 00:00:00') {
    $date = Utility::dateFormat($data->creation_date, true);
} else {
    $date = 'Edited: ' . Utility::dateFormat($data->modified_date, true);
}
?>
			<a href="javascript:void(0);" title="<?php 
echo $data->user->displayname;
?>
"><?php 
echo $data->user->displayname;
?>
</a> / 
			<?php 
echo $date;
?>
		</h4>
		<?php 
echo $data->comment;
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:31,代码来源:_view.php

示例4: array

            }
        }
        ?>
			<a class="img" href="<?php 
        echo Yii::app()->createUrl('article/' . $controller . '/view', array('id' => $val->article_id, 't' => Utility::getUrlTitle($val->title)));
        ?>
" title="<?php 
        echo $val->title;
        ?>
"><img src="<?php 
        echo Utility::getTimThumb($media, 400, 270, 1);
        ?>
"></a> 
			<div class="date">
				<?php 
        echo Utility::dateFormat($val->creation_date, true);
        ?>
				<?php 
        //begin.Tools
        ?>
				<div class="tools">
					<?php 
        if (Yii::app()->params['article_mod_comment'] == 1) {
            ?>
<span class="comment"><?php 
            echo $val->comment;
            ?>
</span><?php 
        }
        ?>
					<?php 
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:31,代码来源:front_article_headline.php

示例5: array

    ?>
" />
		</a>
		<a class="title" href="<?php 
    echo Yii::app()->controller->createUrl('view', array('id' => $data->article_id, 't' => Utility::getUrlTitle($data->title)));
    ?>
" title="<?php 
    echo $data->title;
    ?>
"><?php 
    echo Utility::hardDecode($data->title);
    ?>
</a>
		<div class="meta">
			<i class="fa fa-calendar-check-o"></i><?php 
    echo Utility::dateFormat($data->published_date);
    ?>
			<?php 
    if ($data->media_file != '') {
        ?>
<i class="fa fa-download"></i><?php 
        echo $data->download;
    }
    ?>
			<i class="fa fa-eye"></i><?php 
    echo $data->view;
    ?>
		</div>
		<p><?php 
    echo Utility::shortText(Utility::hardDecode($data->body), 100);
    ?>
开发者ID:oMMuCo,项目名称:ECC-HPTT-Website,代码行数:31,代码来源:_view.php

示例6: array

<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array('article_id', 'publish', 'cat_id', 'user_id', 'media_id', 'headline', 'comment_code', 'article_type', 'title', 'body', 'quote', 'media_file', 'published_date', 'comment', 'view', 'likes', 'download', 'creation_date', 'modified_date')));
?>

<?php 
if ($random != null) {
    foreach ($random as $key => $row) {
        ?>
		<a href="<?php 
        echo Yii::app()->controller->createUrl('view', array('id' => $row->article_id, 't' => Utility::getUrlTitle($row->title)));
        ?>
" title="<?php 
        echo $row->title;
        ?>
"><?php 
        echo Utility::shortText(Utility::hardDecode($row->title), 40);
        ?>
</a>
		<br/><?php 
        echo Utility::dateFormat($row->published_date, true);
        ?>
		<br/><?php 
        echo $row->view;
        ?>
		<p><?php 
        echo Utility::shortText(Utility::hardDecode($row->body), 100);
        ?>
</p>
<?php 
    }
}
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:31,代码来源:front_view.php

示例7: array

<?php

/**
 * Users (users)
 * @var $this AdminController
 * @var $model Users
 *
 * @author Putra Sudaryanto <putra@sudaryanto.id>
 * @copyright Copyright (c) 2016 Ommu Platform (ommu.co)
 * @created date 25 February 2016, 15:47 WIB
 * @link http://company.ommu.co
 * @contect (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Users' => array('manage'), $model->user_id);
?>

<div class="dialog-content">
<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array(array('name' => 'user_id', 'value' => $model->user_id), array('name' => 'source_id', 'value' => $model->source_id), array('name' => 'level_id', 'value' => $model->level_id), array('name' => 'profile_id', 'value' => $model->profile_id), array('name' => 'language_id', 'value' => $model->language_id), array('name' => 'email', 'value' => $model->email), array('name' => 'displayname', 'value' => $model->displayname), array('name' => 'photos', 'value' => $model->photos != '' ? CHtml::link($model->photos, $model->photos, array('target' => '_blank')) : '-', 'type' => 'raw'), array('name' => 'enabled', 'value' => $model->enabled), array('name' => 'verified', 'value' => $model->verified), array('name' => 'creation_date', 'value' => Utility::dateFormat($model->creation_date, true)), array('name' => 'creation_ip', 'value' => $model->creation_ip), array('name' => 'lastlogin_date', 'value' => Utility::dateFormat($model->lastlogin_date, true)), array('name' => 'lastlogin_ip', 'value' => $model->lastlogin_ip), array('name' => 'lastlogin_from', 'value' => $model->lastlogin_from))));
?>
</div>
<div class="dialog-submit">
	<?php 
echo CHtml::button(Yii::t('phrase', 'Close'), array('id' => 'closed'));
?>
</div>
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:27,代码来源:admin_view.php

示例8: array

<?php

/**
 * Album Categories (album-category)
 * @var $this CategoryController
 * @var $model AlbumCategory
 * version: 0.1.4
 *
 * @author Putra Sudaryanto <putra@sudaryanto.id>
 * @copyright Copyright (c) 2016 Ommu Platform (ommu.co)
 * @created date 26 August 2016, 23:10 WIB
 * @link https://github.com/oMMu/Ommu-Photo-Albums
 * @contect (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Album Categories' => array('manage'), $model->name);
?>

<div class="dialog-content">
	<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array(array('name' => 'cat_id', 'value' => $model->cat_id), array('name' => 'publish', 'value' => $model->publish == '1' ? Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/publish.png') : Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/unpublish.png')), array('name' => 'name', 'value' => $model->name), array('name' => 'desc', 'value' => $model->desc), array('name' => 'default', 'value' => $model->default), array('name' => 'default_setting', 'value' => $model->default_setting), array('name' => 'photo_limit', 'value' => $model->photo_limit), array('name' => 'photo_resize', 'value' => $model->photo_resize), array('name' => 'photo_resize_size', 'value' => $model->photo_resize_size != '' ? $model->photo_resize_size : '-', 'type' => 'raw'), array('name' => 'photo_view_size', 'value' => $model->photo_view_size != '' ? $model->photo_view_size : '-', 'type' => 'raw'), array('name' => 'creation_date', 'value' => !in_array($model->creation_date, array('0000-00-00 00:00:00', '1970-01-01 00:00:00')) ? Utility::dateFormat($model->creation_date, true) : '-'), array('name' => 'creation_id', 'value' => $model->creation_id), array('name' => 'modified_date', 'value' => !in_array($model->modified_date, array('0000-00-00 00:00:00', '1970-01-01 00:00:00')) ? Utility::dateFormat($model->modified_date, true) : '-'), array('name' => 'modified_id', 'value' => $model->modified_id))));
?>
</div>
<div class="dialog-submit">
	<?php 
echo CHtml::button(Yii::t('phrase', 'Close'), array('id' => 'closed'));
?>
</div>
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:28,代码来源:admin_view.php

示例9: array

/**
 * User Verify (user-verify)
 * @var $this VerifyController
 * @var $model UserVerify
 * version: 1.1.0
 *
 * @author Putra Sudaryanto <putra@sudaryanto.id>
 * @copyright Copyright (c) 2012 Ommu Platform (ommu.co)
 * @link https://github.com/oMMu/Ommu-Core
 * @contact (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('User Verifies' => array('manage'), 'Create');
?>

<div class="boxed">
	<?php 
echo Phrase::trans($model->desc, 2);
?>
	<div class="date">
		<?php 
if ($model->modified_date != '0000-00-00 00:00:00') {
    echo 'Edited: ' . Utility::dateFormat($model->modified_date, true) . ' by ' . $model->modified->displayname;
} else {
    echo Utility::dateFormat($model->creation_date, true) . ' by ' . $model->user->displayname;
}
?>
	<?php 
?>
	</div>
</div>
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:31,代码来源:front_page.php

示例10: actionIndexing

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndexing()
 {
     ini_set('max_execution_time', 0);
     ob_start();
     $index = new Zend_Search_Lucene(Yii::getPathOfAlias($this->_indexFilesPath), true);
     $criteria = new CDbCriteria();
     $now = new CDbExpression("NOW()");
     $criteria->compare('t.publish', 1);
     $criteria->compare('date(published_date) <', $now);
     $criteria->order = 'article_id DESC';
     //$criteria->limit = 10;
     $model = Articles::model()->findAll($criteria);
     foreach ($model as $key => $item) {
         if ($item->media_id != 0) {
             $images = Yii::app()->request->baseUrl . '/public/article/' . $item->article_id . '/' . $item->cover->media;
         } else {
             $images = '';
         }
         if (in_array($item->cat_id, array(2, 3, 5, 6, 7, 18))) {
             $url = Yii::app()->createUrl('article/news/site/view', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
         } else {
             if (in_array($item->cat_id, array(9))) {
                 $url = Yii::app()->createUrl('article/site/view', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
             } else {
                 if (in_array($item->cat_id, array(10, 15, 16))) {
                     $url = Yii::app()->createUrl('article/archive/site/view', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
                 } else {
                     if (in_array($item->cat_id, array(23, 24, 25))) {
                         $url = Yii::app()->createUrl('article/newspaper/site/view', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
                     } else {
                         if (in_array($item->cat_id, array(13, 14, 20, 21))) {
                             $url = Yii::app()->createUrl('article/regulation/site/download', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
                         } else {
                             if (in_array($item->cat_id, array(19))) {
                                 $url = Yii::app()->createUrl('article/announcement/site/download', array('id' => $item->article_id, 't' => Utility::getUrlTitle($item->title)));
                             }
                         }
                     }
                 }
             }
         }
         $doc = new Zend_Search_Lucene_Document();
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('id', CHtml::encode($item->article_id), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Keyword('category', CHtml::encode(Phrase::trans($item->cat->name, 2)), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('media', CHtml::encode($images), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('title', CHtml::encode($item->title), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('body', CHtml::encode(Utility::hardDecode(Utility::softDecode($item->body))), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('url', CHtml::encode(Utility::getProtocol() . '://' . Yii::app()->request->serverName . $url), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('date', CHtml::encode(Utility::dateFormat($item->published_date, true) . ' WIB'), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('creation', CHtml::encode($item->user->displayname), 'utf-8'));
         $index->addDocument($doc);
     }
     echo 'Artkel Lucene index created';
     $index->commit();
     $this->redirect(Yii::app()->createUrl('video/search/indexing'));
     ob_end_flush();
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:61,代码来源:SearchController.php

示例11: array

 *
 * @author Putra Sudaryanto <putra@sudaryanto.id>
 * @copyright Copyright (c) 2016 Ommu Platform (ommu.co)
 * @created date 24 March 2016, 10:20 WIB
 * @link https://github.com/oMMu/Ommu-Core
 * @contect (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Ommu Menus' => array('manage'), $model->name);
?>

<?php 
//begin.Messages
if (Yii::app()->user->hasFlash('success')) {
    echo Utility::flashSuccess(Yii::app()->user->getFlash('success'));
}
//end.Messages
?>

<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array(array('name' => 'id', 'value' => $model->id), array('name' => 'publish', 'value' => $model->publish == '1' ? Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/publish.png') : Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/unpublish.png')), array('name' => 'cat_id', 'value' => $model->cat_id), array('name' => 'dependency', 'value' => $model->dependency), array('name' => 'orders', 'value' => $model->orders), array('name' => 'name', 'value' => $model->name), array('name' => 'url', 'value' => $model->url), array('name' => 'attr', 'value' => $model->attr), array('name' => 'sitetype_access', 'value' => $model->sitetype_access), array('name' => 'userlevel_access', 'value' => $model->userlevel_access), array('name' => 'creation_date', 'value' => !in_array($model->creation_date, array('0000-00-00 00:00:00', '1970-01-01 00:00:00')) ? Utility::dateFormat($model->creation_date, true) : '-'), array('name' => 'creation_id', 'value' => $model->creation_id), array('name' => 'modified_date', 'value' => !in_array($model->modified_date, array('0000-00-00 00:00:00', '1970-01-01 00:00:00')) ? Utility::dateFormat($model->modified_date, true) : '-'), array('name' => 'modified_id', 'value' => $model->modified_id))));
?>

<div class="dialog-content">
</div>
<div class="dialog-submit">
	<?php 
echo CHtml::button(Yii::t('phrase', 'Close'), array('id' => 'closed'));
?>
</div>
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:30,代码来源:admin_view.php

示例12: array

    ?>
" />
		</a>
		<a class="title" href="<?php 
    echo Yii::app()->controller->createUrl('view', array('id' => $data->album_id, 't' => Utility::getUrlTitle($data->title)));
    ?>
" title="<?php 
    echo $data->title;
    ?>
"><?php 
    echo Utility::hardDecode($data->title);
    ?>
</a>
		<div class="meta">
			<i class="fa fa-calendar-check-o"></i><?php 
    echo Utility::dateFormat($data->creation_date);
    ?>
			<i class="fa fa-picture-o"></i><?php 
    echo $data->photos;
    ?>
			<i class="fa fa-eye"></i><?php 
    echo $data->view;
    ?>
		</div>
		<p><?php 
    echo Utility::shortText(Utility::hardDecode($data->body), 100);
    ?>
</p>
	</div>
<?php 
}
开发者ID:oMMuCo,项目名称:ECC-HPTT-Website,代码行数:31,代码来源:_view.php

示例13: searchIndexing

 /**
  * Albums get information
  */
 public function searchIndexing($index)
 {
     Yii::import('application.modules.album.models.*');
     $criteria = new CDbCriteria();
     $criteria->compare('t.publish', 1);
     $criteria->order = 'album_id DESC';
     //$criteria->limit = 10;
     $model = Albums::model()->findAll($criteria);
     foreach ($model as $key => $item) {
         if ($item->media_id != 0) {
             $images = Yii::app()->request->baseUrl . '/public/album/' . $item->album_id . '/' . $item->cover->media;
         } else {
             $images = '';
         }
         $doc = new Zend_Search_Lucene_Document();
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('id', CHtml::encode($item->album_id), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('media', CHtml::encode($images), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('title', CHtml::encode($item->title), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('body', CHtml::encode(Utility::hardDecode(Utility::softDecode($item->body))), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::Text('url', CHtml::encode(Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('album/site/view', array('id' => $item->album_id, 't' => Utility::getUrlTitle($item->title)))), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('date', CHtml::encode(Utility::dateFormat($item->creation_date, true) . ' WIB'), 'utf-8'));
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('creation', CHtml::encode($item->user->displayname), 'utf-8'));
         $index->addDocument($doc);
     }
     return true;
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:29,代码来源:Albums.php

示例14: actionUnsubscribe

 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionUnsubscribe()
 {
     /**
      * example get link
      * http://localhost/_product/nirwasita_hijab/support/newsletter/unsubscribe/email/putra.sudaryanto@gmail.com/secret/uvijijxykmabhiijdehinofgtuuvbcGH
      * secret = salt[Users]
      * email = email[Users]
      */
     $renderError = 0;
     if (isset($_GET['success']) || (isset($_GET['email']) || isset($_GET['secret']))) {
         if (isset($_GET['success'])) {
             if (isset($_GET['date'])) {
                 $title = Phrase::trans(23116, 1);
                 $desc = Phrase::trans(23118, 1, array($_GET['success'], Utility::dateFormat($_GET['date'])));
             } else {
                 $title = Phrase::trans(23119, 1);
                 $desc = Phrase::trans(23120, 1, array($_GET['success']));
             }
         } else {
             if (isset($_GET['email']) || isset($_GET['secret'])) {
                 $newsletter = UserNewsletter::model()->findByAttributes(array('email' => $_GET['email']), array('select' => 'id, user_id, email, subscribe, subscribe_date, unsubscribe_date'));
                 if ($newsletter != null) {
                     if ($newsletter->user_id != 0) {
                         $secret = Users::model()->findByAttributes(array('salt' => $_GET['secret']), array('select' => 'email'));
                         $guest = $secret != null && $secret->email == $newsletter->email ? 1 : 0;
                     } else {
                         $guest = md5($newsletter->email . $newsletter->subscribe_date) == $_GET['secret'] ? 1 : 0;
                     }
                     if ($guest == 1) {
                         if ($newsletter->subscribe == 1) {
                             $newsletter->subscribe = 0;
                             if ($newsletter->update()) {
                                 $title = Phrase::trans(23116, 1);
                                 $desc = Phrase::trans(23117, 1, array($newsletter->email));
                             }
                         } else {
                             $title = Phrase::trans(23116, 1);
                             $desc = Phrase::trans(23118, 1, array($newsletter->email, Utility::dateFormat($newsletter->unsubscribe_date)));
                         }
                     } else {
                         $renderError = 1;
                         $title = Phrase::trans(23113, 1);
                         $desc = Phrase::trans(23115, 1, array($newsletter->email));
                     }
                 } else {
                     $renderError = 1;
                     $title = Phrase::trans(23113, 1);
                     $desc = Phrase::trans(23114, 1);
                 }
             }
         }
     } else {
         $model = new UserNewsletter();
         // Uncomment the following line if AJAX validation is needed
         $this->performAjaxValidation($model);
         if (isset($_POST['UserNewsletter'])) {
             $model->attributes = $_POST['UserNewsletter'];
             $jsonError = CActiveForm::validate($model);
             if (strlen($jsonError) > 2) {
                 echo $jsonError;
             } else {
                 if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                     if ($model->validate()) {
                         if ($model->subscribe == 1) {
                             if ($model->user_id != 0) {
                                 $email = $model->user->email;
                                 $displayname = $model->user->displayname;
                                 $secret = $model->user->salt;
                             } else {
                                 $email = $displayname = $model->email;
                                 $secret = md5($email . $model->subscribe_date);
                             }
                             // Send Email to Member
                             $ticket = Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('support/newsletter/unsubscribe', array('email' => $email, 'secret' => $secret));
                             SupportMailSetting::sendEmail($email, $displayname, 'Unsubscribe Ticket', $ticket, 1);
                             $url = Yii::app()->controller->createUrl('unsubscribe', array('success' => $email));
                         } else {
                             $url = Yii::app()->controller->createUrl('unsubscribe', array('success' => $model->email, 'date' => $model->unsubscribe_date));
                         }
                         echo CJSON::encode(array('type' => 5, 'get' => $url));
                     } else {
                         print_r($model->getErrors());
                     }
                 }
             }
             Yii::app()->end();
         }
         $title = Phrase::trans(23111, 1);
         $desc = Phrase::trans(23112, 1);
     }
     $this->dialogDetail = true;
     $this->dialogGroundUrl = Yii::app()->createUrl('site/index');
     $this->dialogFixed = true;
     $this->pageTitle = $title;
     $this->pageDescription = $desc;
//.........这里部分代码省略.........
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:101,代码来源:NewsletterController.php

示例15: array

        ?>
" /></a>
				<div class="span">
					<a href="<?php 
        echo Yii::app()->controller->createUrl('view', array('id' => $row->album_id, 't' => Utility::getUrlTitle($row->title)));
        ?>
" title="<?php 
        echo $row->title;
        ?>
"><?php 
        echo Utility::hardDecode($row->title);
        ?>
</a>
					<div class="meta-date">
						<i class="fa fa-calendar-check-o"></i><?php 
        echo Utility::dateFormat($row->creation_date);
        ?>
						<i class="fa fa-bookmark-o"></i><?php 
        echo $row->user->displayname;
        ?>
						<i class="fa fa-picture-o"></i><?php 
        echo $row->photos;
        ?>
						<i class="fa fa-eye"></i><?php 
        echo $row->view;
        ?>
					</div>
					<p><?php 
        echo Utility::shortText(Utility::hardDecode($row->body), 100);
        ?>
</p>
开发者ID:oMMuCo,项目名称:ECC-HPTT-Website,代码行数:31,代码来源:front_view.php


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