public function edit_gallery() { lib()->load('Gallery'); $gallery = new Gallery(req()->_plain()->get('id'), login_user()->getId()); $this->theme->setBreadcrumb("编辑图集"); $this->theme->setTitle("编辑图集信息"); $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css"))); $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")])); $this->__view("User/header.php"); $this->__view("Photo/edit_gallery.php", ['info' => $gallery->getInfo(), 'gallery' => $gallery]); $this->__view("User/footer.php"); }
/** * @param int $id 图集ID * @param int $c_p 页数,默认使用0,根据其进行排序 */ public function gallery($id = 0, $c_p = 0) { $id = intval($id); $c_p = intval($c_p); $n = func_num_args(); if ($n < 1 || $n > 2 || $c_p < 0 || $id < 1) { $this->__load_404(); return; } $this->__lib("Gallery", 'GalleryComment'); $g = new Gallery($id); $info = $g->getInfo(true); if (!is_array($info) || !isset($info['gallery_status']) || $info['gallery_status'] != 1 && !(is_login() && $info['user_id'] == login_user()->getId() && strtolower(req()->get('preview')) == 'true')) { $this->__load_404(); } else { $this->theme->setTitle($info['gallery_title'] . " [图集]"); $this->__view("Home/header.php"); $this->__view("Show/gallery.php", ['gallery' => $g, 'info' => $info, 'CommentData' => new GalleryComment($id, $c_p, $info)]); $this->__view("Home/footer.php"); } }