コード例 #1
0
ファイル: HomeController.php プロジェクト: siegessa/ktrk
 public function Post(\Model\Post\ModelName $post)
 {
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     return view('Front::post.post', ['post' => $post, 'categories' => $categories, 'mainBanner' => $mainBanner]);
 }
コード例 #2
0
ファイル: HomeController.php プロジェクト: KadyrovEldos/ktrk
 public function Post(\Model\Post\ModelName $post)
 {
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $positionTop = \Model\Banner\ModelName::where('published', '=', true, 'and', 'positionTop', '=', '1')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::post.post', ['post' => $post, 'categories' => $categories, 'positionTop' => $positionTop, 'backgroundMain' => $backgroundMain]);
 }
コード例 #3
0
ファイル: DostukController.php プロジェクト: elemanz/ktrk
 public function news(\Model\Post\ModelName $post)
 {
     $post->incrementViewed();
     $channel = \Model\Channel\ModelName::name('dostuk')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get();
     $parent = \Model\PhotoParent\ModelName::where('id', '=', $post->parentId)->first();
     if ($parent != null) {
         $images = json_decode($parent->images);
     } else {
         $images = null;
     }
     return view('Front::channel.dostuk.news', ['channel' => $channel, 'post' => $post, 'backgroundMain' => $backgroundMain, 'dostukProjects' => $dostukProjects, 'images' => $images]);
 }
コード例 #4
0
ファイル: RsController.php プロジェクト: shady11/ktrk-1
 public function post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     // Photo Gallery
     $parent = \Model\PhotoParent\ModelName::where('id', '=', $post->parentId)->first();
     if ($parent) {
         $images = json_decode($parent->images);
     } else {
         $images = null;
     }
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::rs.post', ['post' => $post, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft, 'images' => $images]);
 }
コード例 #5
0
ファイル: HomeController.php プロジェクト: joogazyn/ktrk
 public function Post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $positionTop = \Model\Banner\ModelName::top()->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     if ($post->parentId != '0' && $post->parentId != null) {
         $parentId = $post->parentId;
         $parentId = \Model\PhotoParent\ModelName::where('id', '=', $parentId)->first();
         $photoChilds = \Model\PhotoChild\ModelName::where('parentId', '=', $parentId->id)->get();
     } else {
         $parentId = '0';
         $photoChilds = '0';
     }
     if ($post->related1 != null) {
         $related1Post = \Model\Post\ModelName::where('id', '=', $post->related1)->first();
     } else {
         $related1Post = null;
     }
     if ($post->related2 != null) {
         $related2Post = \Model\Post\ModelName::where('id', '=', $post->related2)->first();
     } else {
         $related2Post = null;
     }
     if ($post->related3 != null) {
         $related3Post = \Model\Post\ModelName::where('id', '=', $post->related3)->first();
     } else {
         $related3Post = null;
     }
     if ($lc == 'kg') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     } elseif ($lc == 'ru') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     }
     return view('Front::post.post', ['post' => $post, 'related1Post' => $related1Post, 'related2Post' => $related2Post, 'related3Post' => $related3Post, 'relatedPosts' => $relatedPosts, 'parentId' => $parentId, 'photoChilds' => $photoChilds, 'categories' => $categories, 'positionTop' => $positionTop, 'backgroundMain' => $backgroundMain]);
 }
コード例 #6
0
ファイル: HomeController.php プロジェクト: shady11/ktrk-1
 public function Post(\Model\Post\ModelName $post)
 {
     $contentOriginal = $post->getContent();
     $lc = app()->getlocale();
     if ($lc == 'kg' && $post->title != '') {
     } elseif ($lc == 'ru' && $post->titleRu != '') {
     } else {
         return redirect()->route('front.home');
     }
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $parent = \Model\PhotoParent\ModelName::where('id', '=', $post->parentId)->first();
     if ($parent) {
         $images = json_decode($parent->images);
     } else {
         $images = null;
     }
     if ($lc == 'kg') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
         if ($post->related1) {
             if (strpos($contentOriginal, 'POST1POST2') !== false) {
                 if ($post->related2) {
                     $twoPostsPos = strripos($contentOriginal, 'POST1POST2');
                     $contentRelatedPosts = substr_replace($contentOriginal, $post->twoRelatedFunction($post->related1, $post->related2), $twoPostsPos, 10);
                     $contentFinal = $contentRelatedPosts;
                 }
             } else {
                 $post1Pos = strripos($contentOriginal, 'POST1');
                 $contentRelated1 = substr_replace($contentOriginal, $post->relatedFunction($post->related1), $post1Pos, 5);
                 if ($post->related2) {
                     if (strpos($contentOriginal, 'POST2POST3') !== false) {
                         $twoPostsPos = strripos($contentRelated1, 'POST2POST3');
                         $contentRelatedPosts = substr_replace($contentRelated1, $post->twoRelatedFunction($post->related2, $post->related3), $twoPostsPos, 10);
                         $contentFinal = $contentRelatedPosts;
                     } else {
                         $post2Pos = strripos($contentRelated1, 'POST2');
                         $contentRelated2 = substr_replace($contentRelated1, $post->relatedFunction($post->related2), $post2Pos, 5);
                         if ($post->related3) {
                             $post3Pos = strripos($contentRelated2, 'POST3');
                             $contentRelated3 = substr_replace($contentRelated2, $post->relatedFunction($post->related3), $post3Pos, 5);
                             $contentFinal = $contentRelated3;
                         } else {
                             $contentFinal = $contentRelated2;
                         }
                     }
                 } else {
                     $contentFinal = $contentRelated1;
                 }
             }
         } else {
             $contentFinal = $contentOriginal;
         }
     } elseif ($lc == 'ru') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
         if ($post->relatedRu1) {
             if (strpos($contentOriginal, 'POST1POST2') !== false) {
                 if ($post->relatedRu2) {
                     $twoPostsPos = strripos($contentOriginal, 'POST1POST2');
                     $contentRelatedPosts = substr_replace($contentOriginal, $post->twoRelatedFunction($post->relatedRu1, $post->relatedRu2), $twoPostsPos, 10);
                     $contentFinal = $contentRelatedPosts;
                 }
             } else {
                 $post1Pos = strripos($contentOriginal, 'POST1');
                 $contentRelated1 = substr_replace($contentOriginal, $post->relatedFunction($post->relatedRu1), $post1Pos, 5);
                 if ($post->relatedRu2) {
                     if (strpos($contentOriginal, 'POST2POST3') !== false) {
                         $twoPostsPos = strripos($contentRelated1, 'POST2POST3');
                         $contentRelatedPosts = substr_replace($contentRelated1, $post->twoRelatedFunction($post->relatedRu2, $post->relatedRu3), $twoPostsPos, 10);
                         $contentFinal = $contentRelatedPosts;
                     } else {
                         $post2Pos = strripos($contentRelated1, 'POST2');
                         $contentRelated2 = substr_replace($contentRelated1, $post->relatedFunction($post->relatedRu2), $post2Pos, 5);
                         if ($post->relatedRu3) {
                             $post3Pos = strripos($contentRelated2, 'POST3');
                             $contentRelated3 = substr_replace($contentRelated2, $post->relatedFunction($post->relatedRu3), $post3Pos, 5);
                             $contentFinal = $contentRelated3;
                         } else {
                             $contentFinal = $contentRelated2;
                         }
                     }
                 } else {
                     $contentFinal = $contentRelated1;
                 }
             }
         } else {
             $contentFinal = $contentOriginal;
         }
     }
     return view('Front::post.post', ['post' => $post, 'relatedPosts' => $relatedPosts, 'images' => $images, 'content' => $contentFinal, 'categories' => $categories, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
コード例 #7
0
ファイル: BirinchiController.php プロジェクト: elemanz/ktrk
 public function broadcast(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     if ($lc == 'kg' && $post->title != '') {
     } elseif ($lc == 'ru' && $post->titleRu != '') {
     } else {
         return redirect()->route('birinchi.home');
     }
     $post->incrementViewed();
     $channel = \Model\Channel\ModelName::name('birinchi')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $lc = app()->getlocale();
     if ($lc == 'kg') {
         $birinchiProjects = \Model\Project\ModelName::where('published', '=', true)->where('birinchi', '=', 1)->where('name', '<>', '')->get();
     } else {
         $birinchiProjects = \Model\Project\ModelName::where('published', '=', true)->where('birinchi', '=', 1)->where('nameRu', '<>', '')->get();
     }
     return view('Front::channel.birinchi.broadcast', ['channel' => $channel, 'post' => $post, 'backgroundMain' => $backgroundMain, 'birinchiProjects' => $birinchiProjects]);
 }