人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

業(yè)界新聞動(dòng)態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁      樂道系統(tǒng)FAQ      Fckeditor增加圖片水印功能

Fckeditor增加圖片水印功能

標(biāo)簽: 發(fā)布日期:2014-05-17 00:00:00 667

一個(gè)網(wǎng)站系統(tǒng)采用FCKeditor編輯器,此編輯器沒有水印功能,網(wǎng)站系統(tǒng)本身自帶水印功能,但是編輯器里面沒有上傳圖片加水印功能?,F(xiàn)計(jì)劃增加水印功能。

1、語言文件set_picture.lang.php

'watermark' => array(
'水印添加條件:','上傳圖片小于該規(guī)格將不添加水印',
'水印類型:','圖片水印','文字水印','文字水印需 FreeType 支持',
'水印文件:','水印添加位置:',
'1.頂部居左','2.頂部居中','3.頂部居右','4.左邊居中','5.圖片中心','6.右邊居中','7.底部居左','8.底部居中','9.底部居右',
'水印位于圖片上的位置 (3x3,共 9 個(gè)位置可選)',
'水印偏移調(diào)整:','橫向','縱向','Px','調(diào)節(jié)水印偏移位置,可以填寫負(fù)數(shù)',
'水印文字字體:','位于 fonts 目錄下的字體文件',
'水印文字顏色:','字體顏色',
'水印文字:','如果含有中文請選擇支持中文的字體文件',
'字體大小:','設(shè)置文字水印字體大小',
'文字旋轉(zhuǎn)角度:','設(shè)置文字水印旋轉(zhuǎn)角度',
'編輯器加水?。?#39;,'開','關(guān)','編輯器里上傳的圖片是否添加水印',
),
紅色增加部分
 
2、后臺圖片剪裁水印配置文件 set_picture.dwt
<tr>
<td class="name">{:$lang['page']['watermark'][33]:}</td>
<td>
<input name="watermark[editor]" type="radio" value="1" {:if $mle['picture_config']['watermark']['editor'] == '1':}checked="checked"{:/if:} /> {:$lang['page']['watermark'][34]:} &nbsp;&nbsp;&nbsp;&nbsp;
<input name="watermark[editor]" type="radio" value="0" {:if $mle['picture_config']['watermark']['editor'] == '0':}checked="checked"{:/if:} /> {:$lang['page']['watermark'][35]:}
</td>
<td class="field">{:$lang['page']['watermark'][36]:}</td>
</tr>
約90行后增加
 
3、編輯器文件增加部分
\inc\tools\ckeditor\core\connector\php\php4\CommandHandler\FileUpload.php
\inc\tools\ckeditor\core\connector\php\php5\CommandHandler\FileUpload.php
 
//樂道修改 編輯器增加水印功能
$type = CKFinder_Connector_Utils_FileSystem::getExtension($sFileNameOrginal);
if($type =='jpg' || $type =='gif' || $type =='png' ){
global $picture_config;
defined('MLEROOT') or define('MLEROOT',str_replace('tools/ckeditor/core/connector/php/php5/CommandHan','',str_replace('\\','/',substr(dirname(__FILE__),0,-4))));
defined('MLEINC') or define('MLEINC',MLEROOT);
require_once(MLEROOT.'class/picture.class.php');
$pics = new picture();
$pics->watermark['file'] = $sFilePath;
$pics->watermark['pics'] = str_replace('../','../../../../../../',$pics->watermark['pics']); 
$pics->watermark['font_file'] = str_replace('../','../../../../../../',$pics->watermark['font_file']);
if($picture_config['watermark']['editor']){ 
$pics->watermark() === true or $pic_info = $pics->info;
}
}
//樂道修改 編輯器增加水印功能結(jié)束