<?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?>
{
{php $cc = current($zutu);}
href: "{dr_get_file($cc)}",
src: "{dr_get_file($c)}",
img: "{dr_get_file($c)}",
width: "237", height: "150",
title: "{$t['title']}"
},
<?php $key++;} } ?>我想调用该图片的宽度的数值,写成100%和auto都不行,系统里有没有这个变量可以调出来?
<?php $size = getimagesize(dr_get_file($c)); ?> width: "{$size[0]}", height: "{$size[1]}",你这又是用循环又是用单一输出,思维太混了,影响页面速度啊<?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?> { index: {$key+1}, href: "{dr_get_file($c)}", src: "{dr_get_file($c)}", img: "{dr_thumb($c, 200, 200)}", {php $size = getimagesize(dr_thumb($c)); } width: "{$size[0]}", height: "150", title: "{$t['title']}" }, <?php $key++;} } ?>调出来了,感谢大神,确实现在这个代码的执行效率太慢,页面打开明显慢多了,怎么优化一下速度呢?<?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?> { index: {$key+1}, href: "{dr_get_file($c)}", src: "{dr_get_file($c)}", img: "{dr_thumb($c, 200, 200)}", {php $at=$ci->get_attachment($c);if ($at && $at.attachinfo) { $size=[$at['attachinfo']['width'], $at['attachinfo']['height']];} { $size = getimagesize(dr_get_file($c))}; } width: "{$size[0]}", height: "150", title: "{$t['title']}" }, <?php $key++;} } ?><?php if($zutu) { $key=0; foreach($zutu as $c) { ?> { index: {$key+1}, href: "{dr_get_file($c.file)}", src: "{dr_get_file($c.file)}", img: "{dr_thumb($c.file, 200, 200)}", <?php $at = $ci->get_attachment($c.file); if ($at && $at.attachinfo) { $size=[$at['attachinfo']['width'], $at['attachinfo']['height']]; } else { $size = getimagesize(dr_get_file($c.file)); } ?> width: "{$size[0]}", height: "{$size[1]}", title: "{$t['title']}" }, <?php $key++; } } ?>