public function actionIndex() { $ModelSeo = new CmsvideoSettings(); $DataSeo = $ModelSeo->DownloadSettings(); $ModelCategories = CmsvideoCategories::model()->findAll(); $ModelSlider = Slider::model()->findAll(array('order' => 'slider_id DESC')); $VideoLatest = CmsvideoVideo::model()->findAll(array('select' => 'video_id, video_title, video_description, video_thumb, video_views, video_alias', 'order' => 'video_id DESC', 'limit' => '4')); $VideoPopular = CmsvideoVideo::model()->findAll(array('select' => 'video_id, video_title, video_description, video_thumb, video_views, video_alias', 'order' => 'video_views DESC', 'limit' => '4')); foreach ($DataSeo as $Seoo) { $this->pageMetaRobots = $Seoo['settings_robots']; $this->pageMetaKeywords = $Seoo['settings_keywords']; $this->pageMetaDescription = $Seoo['settings_description']; $this->pageMetaOgTitle = $Seoo['settings_ogtitle']; $this->pageTitle = $Seoo['settings_ogtitle']; $this->pageMetaOgImage = $Seoo['settings_ogimage']; $this->slider_duration = $Seoo['slider_duration']; $this->slider_arrow = $Seoo['slider_arrow']; $this->slider_dragorientation = $Seoo['slider_dragorientation']; $this->slider_slidespacing = $Seoo['slider_slidespacing']; $this->slider_mindragoffsettoslide = $Seoo['slider_mindragoffsettoslide']; $this->slider_loop = $Seoo['slider_loop']; $this->slider_hwa = $Seoo['slider_hwa']; $this->slider_arrowkeynavigation = $Seoo['slider_arrowkeynavigation']; $this->slider_lazyloading = $Seoo['slider_lazyloading']; } //$id = 'page'; $this->render('index', array('ModelCategories' => $ModelCategories, 'VideoLatest' => $VideoLatest, 'VideoPopular' => $VideoPopular, 'DataSlider' => $ModelSlider, 'DataSeo' => $DataSeo)); }
public function run() { $criteria = new CDbCriteria(); $criteria->condition = "active='1'"; $criteria->order = "sequence ASC"; $models = Slider::model()->findAll($criteria); $this->render('slider', array('models' => $models)); }
public function loadModel($id) { $model = Slider::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function run() { if ($this->slider_id === null) { return; } $this->_slider = Slider::model()->with('slides', 'slides.captions')->find(array('condition' => 't.id = :id', 'params' => array(':id' => $this->slider_id), 'order' => 'sliderSlides.slide_order ASC, slideCaptions.caption_order ASC')); $this->render('nymediaSlider', array('slider' => $this->_slider)); }
public function returnImageFancy($data, $tableId, $ignore = 0, $width = 150, $height = 80) { if ($ignore && $data->id == $ignore) { return ''; } $url = Yii::app()->request->baseUrl . "/" . Slider::model()->sliderPath . "/" . $data->img; $options = array('class' => 'fancy'); $img = CHtml::image(Yii::app()->request->baseUrl . "/" . Slider::model()->sliderPath . "/" . $data->getThumb($width, $height)); return '<div align="center">' . CHtml::link($img, $url, $options) . '</div>'; }
/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' $this->layout = 'sitio'; $categorias = Categoria::model()->findAll(); $sliders = Slider::model()->findAll(); $ofertas = ProductoOferta::model()->with('producto')->findAll(); $this->render('index', array('categorias' => $categorias, 'sliders' => $sliders, 'ofertas' => $ofertas)); }
public function DeleteSliderImage($id) { $Data = Slider::model()->find('slider_id=:id', array(':id' => $id)); $FileImage = $Data->slider_image; $FileThumb = $Data->slider_thumb; if (file_exists($FileImage)) { unlink($FileImage); } else { echo 'Error deleting Image:' . $FileImage; } if (file_exists($FileThumb)) { unlink($FileThumb); } else { echo 'Error deleting Thumbnail: ' . $FileThumb; } }
public function run() { $model = Slider::model()->findAll(); $this->render('slider', array('model' => $model)); }
?> "> <img src="<?php echo $img['src']; ?> " alt="" width="500" height="310" title="<?php echo CHtml::encode($img['title']); ?> " /> </a> <?php } } } if (!$usePaid || count($imgs) < 3) { if (issetModule('slider') && count(Slider::model()->getActiveImages())) { $this->widget('application.modules.slider.components.SliderWidget', array()); } else { ?> <img src="<?php echo Yii::app()->request->baseUrl; ?> /images/slider/1.jpg" alt="1" width="716" height="375" /> <img src="<?php echo Yii::app()->request->baseUrl; ?> /images/slider/2.jpg" alt="2" width="716" height="375" /> <img src="<?php echo Yii::app()->request->baseUrl; ?> /images/slider/3.jpg" alt="3" width="716" height="375" />
<?php $count = $this->imgCount + 1; foreach ($images as $item) { if ($item->img) { $tmp = $item->getTitle(); $title = isset($tmp) && $tmp ? CHtml::encode($tmp) : ''; $link = isset($item->url) ? CHtml::encode($item->url) : ''; $title = str_replace(array("\r", "\n"), '', $title); $img = CHtml::image(Yii::app()->request->baseUrl . "/" . Slider::model()->sliderPath . "/" . $item->getThumb(663, 380), '', array('width' => 663, 'height' => 380)); echo '<div id="slide' . $count . '" class="slide">'; if ($link) { echo '<a href="' . $link . '" target="_blank">'; } echo $img; if ($title) { echo '<div class="slideContent">'; echo '<div class="title_block2">'; echo $title; echo '</div>'; echo '</div>'; } if ($link) { echo '</a>'; } echo '</div>'; } $count++; } unset($tmp);
public function actionSliderUpdate($id) { $this->pageTitle = 'Edycja Slidera'; if (!is_numeric($id)) { exit; } $SliderUpdate = false; $ModelSlider = Slider::model()->findByPk($id); if (isset($_POST['Slider'])) { $ModelSlider->attributes = $_POST['Slider']; if ($ModelSlider->validate()) { if (!empty($ModelSlider->slider_updateimg)) { $ModelSlider->DeleteSliderImage($id); $ImageNewName = date("d-m-Y-H-i-s", time()) . "-slider-" . $ModelSlider->slider_idvideo . '.jpg'; $ImageUrl = 'images/orginal/' . $ImageNewName; $ThumbUrl = 'images/thumbs/' . $ImageNewName; $ModelSlider->ImageCopy($ModelSlider->slider_updateimg, $ImageUrl); $ModelSlider->ImageThumbCreate($ImageUrl, $ThumbUrl); $ModelSlider->slider_image = $ImageUrl; $ModelSlider->slider_thumb = $ThumbUrl; } $ModelSlider->save(); $SliderUpdate = true; } $this->redirect(array('/admin/slider')); } $this->render('sliderupdate', array('ModelSlider' => $ModelSlider, 'SliderUpdate' => $SliderUpdate)); }