关于在话题页面,调首页(发现)页面的的热门话题的相关解析
把这段复制到话题页面里app/topic/main.php {控制器名为index_action里面,可以靠后点的位置} 然后面模板中就可以使用// 边栏热门话题 if (TPL::is_output('block/sidebar_hot_topics.tpl.htm', 'explore/index')) { TPL::assign('sidebar_hot_topics', $this->model('module')->sidebar_hot_topics($category_info['id'])); }
<div class="mod-body"> <?php if (is_array($this->sidebar_hot_topics)) { ?> <?php foreach($this->sidebar_hot_topics AS $key => $val) {?> <dl> <dt class="pull-left aw-border-radius-5"> <a href="topic/<?php echo $val['topic_title'];?>"><img alt="" src="<?php echo get_topic_pic_url('mid', $val['topic_pic']); ?>" /></a> </dt> <dd class="pull-left"> <p class="clearfix"> <span class="topic-tag"> <a href="topic/<?php echo $val['topic_title'];?>" class="text" data-id="<?php echo $val['topic_id']; ?>"><?php echo $val['topic_title'];?></a> </span> </p> <p><?php _e('%s 个问题', '<b>' . $val['discuss_count'] . '</b>'); ?>, <?php _e('%s 人关注', '<b>' . $val['focus_count'] . '</b>'); ?></p> </dd> </dl> <?php } ?> <?php } ?> </div>
2020-06-06 16:21
2016-11-23 16:20
2016-11-08 13:02
2016-11-07 15:14
2016-11-07 14:21
2016-11-01 13:26
2016-11-01 13:23
2016-11-01 12:47
2016-11-01 09:53