下面代码一般放入include.php中
调用代码(在循环里面调用):function slimgs($src){global $zbp;if(!$zbp->CheckPlugin('IMAGE')){$thumbs_src=$src;}else{$thumbs_src=IMAGE::getPicUrlBy($src,4);}return $thumbs_src;} function slimg($as,$pos){global $zbp;$temp=mt_rand(1,3);$pattern = "/<img.*?src=(\"|')?(?<src>.*?\.(gif|jpg|jpeg|png))(\"|')?.*?>/"; $content = $as->Content;if($pos->Metas->thumbnail){$temp=$pos->Metas->thumbnail;}else{if(preg_match($pattern,$content,$matchContent) && isset($matchContent['src'])){ $temp=$matchContent['src'];} else{$temp=$zbp->host . "zb_users/theme/" .$zbp->theme. "/style/images/pic.png";}}$src = slimgs($temp);return $src;}
{slimg($related,$related)}