<?php if ($val['attachs']) { ?>
<div class="aw-upload-img-list width-auto" style="margin-top:15px;">
<?php $i=1;foreach($val['attachs'] AS $attach) { ?>
<?php if (check_animation($attach['attachment'])==1) { ?>
<img class="image-big" data-gifffer="<?php echo $attach['attachment']; ?>" alt="<?php echo $attach['file_name']; ?>" />
<?php } else {?>
<a href="<?php echo $attach['attachment']; ?>" target="_blank" data-fancybox-group="thumb" rel="lightbox">
<img class="img-thumbnail" style="margin-bottom:15px;" src="<?php echo $attach[thumb]; ?>" alt="<?php echo $attach['file_name']; ?>" />
</a>
<?php }?>
<?php $i++;if($i>3) break;}?>
</div>
<?php }?>
function check_animation($image_file){
$fp = fopen($image_file, 'rb');
$image_head = fread($fp,1024);
fclose($fp);
return preg_match("/".chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0'."/",$image_head) ? true : false;
}
显示三张图片吧,这样正好填满。。。
阅读全文
收起全文