在dedecms網站中調用圖片的標簽中就可以限制圖片的大小,但是有的時候這樣的標簽是沒有效果的,所以在調用的時候就起不到控制圖片大小的作用了。
解決DedeCMS獨立模型無法控制圖片大小的方法:
1、在網站其他頁面位置(比如首頁)調用獨立模型的圖片列表,需要在{dede:arclistsg }中指定channelid;如:
{dede:arclistsg channelid='8' type='image.' imgwidth='143' imgheight='106' }
這樣才能保證能夠讀取到獨立某型欄目的圖片。
2、打開/include/taglib/arclistsg.lib.php ,在192行找到如下代碼:
$row['image'] = "<img src='".$row['picname']."' border='0' alt='".ereg_replace("['><]","",$row['title'])."' />";
替換為:
$row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>";
新聞熱點
疑難解答