DedeCMS图集中缩略图不显示的解决方法
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>本文实例讲述了DedeCMS图集中缩略图不显示的解决方法。分享给大家供大家参考。具体分析如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
图集中缩略图不显示的原因在于,你上传的<u>图片</u>尺寸同时小于DEDE后台设置的默认缩略图尺寸.</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
其解决方法有二种:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
其一:在后台把默认缩略图宽或高的一个尺寸调小,让你上传的图片二个尺寸中的一个大于,默认值.</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
其二:就是通过修改程序的方式来解决,本方法在DEDE5.5GBK版下测试通过,在文件include/image.func.php中找到 <br>
</p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode10" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
if($srcW<=$toW && $srcH<=$toH ) return true;</div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>替换成如下代码: </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode11" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
//增加小于缩略图尺寸处理开始 <br>
if($srcW<=$toW && $srcH<=$toH ) <br>
{ <br>
$ftoH=$toH; <br>
$ftoW=$toH; <br>
if(function_exists("imagecreatetruecolor")) <br>
{ <br>
@$ni = imagecreatetruecolor($ftoW,$ftoH); <br>
if($ni) <br>
{ <br>
imagecopyresampled($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH); <br>
} <br>
else <br>
{ <br>
$ni=imagecreate($ftoW,$ftoH); <br>
imagecopyresized($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH); <br>
} <br>
} <br>
else <br>
{ <br>
$ni=imagecreate($ftoW,$ftoH); <br>
imagecopyresized($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH); <br>
} <br>
switch ($srcInfo) <br>
{ <br>
case 1: <br>
imagegif($ni,$toFile); <br>
break; <br>
case 2: <br>
imagejpeg($ni,$toFile,100); <br>
break; <br>
case 3: <br>
imagepng($ni,$toFile); <br>
break; <br>
case 6: <br>
imagebmp($ni,$toFile); <br>
break; <br>
default: <br>
return false; <br>
} <br>
imagedestroy($ni); <br>
} <br>
//增加小于缩略图尺寸处理结束</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
当然,如果这个时候还没解决,就考虑下浏览器问题吧,IE模式下,打开Internet选项->高级->使用兼容性视图自动恢复页面布局错误,刷新应该就OK了。</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
希望本文所述对大家的dedecms建站有所帮助。</p>
頁:
[1]