public function indexAction() { //获取用户设置 $blog = Model\Blog::show(); $use_theme_id = isset($blog['data']['theme_id']) ? $blog['data']['theme_id'] : 0; //获取主题列表 $themes = Model\Theme\Main::userTpls(); $this->viewDisplay(array('themes' => $themes, 'use_theme_id' => $use_theme_id)); }
public function indexAction() { $name = Comm\Arg::post('name'); $desc = Comm\Arg::post('desc'); $page_count = Comm\Arg::post('page_count', FILTER_VALIDATE_INT); $comment_duoshuo = Comm\Arg::post('comment_duoshuo'); $timezone = Comm\Arg::post('timezone'); Model\Blog::save(array('name' => $name, 'desc' => $desc, 'page_count' => $page_count, 'comment_duoshuo' => $comment_duoshuo, 'timezone' => $timezone)); Comm\Response::json(100000, '操作成功', null, false); }
/** * 构造方法 * * @return void */ public function __construct() { //设置模板ID if (Yaf_Registry::get('tpl_id')) { $tpl_id = Yaf_Registry::get('tpl_id'); } else { $blog = Model\Blog::show(); if (!empty($blog['data']['theme_id'])) { $tpl_id = $blog['data']['theme_id']; } } empty($tpl_id) || ($this->_tpl_id = $tpl_id); }
public function indexAction() { $last_page = Comm\Arg::get('last_page', FILTER_VALIDATE_INT, ['min_range' => 1]) ?: 0; $page = Comm\Arg::get('p', FILTER_VALIDATE_INT, ['min_range' => 1]) ?: 1; $uid = Yaf_Registry::get('current_uid'); //获取总数 $total = Model\Counter\Article::get(0, $uid); //获取用户的博客配置中的分页设置 $blog = Model\Blog::show(); empty($blog['data']['page_count']) || ($this->_limit = $blog['data']['page_count']); //获取分页参数 $pager = new \Comm\Pager($total, $this->_limit); //获取数据 $articles = Model\Article::showUserList($pager); //获取分类内容 $categorys = Model\Category::showUserAll(); $categorys = Comm\Arr::hashmap($categorys, 'id'); //获取用户博客基本地址 $blog_url = 'http://' . \Model\Github::showDefaultBlogRepoName(); $this->viewDisplay(array('articles' => $articles, 'categorys' => $categorys, 'pager' => $pager, 'blog_url' => $blog_url)); }
public function indexAction() { $blog = Model\Blog::show(); $basic = new \Entity\Tarr(isset($blog['data']) ? $blog['data'] : array()); $this->viewDisplay(['basic' => $basic]); }
public function indexAction() { $theme_id = Comm\Arg::post('theme_id'); $result = Model\Blog::save(array('theme_id' => $theme_id)); Comm\Response::json(100000, '操作成功', ['result' => $result], false); }