織夢(mèng)開(kāi)啟附件遠(yuǎn)程同步
系統(tǒng)-核心,開(kāi)啟遠(yuǎn)程站點(diǎn)和遠(yuǎn)程發(fā)布
讓縮略圖支持同步和加入附件服務(wù)器域名
1、打開(kāi) /dede/imagecut.php 找到
//對(duì)任意裁剪方式再次縮小圖片至限定大小
if($newwidth > $cfg_ddimg_width || $newheight > $cfg_ddimg_height)
{
ImageResize($ddpicokurl, $cfg_ddimg_width, $cfg_ddimg_height);
}
在下面加入
if($cfg_remote_site=='Y' && $remoteuploads == 1) { //啟用遠(yuǎn)程站點(diǎn)則創(chuàng)建FTP類 require_once(DEDEINC.'/ftp.class.php'); if(file_exists(DEDEDATA."/cache/inc_remote_config.php")) { require_once DEDEDATA."/cache/inc_remote_config.php"; } if(empty($remoteuploads)) $remoteuploads = 0; if(empty($remoteupUrl)) $remoteupUrl = ''; //初始化FTP配置 $ftpconfig = array( 'hostname'=>$rmhost, 'port'=>$rmport, 'username'=>$rmname, 'password'=>$rmpwd ); $ftp = new FTP; $ftp->connect($ftpconfig); //分析遠(yuǎn)程文件路徑 $remotefile = str_replace(DEDEROOT, '', $ddpicokurl); $localfile = '..'.$remotefile; //創(chuàng)建遠(yuǎn)程文件夾 $remotedir = preg_replace('/[^\/]*\.(jpg|gif|bmp|png)/', '', $remotefile); $ftp->rmkdir($remotedir); $ftp->upload($localfile, $remotefile); }