protected static function load_slideshow($id = null) { if (!$id) { $id = $_GET['id']; } $slideshow = Slideshow::find_by_id($id); if ($slideshow) { return $slideshow; } else { Error404(); } }
public function coverage($permalink = null) { $event = self::load_event($permalink); $this->assign('event', $event); $this->assignLayout('cEvent', $event); $slideshow = Slideshow::find(null, "slideshows.created_at DESC", true, 5); $this->assign("slideshow", $slideshow); $news = News::find_published('', "news.publish_at DESC", true, 5); $this->assign('news', $news); $matches = EventContent::find_by_permalink($event, 'matchfeed', false); $this->assign('matches', $matches); $twitch = Twitch::find_all('twitch.public = 1', 'twitch.position ASC'); $activeTwitch = Twitch::getActive(); $this->assignLayout('twitch', $twitch); $this->assignLayout('activetwitch', $activeTwitch); $this->layout = 'coverage2'; $this->title = "{$event->name} :: Coverage"; $this->render('event/coverage2.tpl'); }
public function actionIndex() { if (isset($_POST['ajax'])) { $slideShows = Slideshow::model()->findAll(); $images = array(); if ($slideShows) { foreach ($slideShows as $slideShow) { $images[] = $slideShow->imageLink; } echo json_encode($images); } } else { $newProducts = NewProducts::model()->findAll(); $hotProducts = HotProducts::model()->findAll(array("limit" => 17)); $amthucs = Amthuc::model()->findAll(array("order" => 'id DESC', "limit" => 4)); if ($newProducts || $hotProducts) { $newProduct = array(); foreach ($newProducts as $newProduct1) { $product = Products::model()->findByPk($newProduct1->product_id); if ($product) { $newProduct[$newProduct1->id] = $product; } } foreach ($hotProducts as $key => $value) { $product = Products::model()->find('id=:product_id', array(':product_id' => $value->product_id)); if ($product) { $products[] = $product; } } if ($newProduct && $products || $amthucs) { $this->render('index', array('newProduct' => $newProduct, 'products' => $products, 'amthucs' => $amthucs)); } else { $this->render('index'); } } } }
break; case 'stop_channel': if (Access::check('interface', '75')) { ob_start(); $channel = new Channel($_REQUEST['id']); if ($channel->id) { $channel->stop_channel(); sleep(1); echo $channel->get_channel_state(); } $results['channel_state_' . $_REQUEST['id']] = ob_get_clean(); } break; case 'slideshow': ob_start(); $images = Slideshow::get_current_slideshow(); if (count($images) > 0) { $fsname = 'fslider_' . time(); echo "<div id='" . $fsname . "'>"; foreach ($images as $image) { echo "<img src='" . $image['url'] . "' alt='' onclick='update_action();' />"; } echo "</div>"; $results['fslider'] = ob_get_clean(); ob_start(); echo "<script language='javascript' type='text/javascript'>"; echo "\$('#" . $fsname . "').rhinoslider({\n showTime: 15000,\n effectTime: 2000,\n randomOrder: true,\n controlsPlayPause: false,\n autoPlay: true,\n showBullets: 'never',\n showControls: 'always',\n controlsMousewheel: false,\n });"; echo "</script>"; } $results['fslider_script'] = ob_get_clean(); break;
<?php require dirname(dirname(dirname(__FILE__))) . '/bootstrap.php'; $object = new Slideshow($_POST['ID']); foreach ($_POST as $key => $val) { $object->set($key, $val); } $object->persist();
<?php require_once 'config.php'; View::$title = 'High Fidelity Slideshow'; View::write('page', 'slideshow'); View::addStyle('css/slideshow.css'); View::addScript('js/galleria/galleria-1.4.2.min.js'); View::addScript('js/slideshow.js'); View::write('slideshowData', Slideshow::getSlideshowData()); View::$header = 'layout/empty/header'; View::$footer = 'layout/empty/footer'; View::renderCommonLayout('slideshow');
public function run() { $model = Slideshow::model()->findAll(); $this->render('slideshow', array('model' => $model)); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->slideshow->find($id)->delete(); return Redirect::route('slideshows.index'); }
public function postSlideImages($type) { if ($type == "delete") { $slideImg = \Slideshow::find($_POST['id']); if ($slideImg->status == 0) { if ($slideImg->delete()) { unlink("./uploads/slideshow/" . $slideImg->img_name); echo "Record Successfully Deleted"; } else { echo "Unexpeted error! Record was not deleted"; } } else { echo "This image cannot be deleted. It is already in use by a slide"; } } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Slideshow the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Slideshow::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php require_once "slideshow_beta2.php"; $slideshow = new Slideshow("http://kamusi.org", "/mnt/wulomei/fienipa/files/paldo/dictimages/"); $filename = $slideshow->get_filename(); $id = $slideshow->get_node_id($filename); $slideshow->set_url($id); echo $slideshow->setup_slideshow($filename);
public static function getSlide() { return Slideshow::where('slideshow_status', '=', '1')->get(); }
public function index() { $r_slide = Slideshow::all(); $r_post = Post::paginate(3); return View::make('pages.home', compact('r_post', 'r_slide')); }
public function set_custom_effects($effects) { self::$effects = $effects; }