예제 #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getInstanceEdit($id)
 {
     if (Session::get('user_level') < Config::get('cms.editMemes')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     try {
         $this->setLayout();
         $_SESSION['RF']['subfolder'] = 'memes/';
         $meme = MemeInstance::findOrFail($id);
         $memes = Meme::all();
         View::share('meme', $meme);
         View::share('memes', $memes);
         View::share('title', Lang::get('admin.memeGenerator'));
         $this->layout->content = View::make('backend.puskice.memes.editMemeInstances');
     } catch (Exception $e) {
         return Redirect::to(_l(URL::action('MemeController@getInstances')))->with('message', Lang::get('admin.noSuchMeme'))->with('notif', 'danger');
     }
 }
예제 #2
0
 public function newMeme()
 {
     $title = "Нови постер | Пушкице";
     View::share('title', strip_tags($title));
     $memes = Meme::all();
     Session::put('antispam1', rand(0, 20));
     Session::put('antispam2', rand(0, 20));
     //$articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get();
     $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get();
     $results = News::inCategories(Config::get('settings.results'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
     $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get();
     $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get();
     $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
     $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
     $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4);
     $poll = null;
     $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first();
     if (isset($poll->id)) {
         $poll->pollOptions;
     }
     $meta = "\t<meta property='og:image' content='" . Config::get('settings.defaultImg') . "'/>\n\t\t\t\t\t\t<meta property='og:title' content='" . __("Меме генератор | Пушкице | Тачка спајања студената ФОН-а") . "'/>\n\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/memes/new") . "'/>\n\t\t\t\t\t\t<meta property='og:description' content='" . __("Меме генератор | Пушкице") . "' />\n\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:title' content='" . __("Меме генератор | Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:description' content='" . __(strip_tags("Меме генератор")) . "'>\n\t\t\t\t\t\t<meta name='twitter:image' content='" . Config::get('settings.defaultImg') . "'>";
     $data = array('featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'meta' => $meta, 'memes' => $memes);
     $this->setLayout($data);
     $this->layout->center = View::make('frontend.content.newMeme', $data);
 }