效果图,客户网站
其实类似于百度贴吧效果,直接上代码吧:
打开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[1][0]) {
echo "<img src = '{$matches[1][0]}' height = '100px'/> ";
}
if($matches[1][1]) {
echo "<img src = '{$matches[1][1]}' height = '100px'/>";
}
if($matches[1][2]) {
echo "<img src = '{$matches[1][2]}' height = '100px'/>";
}
?>
</div>
最多显示三张文章内的图片,完事,手工!
有关PHP系统、Discuz或网站等各种问题,可以联系QQ1069971363寻求付费支持
|