為dedecms3.0.1采集器增加縮圖功能_DedeCms教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
需要更改源文件,而且未經(jīng)過嚴(yán)格驗(yàn)證,只作交流用。
1:打開治理目錄中 action_co_export.php。
在開始部分加上
require_once(dirname(__FILE__)."/../include/inc_photograph.php");
在68行下增加
/**********縮圖生成開始**************************************************/
$litpic="";
$DBlipic="";
if(preg_match("~(/upimg. ?)(\" ?) ~",$fields[$body_sel],$match)){
$litpic=$match[1];
$imagesdir=$cfg_basedir.$litpic;
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png");
$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; } }
/*********************縮圖生成結(jié)束*************************/ 這里我用$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,
$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; } }
/*********************縮圖生成結(jié)束*************************/ 這里我用$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,
相關(guān)DedeCms教程:
- Dedecms生成百度地圖圖文教程
- 織夢dedecms生成下拉式友情鏈接列表
- DEDECMS使用拼音首字母做欄目名稱
- 織夢DEDECMS站群增強(qiáng)版 DedeCMS搭建站群首選
- DedeCMS Error:Tag disabled:php錯(cuò)誤的完整處理方法
- dedecms編碼轉(zhuǎn)換方法 gbk轉(zhuǎn)UTF-8,UTF-8轉(zhuǎn)GBK
- 防XSS,sql注射,代碼執(zhí)行,文件包含的通用代碼
- DedeCms教程:優(yōu)化DedeCMS搜索結(jié)果
- DedeCms教程:Linux+Apache+PHP+MySQL服務(wù)器環(huán)境(CentOS篇)
- DedeCms教程:LuManager服務(wù)器管理軟件安裝DEDECMS軟件
- DedeCms教程:Ubuntu/Debian上安裝 PHP 5.3, Nginx 和 PHP-fpm
- DedeCms教程:windows server 2003 php 環(huán)境搭建
DedeCms教程教程Rss訂閱Cms教程搜索
DedeCms教程推薦
- 新手6天來使用DEDEcms建站的一些經(jīng)驗(yàn)總結(jié)
- DEDECMS導(dǎo)航改為“文章標(biāo)題-2級欄目-1級欄目-網(wǎng)站名”樣式
- Dedecms4.0RC1整合phpwind 5.3完全攻略
- Dedecms新手學(xué)習(xí)路線,強(qiáng)烈推薦!
- DedeCms教程:友情鏈接插件使用說明
- 織夢DedeCms教程:后臺欄目管理處顯示未審核文檔數(shù)
- 實(shí)時(shí)更新的【熱門關(guān)鍵字】!
- DEDECMS廣告延遲加載顯示
- DedeCms2007 V5_RC1個(gè)人會員自選空間模板簡單教程
- 讓跳轉(zhuǎn)網(wǎng)址直接鏈接而非跳轉(zhuǎn)的最簡單方法
- 相關(guān)鏈接:
復(fù)制本頁鏈接| 搜索為dedecms3.0.1采集器增加縮圖功能| DedeCms模板| Dede模板| 織夢模板| dedecms
- 教程說明:
DedeCms教程-為dedecms3.0.1采集器增加縮圖功能。