为dedecms3.0.1采集器增加缩图功能
$savepath = $ddcfg_image_dir.str_replace("-","",GetDateMk($pubdate));CreateDir($savepath);$rname = GetPinyin($title,1,0);$rndname = substr($rname,strlen($rname)-6,6).$typeid;$fullUrl = $savepath."/".$rndname;$spdd = 1;while(true){ if(!file_exists($cfg_basedir.$fullUrl."-".$spdd.".jpg")||$spdd>1000) break; $spdd ;}$fullUrl = $fullUrl."-".$spdd.".jpg";$limg=$cfg_basedir.$fullUrl;copy($imagesdir,$limg); //@unlink($litpic); if(ImageResize($limg,200,120)){ $DBlipic=$fullUrl;}}
/*********************缩图生成结束*************************/ 这里我用$cfg_basedir作为路径未成功,最后使用了硬代码。if(ImageResize($limg,200,120))这里的200,和120是你要生成的缩图的尺寸。2:在文件中找到$inQuery = "INSERT INTO dede_archives(typeid,typeid2,sortrank,iscommend,ismake,channel,arcrank,click,title,color,writer,source,litpic,pubdate,senddate,adminID,memberID,description,keywords) VALUES ('$typeid','$typeid2','$sortrank','$iscommend','$ismake','1','$arcrank','0','$title','$color','$writer','$source','','$pubdate','$senddate','$adminID','0','$description','$keywords');";改为$inQuery = "INSERT INTO dede_archives(typeid,typeid2,sortrank,iscommend,