public function single($id) { $gallery = GalleryQuery::create()->findPk($id); $images = $gallery->getImages(); if (!$gallery) { $this->addPopup('danger', 'Galerie se specifikovaným identifikačním číslem neexistuje.'); redirectTo('/galerie'); } $this->view('Gallery/single', 'base_template', ['active' => 'gallery', 'title' => 'Galerie', 'recent' => ArticleQuery::recent(), 'gallery' => $gallery, 'images' => $images, 'js' => 'plugins/fotorama/fotorama', 'css' => 'plugins/fotorama/fotorama']); }
public function index() { if (isset($_POST["search"])) { $s = $_POST["search"]; } $users = UserQuery::create()->where('User.Username like ?', '%' . $s . '%')->orderByPermissions('desc')->join('Image')->withColumn('Image.Path', 'AvatarPath')->select('Username', 'AvatarPath')->find(); $articles = ArticleQuery::create()->where('Article.Title like ?', '%' . $s . '%')->_or()->where('Article.Keywords like ?', '%' . $s . '%')->orderByCreatedAt('desc')->join('User')->withColumn('User.Username', 'Author')->join('Category')->withColumn('Category.Name', 'CatgName')->join('Image')->withColumn('Image.Path', 'ImgPath')->select(array('Author', 'CatgName', 'ImgPath', 'Id', 'Title'))->find(); if ($articles->isEmpty() && $users->isEmpty()) { $this->addPopup('danger', 'Nebyl nalezen žádný článek ani uživatel.'); } $this->view('Search/index', 'base_template', ['active' => 'search', 'title' => 'Vyhledávání', 'recent' => ArticleQuery::recent(), 'articles' => $articles, 'users' => $users]); }
public function index() { $participants = array(2, 1); $users = UserQuery::create()->filterByIdMember($participants)->joinWith('Image')->joinWith('Member')->useMemberQuery()->joinWith('Quote')->endUse()->find(); $this->view('Landing/index', 'base_template', ['active' => 'landing', 'title' => 'Hlavní stránka', 'recent' => ArticleQuery::recent(), 'js' => array('plugins/fotorama/fotorama', 'scripts/landingpagemembers'), 'css' => 'plugins/fotorama/fotorama', 'users' => $users]); }
public function index() { //SQL $this->view('Register/index', 'base_template', ['active' => 'register', 'title' => 'Registrace', 'recent' => ArticleQuery::recent()]); }
public function showByCategoryPage($category, $id) { $id = $id == 0 ? 1 : $id; $articles = ArticleQuery::create()->useCategoryQuery()->filterByUrl($category)->endUse()->joinWith("Category")->orderByCreatedAt("desc")->paginate($page = $id, $maxPerPage = 10); $this->view('Article/category', 'base_template', ['active' => 'blog', 'title' => $articles->getFirst()->getCategory()->getName(), 'recent' => ArticleQuery::recent(), 'articles' => $articles]); }
public function ideaSuggestionPage() { if (!$this->isLogged()) { $this->addPopup('danger', 'Pro podání návrhu na zlepšení musíte být přihlášeni.'); redirectTo("/"); } $this->view('Profile/ideaSuggestion', 'base_template', ['active' => 'ideaSuggestion', 'title' => 'Podat návrh', 'recent' => ArticleQuery::recent()]); }
public function index() { $participants = UserQuery::create()->joinWith("Member")->joinWith("Image")->find(); $this->view('Info/index', 'base_template', ['active' => 'info', 'title' => 'Informace', 'recent' => ArticleQuery::recent(), 'participants' => $participants]); }