適用版本: Discuz! 2.0, 2.2F
作 者: alan888
修改文件: include/bbcode.js, include/discuzcode.php, templates.lang.php
修改模板: post_bbinsert.htm
最後發表日期: 2004.12.30
技術支持網站: http://www.alan888.com/Discuz/index.php
演示:
發光文字
1. 修改 include/discuzcode.php
找
更換為
"/\[align=([^\[]+?)\]/i",
"/(\[glow=)(\S+?)(\,)(.+?)(\,)(.+?)(\])(.+?)(\[\/glow\])/is"
再找
在下面加上
這是黑色字底的修改
黑色字底修改
"<span style='WIDTH:\\2;filter:glow(color=\\4, strength=\\6)'>\\8</span>",
這是白色字底的修改
白色字底修改
"<span style='WIDTH:\\2;filter:glow(color=\\4, strength=\\6)'> <font color=white>\\8</font></span>",
2. 修改 include/bbcode.js
找
在上面加上
function glow() {
if (helpmode) {
alert(glow_help);
} else if (advmode) {
AddTxt="[glow=255,red,2] [/glow]";
AddText(AddTxt);
} else {
txt2=prompt(glow_normal,"");
if (txt2!=null) {
txt=prompt(glow_normal_input,"255,red,2");
if (txt!=null) {
if (txt2=="") {
AddTxt="[glow=255,red,2]"+txt;
AddText(AddTxt);
AddText("[/glow]");
} else {
AddTxt="[glow="+txt+"]"+txt2;
AddText(AddTxt);
AddText("[/glow]");
}
}
}
}
}
3. 修改 templates/default/post_bbinsert.htm
找
var link_normal_input = "{lang post_discuzcode_hyperlink_normal_input}";
在下面加上
var glow_help = "{lang post_discuzcode_glow}\n\n{lang post_discuzcode_glow_comment}";
var glow_normal = "{lang post_discuzcode_glow_normal}";
var glow_normal_input = "{lang post_discuzcode_glow_normal_input}";
再找
<option value="LimeGreen" style="color:limegreen;">LimeGreen</option></select>
在下面加上
<a href="javascript:glow()"><img src="images/common/bb_glow.gif" border="0" width="23" height="22" align="absmiddle" alt="{lang post_discuzcode_glow}"></a>
4. 修改 templates/default/templates.lang.php
找
'post_discuzcode_color_normal' => '請輸入要設置成指定顏色的文字。',
在下面加上
'post_discuzcode_glow' => '發光顯示文字',
再找
'post_discuzcode_hyperlink_normal_input' => '請輸入 URL。',
在下面加上
'post_discuzcode_glow_comment' => '插入一個發光顯示的文字。\n例如:\n[glow=255,red,2]發光顯示的文字[/glow]',
'post_discuzcode_glow_normal' => '請輸入發光顯示的文字。',
'post_discuzcode_glow_normal_input' => '請修改顯示文字效果。\n[寬度,顏色,深度]',
'post_discuzcode_glow_input' => '請輸入 glow 語法。',
5. 下載圖標放入
images/common 目錄內
完成