{dede:list pagesize='20'}
[field:array runphp='yes']
global $dsql,$cfg_imghost;
$res = $dsql->GetOne('select body from #@__addonarticle where aid='.@me[id]);
preg_match_all('/<img(.*?)src="(.+?)"/i', $res['body'], $m);
$images = array();
$html = '';
foreach($m[2] as $key=>$val) {
if ($key>3) break;
if(strpos($val,'http://')===false && strpos($val,'https://')===false && strpos($val, 'www') === false){
$images[]=array('url'=>$cfg_imghost.$val);
}else{
$images[]=array('url'=>$val);
}
}
$url = @me[arcurl];
$title = @me[title];
if(count($images)>2){
$html = '<dl class="list"><a href="'.$url.'" target="_blank"><dt>'.$title.'</dt></a>
<div class="list_image">
<ul class="cle">
<li class="list_img_holder"><a href="'.$url.'" target="_blank"><img src="'.$images[0][url].'" /></a></li>
<li class="list_img_holder"><a href="'.$url.'" target="_blank"><img src="'.$images[1][url].'" /></a></li>
<li class="list_img_holder"><a href="'.$url.'" target="_blank"><img src="'.$images[2][url].'" /></a></li>
</ul>
<dd><span class="author">'.@me[writer].'</span><span class="time">'.GetDateMk(@me['pubdate']).'</span></dd>
</div>
</dl>';
} else if(count($images)>=1) {
$html = '<dl class="list one_list"><div class="tit"><a href="'.$url.'" target="_blank"><dt>'.$title.'</dt></a>
<dd><span class="author">'.@me[writer].'</span><span class="time">'.GetDateMk(@me['pubdate']).'</span></dd></div>
<div class="img"><a href="'.$url.'" class="preview" target="_blank"><img src="'.@me['litpic'].'" alt="'.$title.'" /></a></div></dl>';
} else {
$html = '<dl class="list two_list"><div class="tit"><a href="'.$url.'" target="_blank"><dt>'.$title.'</dt></a>
<dd><span class="author">'.@me[writer].'</span><span class="time">'.GetDateMk(@me['pubdate']).'</span></dd></div></dl>';
}
@me = $html;
[/field:array]
{/dede:list}