该问题已被锁定!
4
关注
2796
浏览

关于专栏查看

AI智能回复搜索中,请稍后...

为什么被折叠? 0 个回复被折叠
奔跑吧少年 中级会员 用户来自于: 安徽省合肥市
2018-07-05 11:44
找到app/column/main.php
public function index_action()
{  
       if(!$this->user_id)
       {
           H::redirect_msg(AWS_APP::lang()->_t('请先登陆'), '/');
       }
       if (!$_GET['sort'])
       {
           $_GET['sort'] = 'sum';
       }
改为
public function index_action()
{  
       if (!$_GET['sort'])
       {
           $_GET['sort'] = 'sum';
       }
维特根斯坦 初级会员 用户来自于: 广西钦州市
2018-08-04 22:45
@Coding思维  我们我的不行啊,求教 看你的代码只是去掉了
if(!$this->user_id)
       {
           H::redirect_msg(AWS_APP::lang()->_t('请先登陆'), '/');
       }
我直接去掉上面这段代码变成下面的
['rule_type'] = "white";

		$rule_action['actions'] = array(
			'index',
			'details',
			'my',
		);

		return $rule_action;
	}

	public function setup()
	{
		HTTP::no_cache_header();

		$this->crumb(AWS_APP::lang()->_t('专栏'), '/column/');
	}

	public function index_action()
	{  
        
        if (!$_GET['sort'])
        {
            $_GET['sort'] = 'sum';
        }

		$column_info = $this->model('column')->fetch_column_list($this->user_id , 1 , 6 ,$_GET['sort']);

        $this->crumb(AWS_APP::lang()->_t('专栏'), '/column/');
        
        $article_list = $this->model('article')->get_articles_list( null,1, 6,  'add_time desc', null, false);

        foreach ($article_list as $key => $value) {
              $article_list[$key]['user'] = $this->model('account')->get_user_info_by_uid($value['uid']);
        }        

		$recommend_info = $this->model('column')->fetch_column_list($this->user_id, 1 , 5 , 'sum' ,'month');
   
        TPL::import_js('js/layout.js');
        
        TPL::import_css('css/nindex.css');
        //首页专栏
        TPL::assign('column_info', $column_info);

        TPL::assign('column_list_bit', TPL::output('column/ajax/column_list', false));
        //推荐专栏
		TPL::assign('recommend_info', $recommend_info);
		//文章推荐
		TPL::assign('article_list', $article_list);

		TPL::output('column/index');
		
	}



	public function details_action()
	{   
        
        if(!$this->user_id)
        {
            H::redirect_msg(AWS_APP::lang()->_t('请先登陆'), '/');
        }

		if (!$column_info = $this->model('column')->get_column_by_id($_GET['id']))
		{
			H::redirect_msg(AWS_APP::lang()->_t('专栏不存在'), '/');
		}
		if ($column_info['is_verify'] != 1 && $this->user_id != $column_info['uid'])
		{   
			H::redirect_msg(AWS_APP::lang()->_t('专栏未启用或者未审核'), '/');
		}
        
        

		$this->crumb($column_info['column_name'], '/column/details/' . $column_info['column_id']);

		$column_info['user_info']=$this->model('account')->get_user_info_by_uid($column_info['uid']);
        

        $column_info['article_sum_count'] = $this->model('column')->get_column_views_num($column_info['column_id']);
        
        $column_info['article_num'] = $this->model('column')->get_column_article_num($column_info['column_id']);

		$article_list = $this->model('column')->fetch_user_article_list($column_info['column_id'], $_GET['page']? :1 , 6 ,'建议');
        

		TPL::assign('pagination', AWS_APP::pagination()->initialize(array(
            'base_url' => get_js_url('/column/details/id-' . $column_info['column_id'].''),
            'total_rows' => $this->model('column')->found_rows(),
            'per_page' => 6
        ))->create_links());

		TPL::assign('article_list', $article_list);

		TPL::assign('column_info', $column_info);

        TPL::import_js('js/layout.js');

        TPL::import_css('css/nindex.css');

        TPL::assign('has_focus_column', $this->model('column')->has_focus_column($this->user_id, $column_info['column_id']));
        
        TPL::assign('user_actions', $this->model('actions')->get_user_actions($user['uid'], 5, implode(',', array(
			ACTION_LOG::ADD_QUESTION,
			ACTION_LOG::ANSWER_QUESTION,
			ACTION_LOG::ADD_REQUESTION_FOCUS,
			ACTION_LOG::ADD_AGREE,
			ACTION_LOG::ADD_TOPIC,
			ACTION_LOG::ADD_TOPIC_FOCUS,
			ACTION_LOG::ADD_ARTICLE
		)), $this->user_id));
        //热门文章
        TPL::assign('hot_article_list',$this->model('article')->get_articles_list(null , 1 , 10 , 'views DESC' , null , $column_info['uid']));

		TPL::output('column/details');

	}


	public function my_action(){
        $this->crumb(AWS_APP::lang()->_t('我的专栏'), '/column/my/');
        if ($columns = $this->model('column')->get_my_column_page($this->user_id,1,5)) {
            foreach ($columns as $key=>$column) {
                $nums = $this->model('column')->column_info_nums($column['column_id']);
                $columns[$key]['article_count'] = $nums['article_count'];
                $columns[$key]['view_count'] = $nums['view_count'];
                $columns[$key]['vote_count'] = $nums['vote_count'];
            }
        };
        TPL::assign('sidebar_recommend_users_topics', $this->model('module')->recommend_users_topics($this->user_id));
        TPL::assign('post_hash', new_post_hash());
        TPL::assign('columns', $columns);
        TPL::import_css('css/nindex.css');
        TPL::output('column/my');
    }

    public function apply_action()
    {
        if (!$this->user_info['permission']['publish_column'])
        {
            H::redirect_msg(AWS_APP::lang()->_t('你所在用户组没有权限申请专栏'));
        }
        TPL::import_js('js/fileupload.js');
        TPL::import_css('css/nindex.css');
        TPL::output('column/apply');
    }

    public function edit_apply_action()
    {
        if (!$column_info = $this->model('column')->get_column_by_id($_GET['id'])){
            H::redirect_msg(AWS_APP::lang()->_t('指定专栏不存在'),'/');
        }
        if (!$this->user_info['permission']['is_administortar'] AND !$this->user_info['permission']['is_moderator'] and !$this->user_info['permission']['edit_column'] and $column_info['uid']!=$this->user_id)
        {
            H::redirect_msg(AWS_APP::lang()->_t('你没有权限编辑这个专栏'),'/');
        }
        if ($column_info['is_verify'] == 0) {
            H::redirect_msg(AWS_APP::lang()->_t('审核中的专栏无法编辑'),'/');
        }
        TPL::assign('column', $column_info);
        TPL::import_js('js/fileupload.js');
        TPL::import_css('css/nindex.css');
        TPL::output('column/edit_apply');
    }
}
  大佬,帮我看看,错哪了?

关于作者

问题动态

发布时间
2018-07-05 11:25
更新时间
2018-08-04 22:45
关注人数
4 人关注

推荐内容

新增文章快速加入专栏功能
专栏有BUG,需要登录才能查看专栏
手机版里面没有专栏这个功能吧
手机版的专栏如何取消游客不能查看
发现了个bug
手机端专栏申请的封面没找到上传的地方?
有没有人用过合适的“自媒体”程序?
测试问题,已删除
to知乎模板用户:修改专栏列表显示数量(非模板用户适用)
【Feature Request】关于专栏