POST TIME:2021-05-24 02:50
在最后一个 ?> 前加入以下代码
调用方法:function thumb($imgurl, $width, $height, $bg = true)
{
global $cfg_mainsite,$cfg_multi_site;
$thumb = eregi("",$imgurl)?str_replace($cfg_mainsite,'',$imgurl):$imgurl;
list($thumbname,$extname) = explode('.',$thumb);
$newthumb = $thumbname.'_'.$width.'_'.$height.'.'.$extname;
if(!$thumbname || !$extname || !file_exists(DEDEROOT.$thumb)) return $imgurl;
if(!file_exists(DEDEROOT.$newthumb))
{
include_once DEDEINC.'/image.func.php';
if($bg==true)
{
ImageResizeNew(DEDEROOT.$thumb, $width, $height, DEDEROOT.$newthumb);
}
else
{
ImageResize(DEDEROOT.$thumb, $width, $height, DEDEROOT.$newthumb);
}
}
return $cfg_multi_site=='Y'?$cfg_mainsite.$newthumb:$newthumb;
}