修改教程
1、打開(kāi) \dede\swfupload.php 找到
echo "FILEID:".$_SESSION['fileid'];
在它的上面加入
$file_snames = explode('.', $Filename);
$file_filename = $file_snames[count($file_snames)-2];
$_SESSION['file_filename'][$_SESSION['fileid']] = $file_filename;
繼續(xù)找到
/************************
//刪除指定ID的圖片www.dedecms51.com
*************************/
在它的上面加入
/************************
//生成注釋
function GetThumbnail(){ }
*************************/
else if($dopost=='thumbalt')
{
if( empty($id) )
{
header('HTTP/1.1 500 Internal Server Error');
echo 'No ID';
exit(0);
}
if (!is_array($_SESSION['file_filename']) || !isset($_SESSION['file_filename'][$id]))
{
header('HTTP/1.1 404 Not found');
exit(0);
}
if($cfg_soft_lang=='utf-8') $file_filename = $_SESSION['file_filename'][$id];
else $file_filename = iconv( 'UTF-8', 'gb2312//IGNORE' , $_SESSION['file_filename'][$id]);
echo "注釋?zhuān)?lt;input type=\"text\" name=\"picinfo{$id}\" value=\"{$file_filename}\" style=\"width:190px;\" id=\"picinfo{$id}\" />";
exit(0);
}
2、打開(kāi) \dede\album_add.php 找到
$imginfo = !empty(${'picinfook'.$k}) ? ${'picinfook'.$k} : '';
改成:
$imginfo = !empty(${'picinfook'.$k}) ? ${'picinfook'.$k} : $_SESSION['file_filename'][$k];
3、打開(kāi) \dede\album_edit.php 找到
$imginfo = !empty(${'picinfook'.$k}) ? ${'picinfook'.$k} : '';
改成:
$imginfo = !empty(${'picinfook'.$k}) ? ${'picinfook'.$k} : $_SESSION['file_filename'][$k];
4、打開(kāi) \dede\js\handlers.js 找到
newImgDiv.innerHTML += '<div style="margin-top:10px">注釋?zhuān)?lt;input type="text" name="picinfo'+albImg+'" value="" style="width:'+iptwidth+'px;" /></div>';
改成:
newImgDiv.innerHTML += '<div style="margin-top:10px" id="picinfo'+albImg+'"></div>';
var picinfo = document.getElementById('picinfo'+albImg);
var myajax = new DedeAjax(picinfo,false,false,"","","");
myajax.SendGet2('swfupload.php?dopost=thumbalt&id='+pid);
DedeXHTTP = null;
完成。
圖集自動(dòng)注釋效果
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 織夢(mèng)圖集上傳圖片用圖片名自動(dòng)做注釋教程