首页 > 教程 > 前端技术 > 二开教程

    收藏

    destoon调用供应产品图片的函数方法
    DT模板2016-09-15二开教程62℃
    广告
    核心提示: $albums =  get_albums($item, 1);img src={DT_SKIN}image/nopic.gif /方法如下:function get_albums($item, $type = 0) {         $imgs = array();         if($item['thumb']!preg_match(/^[a-z0-9\-\.\:\/]{50,}$/i, $item['thumb'])) $item['thum
    $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; 
        } 
 
  • 文本链接:https://mbtxw.com/Course/show.php?itemid=15
  • 文章来源:模板模板
  • 版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
标签: destoon 标签调用
0相关评论

    QQ交流群

    模板天下网QQ群

  • 欢迎DT爱好者加群学习交流:68503649

    联系关注

  • MBTXW.COM腾讯微博
  • 536205792QQ号
  • 68503649加QQ群
  • 536205792@qq.com客服邮箱