该问题已被锁定!
3
关注
2813
浏览

今日话题不能放在问题页或者文章页

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

查看全部 1 个回答

kk 超级管理员 用户来自于: 广东省深圳市
2014-04-17 13:39
模板添加了,还需要把这段代码放到app里面去
if ($today_topics = rtrim(get_setting('today_topics'), ','))
		{
			if (!$today_topic = AWS_APP::cache()->get('square_today_topic_' . md5($today_topics)))
			{
				if ($today_topic = $this->model('topic')->get_topic_by_title(array_random(explode(',', $today_topics))))
				{					
					$today_topic['best_answer_users'] = $this->model('topic')->get_best_answer_users_by_topic_id($today_topic['topic_id'], 5);
					
					$today_topic['questions_list'] = $this->model('posts')->get_posts_list('question', 1, 3, 'new', explode(',', $today_topic['topic_id']));
					
					AWS_APP::cache()->set('square_today_topic_' . md5($today_topics), $today_topic, (strtotime('Tomorrow') - time()));
				}
			}
			
			TPL::assign('today_topic', $today_topic);
		}

关于作者

bugeng 注册会员

这家伙很懒,还没有设置简介

问题动态

发布时间
2014-04-17 12:18
更新时间
2014-04-17 13:39
关注人数
3 人关注