今天看到有人需求: 最新回复展现 AND 回复展现
后台添加数据:
model模板
question.php底部添加
public function get_anws_index($q_id) { $answer_content = $this->fetch_row('answer',"question_id = '".intval($q_id)."'",'answer_id DESC'); return $answer_content; }函数调用:/explore/main.php 161行左右 循环里添加
$posts_list[$key]['answer_index'] = $this->model('question')->get_anws_index($val['question_id']);前台展现 explore/ajax/list.tpl.htm
<!--修改5/7/19 huifu--> <p id="miaoshu"> <?php if($val['answer_info']['answer_content']){?> <?php echo cjk_substr(strip_ubb($val['answer_info']['answer_content']), 0, 130, 'UTF-8', '...'); ?> <?php }else{?> <?php echo cjk_substr(strip_ubb($val['answer_index']['answer_content']), 0, 130, 'UTF-8', '...');?> <?php }?> </p> <!--end huifu-->
暂无评论