コード例 #1
0
ファイル: HomeController.php プロジェクト: siegessa/ktrk
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function Home()
 {
     $channel = \Model\Channel\ModelName::general();
     $generalPosts = \Model\Post\ModelName::general($channel)->published()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     $mediaAll = \Model\Media\ModelName::get();
     $dayVideos = \Model\Media\ModelName::take(1)->orderBy('viewed', 'asc')->get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     return view('Front::home', ['generalPosts' => $generalPosts, 'mediaAll' => $mediaAll, 'dayVideos' => $dayVideos, 'mainBanner' => $mainBanner]);
 }
コード例 #2
0
ファイル: MediaController.php プロジェクト: joogazyn/ktrk
 public function project(\Model\Project\ModelName $project)
 {
     $projectList = \Model\Project\ModelName::get();
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaAll = \Model\Media\ModelName::get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::media.project', ['project' => $project, 'MediaCategories' => $MediaCategories, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain]);
 }
コード例 #3
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('kyrgyzradio')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('kyrgyzradio', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('kyrgyzradio', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.kyrgyzradio.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage]);
 }
コード例 #4
0
ファイル: DostukController.php プロジェクト: elemanz/ktrk
 public function project(\Model\Project\ModelName $project)
 {
     $projectList = \Model\Project\ModelName::get();
     //        $MediaCategory = \Model\MediaCategory\ModelName::get();
     $mediaAll = \Model\Media\ModelName::get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $relatedNews = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', $project->id)->get();
     $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get();
     return view('Front::channel.dostuk.project', ['project' => $project, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain, 'relatedNews' => $relatedNews, 'dostukProjects' => $dostukProjects]);
 }
コード例 #5
0
ファイル: HomeController.php プロジェクト: KadyrovEldos/ktrk
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function Home()
 {
     $channel = \Model\Channel\ModelName::general();
     $generalPosts = \Model\Post\ModelName::general($channel)->published()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     $mediaLast = \Model\Media\ModelName::take(9)->get();
     $dayVideos = \Model\Media\ModelName::take(1)->orderBy('viewed', 'asc')->get();
     $positionTop = \Model\Banner\ModelName::where('positionTop', '=', '1')->first();
     $positionRight = \Model\Banner\ModelName::where('positionRight', '=', '1')->first();
     $positionCenter = \Model\Banner\ModelName::where('positionCenter', '=', '1')->first();
     $positionBottom = \Model\Banner\ModelName::where('positionBottom', '=', '1')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaPosts = \Model\Media\ModelName::get();
     $videoAll = \Model\Media\ModelName::get();
     return view('Front::home', ['generalPosts' => $generalPosts, 'dayVideos' => $dayVideos, 'positionTop' => $positionTop, 'positionRight' => $positionRight, 'positionCenter' => $positionCenter, 'positionBottom' => $positionBottom, 'backgroundMain' => $backgroundMain, 'mediaLast' => $mediaLast, 'MediaCategories' => $MediaCategories, 'mediaPosts' => $mediaPosts]);
 }
コード例 #6
0
ファイル: MadaniyatController.php プロジェクト: elemanz/ktrk
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('madaniyat')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('madaniyat', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     $lc = app()->getlocale();
     if ($lc == 'kg') {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('name', '<>', '')->get();
     } else {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('nameRu', '<>', '')->get();
     }
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('madaniyat', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.madaniyat.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage, 'madaniyatProjects' => $madaniyatProjects]);
 }
コード例 #7
0
ファイル: HomeController.php プロジェクト: joogazyn/ktrk
 /**
  * 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]);
 }
コード例 #8
0
ファイル: MediaController.php プロジェクト: joogazyn/ktrk
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Media $media)
 {
     $media->delete();
     return redirect()->route('admin.media.index');
 }
コード例 #9
0
ファイル: HomeController.php プロジェクト: shady11/ktrk-1
 public function mediaPage(\Model\Media\ModelName $media)
 {
     /*$mediaPost = \Model\Media\ModelName::where('id','=',$media);
       dd($mediaPost);*/
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $mediaPop = \Model\Media\ModelName::where()->get();
     return view('Front::media.index', ['mediaPost' => $media, 'mainBanner' => $mainBanner, 'categories' => $categories, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
コード例 #10
0
ファイル: MediaController.php プロジェクト: shady11/ktrk-1
 public function dayVideo4(Request $request)
 {
     $id = $request->media;
     $mediaStars = \Model\Media\ModelName::where('dayVideo', '=', '4')->get();
     foreach ($mediaStars as $mediaStar) {
         $mediaStar->dayVideo = 0;
         $mediaStar->save();
     }
     $row = \Model\Media\ModelName::where('id', '=', $id)->first();
     $row->dayVideo = 4;
     $row->save();
     return redirect()->route('admin.media.index');
 }
コード例 #11
0
ファイル: MediaController.php プロジェクト: shady11/ktrk-1
 public function allVideos()
 {
     $projectList = \Model\Project\ModelName::where('extracolumn', '=', '1')->orderBy('id', 'desc')->get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $perPage = 15;
     $allVideos = \Model\Media\ModelName::where('published', '=', true)->orderBy('id', 'desc')->paginate($perPage);
     return view('Front::media.all', ['perPage' => $perPage, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain, 'allVideos' => $allVideos, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }