<ul class="related"><span><h1>相关文章</h1></span> {php} $related = $zbp->GetArticleList('*', array(array('=', 'log_Type', 0), array('=', 'log_Status', 0)), array('log_PostTime' => 'DESC'), 5, null,false); {/php} {foreach GetList(5,$article.Category.ID) as $related} <li style="float:left; width: 15%; height: 200px;padding: 12px; "> <img src=" {php} $randimg=rand(1,4); $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; $content = $related->Content; preg_match_all($pattern,$content,$matchContent); if(isset($matchContent[1][0])) $randimg=$matchContent[1][0]; else $randimg="$host/zb_users/theme/default/style/default/$randimg.jpg"; {/php} {$randimg}" class="pic" width="100%" title="{$related.Url}" height="50%" alt="{$related.Url}" pagespeed_url_hash="3167944164"> </a> <a href="{$related.Url}" title="{$related.Title}"> {$related.Title} </a> </li> {/foreach} </ul>
zb_users/theme/default/style/default 在此文件夹内上传4张图片,名称为1.jpg,2.jpg,3.jpg,4.jpg