今天看到有人需求: 最新回复展现 AND 回复展现

芋头
芋头 11111

1 人点赞了该文章 · 1770 浏览

  后台添加数据:   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-->

发布于 2015-09-19 01:13

免责声明:

本文由 芋头 原创发布于 WeCenter ,著作权归作者所有。

登录一下,更多精彩内容等你发现,贡献精彩回答,参与评论互动

登录! 还没有账号?去注册

暂无评论