function getLink($post, $attr = true, $excerpt = true) { $postLink = ''; $htmlOptions = ''; // uncomment jika ingin di tambahkan popup intro //if($excerpt == true){ // $htmlOptions = array('onMouseOver'=>"pop(this,'.".$post->ID."');",); // $postLink .= "<p class='".$post->ID." hide'>"; // $postLink .= $post->post_excerpt; // $postLink .= "</p>"; //} $postLink .= CHtml::Link($post->post_name, Yii::app()->createUrl('/photo/index', array('id' => $post->ID, 'slug' => $post->post_link)), $htmlOptions); $postLink .= $post->post_excerpt == '' ? "<br>" . Helper::getExcerpt($post->post_content, 0, 40) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, 40); if ($attr == true) { $postLink .= "<br><small class='text-muted'>"; if ($post->categories != null) { $postLink .= CHtml::openTag('span', array('class' => 'label label-default')); $criteria = new CDbCriteria(); $criteria->condition = "parent=0"; //foreach($post->categories($criteria) as $category): // $postLink .= $category->name.' '; //endforeach; $postLink .= CHtml::closeTag('span'); } $postLink .= " " . FTime::since($post->post_modified) . "</small>"; } else { $postLink .= '<div class="entry-meta small muted">'; $postLink .= FTime::since($post->post_modified); $postLink .= "</div>"; } echo $postLink; }
function getLink($post) { $postLink = ''; $htmlOptions = ''; $postLink .= "<h2>" . CHtml::Link(Helper::getExcerpt($post->post_name, 0, $this->data('batasJudul')), Yii::app()->createUrl('single/index', array('id' => $post->ID, 'slug' => $post->post_link))) . "</h2>"; $postLink .= " <p>"; $postLink .= $post->post_excerpt == '' ? Helper::getExcerpt($post->post_content, 0, $this->data('batasDeskripsi')) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, $this->data('batasDeskripsi')); $postLink .= "</p>"; $postLink .= '<div class="text-muted"><i class="fa fa-clock-o"></i> ' . FTime::since($post->post_modified) . '</div>'; // $postLink .= '<a class="btn btn-primary readmore" href="'.Yii::app()->createUrl('single/index',array('id'=>$post->ID,'slug'=>$post->post_link)).'">Selengkapnya <i class="fa fa-angle-right"></i></a>'; echo $postLink; }
function getLink($post, $attr = true, $excerpt = false, $excerptString = 20) { $postLink = ''; $htmlOptions = ''; $postLink .= CHtml::Link(Helper::getExcerpt($post->post_name, 0, $excerptString), Yii::app()->createUrl('single/index', array('id' => $post->ID, 'slug' => $post->post_link)), $htmlOptions); if ($excerpt == true) { $postLink .= $post->post_excerpt == '' ? "<br>" . Helper::getExcerpt($post->post_content, 0, $this->data('batasDeskripsi')) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, $this->data('batasDeskripsi')); } if ($this->data('showDate') == true) { $postLink .= '<div class="entry-meta small muted">'; $postLink .= FTime::since($post->post_modified); $postLink .= "</div>"; } echo $postLink; }
public static function since($original, $strTotime = false) { return FTime::since($original, $strTotime); }
public function model($data, $row = '') { return "<b>" . $data->model . "</b> <small class='muted'>| " . FTime::since($data->stamp) . "</small>"; }