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'); }
/** * 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"; } } }