xiuno贴子列表改成图文模式
效果图,客户网站
其实类似于百度贴吧效果,直接上代码吧:
打开view\htm\thread_list.inc.htm文件,在49行下面添加
<div>
<?php
$_post = db_find_one('post', array('tid' => $_thread['tid'], 'isfirst' => 1));
preg_match_all('/<img[\s\S]*?src\s*=\s*[\"|\'](.*?)[\"|\'][\s\S]*?>/i',$_post['message'],$matches);
if($matches) {
echo "<img src = '{$matches}' height = '100px'/> ";
}
if($matches) {
echo "<img src = '{$matches}' height = '100px'/>";
}
if($matches) {
echo "<img src = '{$matches}' height = '100px'/>";
}
?>
</div>
最多显示三张文章内的图片,完事,手工!
分公司的法国德国
页:
[1]