Example #1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function mediaIndex(Request $request)
 {
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaAll = \Model\Media\ModelName::get();
     $categoriesVideos = array();
     foreach ($MediaCategories as $MediaCategory) {
         $CategoryVideos = \Model\Media\ModelName::where('videoType', '=', $MediaCategory->videoType)->orderBy('id', 'desc')->take(9)->get();
         $categoriesVideos = array_add($categoriesVideos, $MediaCategory->videoType, $CategoryVideos);
     }
     //        dd($categoriesVideos['tele']);
     $mediaLastVideos = \Model\Media\ModelName::orderBy('id', 'desc')->take(9)->get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $projectList = \Model\Project\ModelName::get();
     return view('Front::media.index', ['mediaAll' => $mediaAll, 'mediaLastVideos' => $mediaLastVideos, 'MediaCategories' => $MediaCategories, 'mainBanner' => $mainBanner, 'projectList' => $projectList, 'mediaCategories' => $MediaCategories, 'backgroundMain' => $backgroundMain, 'categoriesVideos' => $categoriesVideos]);
 }
Example #2
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function Home()
 {
     $lc = app()->getlocale();
     $channel = \Model\Channel\ModelName::general();
     if ($lc == 'kg') {
         $generalPosts = \Model\Post\ModelName::general($channel)->published()->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
         $projects = \Model\Project\ModelName::having('name', '<>', '')->get();
     } elseif ($lc == 'ru') {
         $generalPosts = \Model\Post\ModelName::general($channel)->published()->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
         $projects = \Model\Project\ModelName::where('nameRu', '<>', '')->get();
     }
     $rDayVideo = \Model\Media\ModelName::having('dayVideo', '=', '1')->take(1)->skip(0)->orderBy('created_at', 'desc')->first();
     if ($rDayVideo != null) {
         $dayVideo = $rDayVideo;
     } elseif ($rDayVideo == null) {
         $dayVideoResult = \Model\Media\ModelName::take(1)->skip(0)->orderBy('id', 'desc')->first();
         if ($dayVideoResult != null) {
             $dayVideo = $dayVideoResult;
         } else {
             $dayVideo = 'KhJUlC4aJZM';
         }
     }
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $peopleReporters = \Model\PeopleReporter\ModelName::where('published', '=', true)->get();
     // FotoParent - photo gallery
     $photoParent = \Model\PhotoParent\ModelName::where('published', '=', true)->first();
     if ($photoParent != null) {
         $images = json_decode($photoParent->images);
         // array of images
     } else {
         $images = 1;
     }
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaPosts = \Model\Media\ModelName::orderBy('id', 'desc')->get();
     $categoriesVideos = array();
     foreach ($MediaCategories as $MediaCategory) {
         $CategoryVideos = \Model\Media\ModelName::where('videoType', '=', $MediaCategory->videoType)->orderBy('id', 'desc')->take(9)->get();
         $categoriesVideos = array_add($categoriesVideos, $MediaCategory->videoType, $CategoryVideos);
     }
     $mediaLastVideos = \Model\Media\ModelName::orderBy('id', 'desc')->take(9)->get();
     return view('Front::home', ['images' => $images, 'generalPosts' => $generalPosts, 'dayVideo' => $dayVideo, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'peopleReporters' => $peopleReporters, 'backgroundMain' => $backgroundMain, 'MediaCategories' => $MediaCategories, 'categoriesVideos' => $categoriesVideos, 'mediaLastVideos' => $mediaLastVideos, 'projects' => $projects]);
 }
Example #3
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function mediaIndex(Request $request)
 {
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaAll = \Model\Media\ModelName::get();
     $categoriesVideos = array();
     $topCategoriesVideos = array();
     foreach ($MediaCategories as $MediaCategory) {
         $CategoryVideos = \Model\Media\ModelName::where('videoType', '=', $MediaCategory->videoType)->orderBy('id', 'desc')->take(9)->get();
         $TopCategoryVideos = \Model\Media\ModelName::where('videoType', '=', $MediaCategory->videoType)->orderBy('viewed', 'desc')->take(9)->get();
         $categoriesVideos = array_add($categoriesVideos, $MediaCategory->videoType, $CategoryVideos);
         $topCategoriesVideos = array_add($topCategoriesVideos, $MediaCategory->videoType, $TopCategoryVideos);
     }
     //        dd($topCategoriesVideos);
     $mediaLastVideos = \Model\Media\ModelName::orderBy('id', 'desc')->take(9)->get();
     $mediaPops = \Model\Media\ModelName::orderBy('viewed', 'desc')->take(9)->get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $projectList = \Model\Project\ModelName::where('extracolumn', '=', '1')->orderBy('id', 'desc')->get();
     return view('Front::media.index', ['mediaAll' => $mediaAll, 'mediaLastVideos' => $mediaLastVideos, 'MediaCategories' => $MediaCategories, 'mainBanner' => $mainBanner, 'projectList' => $projectList, 'mediaCategories' => $MediaCategories, 'backgroundMain' => $backgroundMain, 'categoriesVideos' => $categoriesVideos, 'topCategoriesVideos' => $topCategoriesVideos, 'mediaPops' => $mediaPops, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
Example #4
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function Home()
 {
     $lc = app()->getlocale();
     $channel = \Model\Channel\ModelName::general();
     $channels = \Model\Channel\ModelName::take(8)->skip(1)->get();
     if ($lc == 'kg') {
         $generalPosts = \Model\Post\ModelName::general($channel)->published()->where('general', '=', '1')->languagekg()->take(6)->skip(0)->orderBy('number', 'asc')->get();
         $projects = \Model\Project\ModelName::having('name', '<>', '')->get();
         $directorPosts = \Model\Post\ModelName::where('director', '=', '1')->orderBy('id', 'desc')->take(3)->languagekg()->get();
         $reporterPosts = \Model\Post\ModelName::where('reporter', '=', '1')->orderBy('id', 'desc')->take(15)->languagekg()->get();
     } elseif ($lc == 'ru') {
         $generalPosts = \Model\Post\ModelName::general($channel)->published()->where('general', '=', '1')->languageru()->take(6)->skip(0)->orderBy('number', 'asc')->get();
         $projects = \Model\Project\ModelName::where('nameRu', '<>', '')->get();
         $directorPosts = \Model\Post\ModelName::where('director', '=', '1')->orderBy('id', 'desc')->take(3)->languageru()->get();
         $reporterPosts = \Model\Post\ModelName::where('reporter', '=', '1')->orderBy('id', 'desc')->take(15)->languageru()->get();
     }
     if ($lc == 'kg') {
         $latestPosts = \Model\Post\ModelName::general($channel)->published()->where('general', '=', '1')->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     } elseif ($lc == 'ru') {
         $latestPosts = \Model\Post\ModelName::general($channel)->published()->where('general', '=', '1')->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     }
     $dayVideo1 = \Model\Media\ModelName::where('dayVideo', '=', '1')->first();
     $dayVideo2 = \Model\Media\ModelName::where('dayVideo', '=', '2')->first();
     $dayVideo3 = \Model\Media\ModelName::where('dayVideo', '=', '3')->first();
     $dayVideo4 = \Model\Media\ModelName::where('dayVideo', '=', '4')->first();
     $dayVideo5 = \Model\Media\ModelName::where('dayVideo', '=', '5')->first();
     if ($dayVideo1) {
         $dayVideo1 = $dayVideo1;
     } else {
         $dayVideo1 = '';
     }
     if ($dayVideo2) {
         $dayVideo2 = $dayVideo2;
     } else {
         $dayVideo2 = '';
     }
     if ($dayVideo3) {
         $dayVideo3 = $dayVideo3;
     } else {
         $dayVideo3 = '';
     }
     if ($dayVideo4) {
         $dayVideo4 = $dayVideo4;
     } else {
         $dayVideo4 = '';
     }
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $peopleReporters = \Model\PeopleReporter\ModelName::where('published', '=', true)->get();
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('extracolumn', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     $MediaCategories = \Model\MediaCategory\ModelName::orderBy('id', 'asc')->get();
     $mediaPosts = \Model\Media\ModelName::orderBy('id', 'desc')->get();
     $categoriesVideos = array();
     foreach ($MediaCategories as $MediaCategory) {
         $CategoryVideos = \Model\Media\ModelName::where('videoType', '=', $MediaCategory->videoType)->orderBy('id', 'desc')->take(9)->get();
         $categoriesVideos = array_add($categoriesVideos, $MediaCategory->videoType, $CategoryVideos);
     }
     $mediaLastVideos = \Model\Media\ModelName::orderBy('id', 'desc')->take(9)->get();
     $defaultVideo = 'rjXSurFi8uQ';
     return view('Front::home', ['generalPosts' => $generalPosts, 'dayVideo1' => $dayVideo1, 'dayVideo2' => $dayVideo2, 'dayVideo3' => $dayVideo3, 'dayVideo4' => $dayVideo4, 'defaultVideo' => $defaultVideo, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionLeft' => $this->positionLeft, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'peopleReporters' => $peopleReporters, 'photoGalleries' => $photoGalleries, 'backgroundMain' => $backgroundMain, 'MediaCategories' => $MediaCategories, 'categoriesVideos' => $categoriesVideos, 'mediaLastVideos' => $mediaLastVideos, 'projects' => $projects, 'directorPosts' => $directorPosts, 'reporterPosts' => $reporterPosts, 'latestPosts' => $latestPosts, 'channels' => $channels]);
 }