函数 api自定义函数{php $albums = get_albums($item, 1);}
<img src="{$albums[0]}" />
function get_albums($item, $type = 0) {
$imgs = array();
if($item['thumb'] && !preg_match("/^[a-z0-9\-\.\:\/]{50,}$/i", $item['thumb'])) $item['thumb'] = '';
if($item['thumb1'] && !preg_match("/^[a-z0-9\-\.\:\/]{50,}$/i", $item['thumb1'])) $item['thumb1'] = '';
if($item['thumb2'] && !preg_match("/^[a-z0-9\-\.\:\/]{50,}$/i", $item['thumb2'])) $item['thumb2'] = '';
if($type == 0) {
$nopic = DT_SKIN.'image/nopic60.gif';
$imgs[] = $item['thumb'] ? $item['thumb'] : $nopic;
$imgs[] = $item['thumb1'] ? $item['thumb1'] : $nopic;
$imgs[] = $item['thumb2'] ? $item['thumb2'] : $nopic;
} else if($type == 1) {
$nopic = DT_SKIN.'image/nopic240.gif';
$imgs[] = $item['thumb'] ? str_replac('.thumb.', '.middle.', $item['thumb']) : $nopic;
$imgs[] = $item['thumb1'] ? str_replac('.thumb.', '.middle.', $item['thumb1']) : $nopic;
$imgs[] = $item['thumb2'] ? str_replac('.thumb.', '.middle.', $item['thumb2']) : $nopic;
}
return $imgs;
}
您可能在找更多
修复 DESTOON10.0 资讯文章无法设置内容第几张图片为标题图的方案

在DESTOON 10.0 第一版本中,有用户反馈从文章中选择第1张图片做为缩略图出现错误,返回Array([0]=https://网址/file/upload/202510/21/172234461.jpg)经过搜索函数,发现问题在module/destoon/post.func.php 文件里
小黑 destoon程序2025-10-22
修复notification.js浏览器通知会员头像不显示问题
小黑 destoon程序2024-12-09
在DESTOON系统模板开发中imgurl函数的用法说明
小黑 随手记2024-03-10