/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     if (Input::has('o')) {
         $order = Input::get('o');
         switch ($order) {
             case 'v':
                 $orderBy = "fake_views";
                 $sortName = "Most Viewed";
                 break;
             case 'r':
                 $orderBy = "rating";
                 $sortName = "Top Rated";
                 break;
             case 'f':
                 $orderBy = "favorites";
                 $sortName = "Most Popular";
                 break;
             default:
                 $orderBy = "publish_date";
                 $sortName = "Newest";
                 break;
         }
     } else {
         $order = "";
         $orderBy = "publish_date";
         $sortName = "Newest";
     }
     $network = $this->network;
     $theme = $network->theme;
     $theme = check_for_tour_theme($theme);
     Theme::setActive($theme);
     $data = $this->data;
     $data['page_title'] = $network->name;
     $data['sliders'] = Content::ofNetwork($this->network->id)->published()->featured(1)->take(config('yppmembers.homepage_sliders'))->orderBy(\DB::raw("RAND()"))->get();
     $data['contents'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_contents'))->orderBy($orderBy, 'desc')->paginate(config('yppmembers.per_page'));
     $data['mostviews'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_mostviews'))->orderBy('views', 'desc')->get();
     $data['toprateds'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_toprateds'))->orderBy('rating', 'desc')->get();
     $data['most_used_tags'] = Tag::ofNetwork($this->network->id)->mostUsedInNetwork($this->network->id)->take(config('yppmembers.homepage_most_used_tags'))->get();
     $data['dvds'] = Dvd::ofNetwork($this->network->id)->take(config('yppmembers.homepage_dvds'))->orderBy('publish_date', 'desc')->get();
     $tags = Tag::ofNetwork($network->id)->mostUsedInNetwork($network->id)->paginate(config('yppmembers.per_page'));
     $ids = array(0);
     foreach ($tags as $tag) {
         $tag_data = $tag->getTopThumb($ids, $this->network->id);
         $tag->top_thumb = $tag_data['thumb'];
         $ids[] = $tag_data['id'];
     }
     $data['tags'] = $tags;
     $data['sortname'] = $sortName;
     return Theme::view('video.index', $data);
 }
示例#2
0
 public function index()
 {
     $network = $this->network;
     $theme = $network->theme;
     $theme = check_for_tour_theme($theme);
     Theme::setActive($theme);
     $data = $this->data;
     $data['page_title'] = $network->name;
     $data['sliders'] = Content::ofNetwork($this->network->id)->published()->featured(1)->take(config('yppmembers.homepage_sliders'))->orderBy(\DB::raw("RAND()"))->get();
     $data['contents'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_contents'))->orderBy('publish_date', 'desc')->get();
     $data['mostviews'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_mostviews'))->orderBy('views', 'desc')->get();
     $data['toprateds'] = Content::ofNetwork($this->network->id)->published()->featured(0)->take(config('yppmembers.homepage_toprateds'))->orderBy('rating', 'desc')->get();
     $data['most_used_tags'] = Tag::ofNetwork($this->network->id)->mostUsedInNetwork($this->network->id)->take(config('yppmembers.homepage_most_used_tags'))->get();
     $data['dvds'] = Dvd::ofNetwork($this->network->id)->take(config('yppmembers.homepage_dvds'))->orderBy('publish_date', 'desc')->get();
     return Theme::view('network.home', $data);
 }
示例#3
0
 public function dvdTags($id, $slug = "")
 {
     $tag = Tag::findOrfail($id);
     $network = $this->network;
     $theme = $network->theme;
     $dvds = Dvd::ofNetwork($network->id)->ofTag($tag);
     if (Input::has('o')) {
         $order = Input::get('o');
         switch ($order) {
             case 'v':
                 $orderBy = "views";
                 $sortName = "Most Viewed";
                 break;
             case 'r':
                 $orderBy = "rating";
                 $sortName = "Top Rated";
                 break;
             case 'f':
                 $orderBy = "favorites";
                 $sortName = "Most Popular";
                 break;
             default:
                 $orderBy = "publish_date";
                 $sortName = "Newest";
                 break;
         }
     } else {
         $order = "";
         $orderBy = "publish_date";
         $sortName = "Newest";
     }
     $theme = check_for_tour_theme($theme);
     Theme::setActive($theme);
     $data = $this->data;
     $data['dvds'] = $dvds->orderBy($orderBy, 'DESC')->paginate(config('yppmembers.per_page'));
     $data['page_title'] = $this->network->name . ' DVDs';
     $data['tags'] = Tag::ofNetwork($this->network->id)->ofDvds()->get();
     $data['sortname'] = $sortName;
     $data['tag'] = $tag;
     $this->breadcrumbs->addCrumb('DVDs');
     return Theme::view('dvd.index', $data);
 }