發新話題

[分享] 幫XOOPS之輸入增加 flash codes

幫XOOPS之輸入增加 flash codes

█ 說明:
引文:
原XOOPS在新聞、論壇...等輸入上,並未設置flash codes,此法可以讓您的XOOPS增添flash的生動變化。


█ 使用方法
A.找到class/module.textsanitizer.php用文書處理器打開。
B.找到以下代碼

function &xoopsCodeDecode(&$text, $allowimage = 1) { $patterns = array();
$replacements = array();


C.在其下插入以下代碼

//hacked by bbchen
$patterns[] = \"/\([^\\"]*)\[\/swf\]/sU\";
$replacements[] = \"<objectclassid='clsid27CDB6E-AE6D-11cf-96B8-444553540000'codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'width='520' height='390'><param name=movievalue='\\1'><param name='QUALITY' value='high'><embedsrc='\\1' quality=highpluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'type='application/x-shockwave-flash' width='520'height='390'></embed></object>\";
//hacked by bbchen


D.尋找include/xoopscodes.php開啟
E.找出以下代碼

echo \"<a href='java script:xoopsCodeUrl(\\"$textarea_id\\");'><imgsrc='\".XOOPS_URL.\"/images/url.gif' alt='url'/></a> <ahref='java script:xoopsCodeEmail(\\"$textarea_id\\");'><imgsrc='\".XOOPS_URL.\"/images/email.gif' alt='email'/></a> <ahref='java script:xoopsCodeImg(\\"$textarea_id\\");'><imgsrc='\".XOOPS_URL.\"/images/imgsrc.gif' alt='imgsrc'/></a>


F.在該代碼後面加入以下代碼

<a href='java script:xoopsCodeFlash(\\"$textarea_id\\");'><imgsrc='\".XOOPS_URL.\"/images/swf.gif' alt='flash動畫' /></a>


G.尋找include/xoopsjs.php並開啟
H.直接找一個空位加入以下代碼

function xoopsCodeFlash(id){
var text = prompt(\"請填入swf的地址\", \"\");
var domobj = xoopsGetElementById(id);
if ( text != null && text != \"\" ) {
var result = \"[swf]\" + text + \"\";
xoopsInsertText(domobj, result);
}
domobj.focus();
}


I.最後上傳swf.gif圖示在images資料夾中即可。
█ 備註:

1.swf.gif圖形可以自己找,也可以到別的xoops論壇用右鍵下載。
2.這原是套用在xoops203版,改用在更高版本,需注意xoopscodes.php排列可能不太一樣,可以用部分關鍵字查詢,找到該位置,直接將代碼加在後面,xoops205測試成功。

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。