public function action_add() { $view = View::factory('sport_add'); $view->description = ''; if ($_POST) { $refs = array(); $refCount = $_POST['refCount']; for ($i = 1; $i <= $refCount; $i++) { array_push($refs, $_POST['ref' . $i]); } $ref_ids = array(); foreach ($refs as $ref) { if (!id_from_name($ref)) { array_push($this->template->errors, "Could not find user: "******"/sport?success"); } else { $view->description = $description; } } $this->template->content = $view; }
public function index($content_name) { $content = Content::find(id_from_name($content_name)); $recommends = Content::where('id', '!=', $content->id)->where('recommend', 1)->take(config('app.frontEnd.content.recommend_show'))->get(); if (count($recommends) === 0) { $recommends = Content::where('id', '!=', $content->id)->orderByRaw("RAND()")->take(config('app.frontEnd.content.recommend_show'))->get(); } return view('detail', ['adsCategories' => AdsCatg::all(), 'category_menus' => Category::all(), 'content' => $content, 'date' => new Carbon(), 'recomend_contents' => $recommends, 'user' => Auth::user()]); }
public function action_add() { $community = $this->request->param('id'); if (!$community) { $this->request->redirect(URL::base() . 'tournament'); } $view = View::factory('tournament_add'); $view->community = com_from_id($community); $view->available_maps = get_maps(); /* $view->refs = ''; $view->maps = ''; */ $view->description = ''; $view->exclusive = ''; if ($_POST) { $refs = array(); $refCount = $_POST['refCount']; for ($i = 1; $i <= $refCount; $i++) { array_push($refs, $_POST['ref' . $i]); } $ref_ids = array(); foreach ($refs as $ref) { if (!id_from_name($ref)) { array_push($this->template->errors, "Could not find user: "******"You are not the admin of this community."); } if (empty($this->template->errors)) { //DB::insert('tournies', array('community','admin','description','exclusive'))->values(array($community,$this->user,$description,$exclusive))->execute(); $this->request->redirect("/tournament?success"); } else { $view->description = $description; $view->exclusive = $exclusive; } } $this->template->content = $view; }
public function index($channelNameID) { $channel_id = id_from_name($channelNameID); return view('webboard', ['selected_channel' => $channel_id, 'channels' => Channel::all(), 'user' => Auth::user(), 'topics' => Topic::where('category_id', id_from_name($channel_id))->paginate(config('app.frontEnd.topic.per_page'))]); }