public function layout($model) { echo CHtml::openTag('div', array('class' => 'widget categories content-inner ')); if ($this->data('title') != '') { echo CHtml::openTag('h3', array('class' => 'main-color widget_header')); echo $this->data('title'); echo CHtml::closeTag('h3'); } echo CHtml::openTag('div', array('class' => 'row')); echo CHtml::openTag('div', array('class' => 'col-xs-12')); $first = true; $end = CHtml::listData($model, 'ID', 'ID'); foreach ($model as $post) { if ($this->data('showThumbPost')) { echo CHtml::openTag('div', array('class' => 'single_comments')); if ($this->getFoto($post) != '') { echo CHtml::image(Helper::getThumb('content', $this->getFoto($post))); } $this->getLink($post); echo CHtml::closeTag('div'); } else { echo CHtml::openTag('div', array('class' => 'single_comments')); $this->getLink($post); echo CHtml::closeTag('div'); } } if ($this->data('showIndexLink')) { echo CHtml::Link('<i class="fa fa-angle-double-right"></i> Index Photo', array('/photohome'), array('class' => 'indeks')); } echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); }
public function layout($model) { echo CHtml::openTag('div', array('class' => 'widget categories content-inner widget_post_category')); if ($this->data('title') != '') { echo CHtml::openTag('h3', array('class' => 'main-color widget_header')); echo $this->data('title'); echo CHtml::closeTag('h3'); } echo CHtml::openTag('div', array('class' => 'row')); echo CHtml::openTag('div', array('class' => 'col-xs-12')); $first = true; $end = CHtml::listData($model, 'ID', 'ID'); foreach ($model as $post) { if ($this->data('showThumbPost')) { echo CHtml::openTag('div', array('class' => 'single_comments')); echo "<span>"; if ($post->post_image != '') { echo CHtml::image(Helper::getThumb('content', $post->post_image)); } echo "</span>"; $this->getLink($post, true, $this->data('showExcerpt'), 20); echo CHtml::closeTag('div'); } else { echo CHtml::openTag('div', array('class' => 'single_comments')); $this->getLink($post, true, $this->data('showExcerpt'), $this->data('batasJudul')); echo CHtml::closeTag('div'); } } if ($this->data('showIndexLink')) { echo CHtml::Link('<i class="glyphicon glyphicon-plus"></i> Indeks ', array('indeks/populer'), array('class' => 'indeks')); } echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); }
public function layout($model) { echo "<div class='content-inner latest-article'>"; if ($this->data('title') != '') { echo '<h2>'; echo $this->data('title'); echo '</h2>'; } $first = true; $end = CHtml::listData($model, 'ID', 'ID'); foreach ($model as $post) { echo '<div class="blog-item"> '; echo '<div class="blog-content">'; if ($post->post_image != '') { echo "<div class='col-xs-5'>"; echo CHtml::image(Helper::getThumb('content', $post->post_image, 'medium'), '', array('class' => 'img-responsive img-blog')); echo ' </div><div class="col-xs-7">'; $this->getLink($post); echo '</div>'; } else { echo '<div class="col-xs-12">'; $this->getLink($post); echo '</div>'; } echo ' </div></div>'; } if ($this->data('showIndexLink')) { echo '<div style="padding:15px;">'; echo CHtml::Link('<i class="glyphicon glyphicon-plus"></i> Indeks ', array('Indeks/view/param/post')); echo "</div></div>"; } }
public function Photometa($data, $row = '') { $t = ''; foreach ($data->photometa as $val) { $t .= CHtml::image(Helper::getThumb('content', $val->photo, 'medium'), '', array('width' => '60%')); $t .= "<br>Credit : " . $val->photo_credit . "<br><br>"; } return $t; }
public function actionIndex($id, $slug) { $post = $this->loadPost($id, $slug); $post->saveCounters(array('post_hits' => 1)); $this->pageTitle = $this->seoReplace($post->post_title, 'singleTitle'); $this->keyword = $this->seoReplace($post->post_meta_key, 'singleKeyword'); $this->description = CHtml::encode($post->post_meta_desc) . ' ' . CHtml::encode($post->post_excerpt); $this->image = Helper::getThumb('content', $post->post_image, 'medium'); $this->render('/single', compact('post')); }
function getThumb($post) { echo CHtml::openTag('li'); echo '<div class="carousel-inner">'; echo CHtml::image(Helper::getThumb('content', $post->post_image, 'medium'), '', array('style' => 'width:100%;')); echo '<div class="carousel-caption"><h4>'; $this->getLink($post, false); echo '</h4></div></div>'; echo CHtml::closeTag('li'); }
function centeredPopup(url,winName,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' popupWindow = window.open(url,winName,settings) } </script> </p> <?php if ($post->post_image != '') { ?> <?php echo CHtml::image(Helper::getThumb('content', $post->post_image, 'large'), '', array('style' => 'width:100%;')); ?> <?php if ($post->post_image_by != '' or $post->post_image_credit != '') { ?> <div style='background:#EEE;width:100%;padding:10px;'> <small class='text-muted'> <b><?php echo $post->post_image_by; ?> </b> <?php echo $post->post_image_credit; ?> </small></div>
<div class="blog-item"> <div class="row"> <div class="blog-content"> <?php if ($data->post_image != '') { echo "<div class='col-xs-5'>"; echo CHtml::image(Helper::getThumb('content', $data->post_image, 'medium'), '', array('class' => 'img-responsive img-blog')); echo '</div><div class="col-xs-7">'; ?> <h2><a href='<?php echo $this->createUrl('single/index', array('id' => $data->ID, 'slug' => $data->post_link)); ?> '> <?php echo CHtml::encode($data->post_name); ?> </a></h2> <p><?php echo $data->post_excerpt == "" ? Helper::getExcerpt($data->post_content, 0, 180) : Helper::getExcerpt($data->post_excerpt, 0, 100); ?> </p> <small class='text-muted'><?php echo FTime::id("D, j M Y ", $data->post_modified); ?> WIB</small> <?php echo '</div>'; } else {
echo $post->post_name; ?> </h2> <small> <?php echo FTime::id('D, d M Y | H:i', $post->post_modified); ?> WIB </small> </div> <br> <?php foreach ($post->photometa() as $meta) { ?> <?php echo CHtml::image(Helper::getThumb('content', $meta->photo, 'medium'), '', array('width' => '100%;')); ?> <?php if ($meta->photo_credit != '') { ?> <?php echo $meta->photo_credit; ?> <?php } ?> <br> <?php } ?>
<?php $this->breadcumbs(); ?> <h3>Lihat : <?php echo $model->post_name; ?> </h3> <?php $this->alert(); $webUrl = Yii::app()->FrontUrl->createUrl('/single/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $mobileUrl = Yii::app()->FrontMobileUrl->createUrl('/single/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $link = "Web Url : " . $webUrl . " - " . CHtml::Link('Go to Link', $webUrl) . "<br>"; $link .= frontendMobileUrl == '' ? "" : "Mobile url : " . $mobileUrl . " - " . CHtml::Link('Go to Link', $mobileUrl); $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('ID', 'post_name', 'post_title', array('name' => 'post_link', 'type' => 'raw', 'value' => $link), array('name' => 'post_image', 'type' => 'raw', 'value' => CHtml::image(Helper::getThumb('content', $model->post_image, 'medium'))), 'post_image_by', 'post_image_credit', 'post_excerpt', array('name' => 'post_content', 'type' => 'raw'), 'post_source', 'post_source_link', array('name' => 'post_status', 'type' => 'raw', 'value' => array($this, 'Status')), array('label' => 'Author', 'name' => 'authors.username'), array('label' => 'Editor', 'name' => 'editors.username'), array('name' => 'tags.name', 'type' => 'raw', 'value' => Tag::makeValue($model)), array('label' => 'Category', 'type' => 'raw', 'value' => Category::makeValue($model)), array('name' => 'labels.name', 'type' => 'raw', 'value' => Label::makeValue($model)), array('label' => 'Topic', 'type' => 'raw', 'value' => Topic::makeValue($model)), 'post_created', 'post_modified', 'post_meta_key', 'post_meta_desc')));
public function getTermIndicator($type = '', $count = 5, $value = '', $term = '') { if ($this->data[$type] == 1) { $first = true; $i = 0; foreach ($this->loadTerm($this->data[$count], $this->data[$value], array($term)) as $slide) { $active = ''; if ($first) { $active = "active"; $first = false; } echo '<li data-target="#myCarousel" data-slide-to="' . $i++ . '" class="list-group-item ' . $active . '"><img src="' . Helper::getThumb('content', $slide->post_image, 'small') . '" /><h4>' . $slide->post_name . '</h4></li>'; } } }
<?php $criteria = new CDbCriteria(); $criteria->limit = 1; foreach ($data->photometa($criteria) as $meta) { ?> <div class="col-xs-4"> <div class="recent-work-wrap" style='height: 200px;overflow: hidden;'> <?php if ($meta->photo != '') { echo CHtml::image(Helper::getThumb('content', $meta->photo, 'medium'), '', array('style' => 'width:100%;height:200px!important;')); } ?> <div class="overlay"> <div class="recent-work-inner"> <h3><a href='<?php echo $this->createUrl('photo/index', array('id' => $data->ID, 'slug' => $data->post_link)); ?> '><?php echo CHtml::encode($data->post_name); ?> </a></h3> <p><?php echo FTime::id('D, d M Y | H:i', $data->post_modified); ?> WIB</p> <a class="preview" href="<?php echo $this->createUrl('photo/index', array('id' => $data->ID, 'slug' => $data->post_link)); ?> " ><i class="fa fa-eye"></i> View</a> </div></div>
echo $post->post_name; ?> </h2> </a> </center></div><hr> <ul data-role="listview" data-inset="false" data-icon="false" data-divider-theme="b"> <li data-role="list-divider">Terbaru </li> <?php } else { ?> <li><a href="<?php echo Yii::app()->createUrl('single/index', array('id' => $post->ID, 'slug' => $post->post_link)); ?> "> <img src="<?php echo Helper::getThumb('content', $post->post_image, 'small'); ?> "> <h2><?php echo $post->post_name; ?> </h2> <p><?php echo Helper::since($post->post_modified); ?> </p> </a></li>
public function layoutManual($type = '', $count) { if ($this->data[$type] == 1) { foreach ($this->loadManual($this->data[$count]) as $slide) { $active = ''; if ($this->firstToActive) { $active = "active"; $this->firstToActive = false; } echo CHtml::openTag('div', array('class' => "item {$active}")); echo CHtml::Image(Helper::getThumb('content', $slide->images, 'medium'), '', array('alt' => $slide->name, 'title' => $slide->name)); if ($slide->groups != '') { echo CHtml::openTag('span'); echo $slide->groups; echo CHtml::closeTag('span'); } echo CHtml::openTag('div', array('class' => 'carousel-caption')); echo CHtml::openTag("h3"); echo CHtml::Link($slide->name, $slide->slug); echo CHtml::closeTag('h3'); if ($this->data['slider_description'] == 1) { echo CHtml::openTag("p", array('class' => 'hidden-xs')); echo $slide->description; echo CHtml::closeTag('p'); } echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); } } }
<?php $criteria = new CDbCriteria(); $criteria->limit = 1; foreach ($data->photometa($criteria) as $meta) { ?> <li><a href="<?php echo Yii::app()->createUrl('photo/index', array('id' => $data->ID, 'slug' => $data->post_link)); ?> "> <?php echo CHtml::image(Helper::getThumb('content', $meta->photo, 'small')); ?> <h2> <?php echo CHtml::encode($data->post_name); ?> </h2> <p><?php echo Helper::since($data->post_modified); ?> WIB | <?php echo CHtml::encode($data->post_excerpt); ?> </p>
<div class='widget widget_images'> <center> <?php $img = CHtml::Image(Helper::getThumb('content', $this->data('images'), ''), $this->data('alt'), $this->align()); echo CHtml::Link($img, $this->data('link')); ?> </center> </div>
<?php $this->breadcumbs(); ?> <h3>Lihat : <?php echo $model->post_name; ?> </h3> <?php $this->alert(); ?> <?php $webUrl = Yii::app()->FrontUrl->createUrl('/page/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $mobileUrl = Yii::app()->FrontMobileUrl->createUrl('/page/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $link = "Web Url : " . $webUrl . " - " . CHtml::Link('Go to Link', $webUrl) . "<br>"; $link .= frontendMobileUrl == '' ? "" : "Mobile url : " . $mobileUrl . " - " . CHtml::Link('Go to Link', $mobileUrl); $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('ID', 'post_name', 'post_title', array('name' => 'post_link', 'type' => 'raw', 'value' => $link), array('name' => 'post_image', 'type' => 'raw', 'value' => CHtml::image(Helper::getThumb('content', $model->post_image, 'medium'))), 'post_image_by', 'post_image_credit', 'post_excerpt', array('name' => 'post_content', 'type' => 'raw'), 'post_status', array('label' => 'Editor', 'name' => 'editors.username'), 'post_created', 'post_modified', 'post_meta_key', 'post_meta_desc')));
<li><a href="<?php echo Yii::app()->createUrl('single/index', array('id' => $data->ID, 'slug' => $data->post_link)); ?> "> <?php if ($data->post_image != '') { echo CHtml::image(Helper::getThumb('content', $data->post_image)); } ?> <h2> <?php echo CHtml::encode($data->post_name); ?> </h2> <p><?php echo Helper::since($data->post_modified); ?> WIB </p> </a></li>