列印

分組框標籤(FBOX)+按扭 For D6.1 By Kannol(靖颯)

分組框標籤(FBOX)+按扭 For D6.1 By Kannol(靖颯)

原帖:http://www.discuz.net/viewthread.php?tid=908658&extra=&highlight=%B7%D6%D7%E9%BF%F2%B1%EA%C7%A9&page=1

插件名稱分組框標籤(FBOX)+按扭
適用版本Discuz!6.1
語言編碼GBK
插件作者Kannol(靖颯)
版權所屬Kannol(靖颯)
支持網站http://bbs.bizhs.com
插件簡介為發貼子增加分組框的標籤和按扭功能
引用:
技   术   支   持    ....
作者的BLOG:   http://hi.baidu.com/kannol
BLOG里一定有值得你看的内容: )

-
作者的网站:   http://bbs.bizhs.com
引用:
期待我的下一個插件:  天氣預報(緩存版)
1. templates\default\templates.lang.php
查找:
複製內容到剪貼簿
代碼:
'post_discuzcode_input_hide' => '請輸入要插入的隱藏內容',
下面加
複製內容到剪貼簿
代碼:
        'post_discuzcode_fbox' => '插入FBOX標籤',
        'post_discuzcode_input_fbox' => '請輸入要插入的FBOX內容',
2. templates\default\post_editor.htm
查找:
複製內容到剪貼簿
代碼:
lang['post_discuzcode_hide'] = '{lang post_discuzcode_input_hide}';
下面加:
複製內容到剪貼簿
代碼:
        lang['post_discuzcode_fbox'] = '{lang post_discuzcode_input_fbox}';
查找:
複製內容到剪貼簿
代碼:
<!--{if $allowhidecode}--><a id="{$editorid}_cmd_hide" title="{lang post_discuzcode_hide}">Hide</a><!--{/if}-->
下面加:
複製內容到剪貼簿
代碼:
                                <em></em>
                                <a id="{$editorid}_cmd_fbox" title="{lang post_discuzcode_fbox}">Fbox</a>
3. templates\default\css_editor.htm
查找:
複製內容到剪貼簿
代碼:
#posteditor_popup_media { background-position: 0 -541px;}
下面加:
複製內容到剪貼簿
代碼:
                #posteditor_cmd_fbox { background-position: 0 -761px;}
4. include\javascript\editor.js
查找:
複製內容到剪貼簿
代碼:
insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide']) ? true : false);
替換為:
複製內容到剪貼簿
代碼:
insertText(text, strlen(opentag), strlen(closetag), in_array(tagname, ['code', 'quote', 'free', 'hide' ,'fbox']) ? true : false);
查找:
複製內容到剪貼簿
代碼:
if(in_array(cmd, ['quote', 'code', 'free', 'hide'])) {
替換為:
複製內容到剪貼簿
代碼:
if(in_array(cmd, ['quote', 'code', 'free', 'hide', 'fbox'])) {
查找:
複製內容到剪貼簿
代碼:
var opentag = '[' + cmd + ']';
替換為:
複製內容到剪貼簿
代碼:
var opentag = cmd == 'fbox' ? '[' + cmd + '=請在這裡輸入FBOX標題]' : '[' + cmd + ']';
查找
複製內容到剪貼簿
代碼:
if(cmd != 'hide' || !selection) {
上面加
複製內容到剪貼簿
代碼:
                if(cmd == 'fbox') {
                        str += 'Fbox 標題: <input type="text" size="30" name="fboxsubject" id="fboxsubject"><br>';
                }
查找
複製內容到剪貼簿
代碼:
var text = selection ? selection : $(ctrlid + '_param_1').value;
上面加
複製內容到剪貼簿
代碼:
                        if(cmd == 'fbox') {
                                var fboxsubject = $('fboxsubject').value;
                                opentag = '[fbox=' + fboxsubject + ']';
                        }
5.include\discuzcode.func.php
查找:
複製內容到剪貼簿
代碼:
'
', '
', '', ''
後面加:
複製內容到剪貼簿
代碼:
, '[/fbox]', '[/Fbox]', '[/FBOX]'
再查:
複製內容到剪貼簿
代碼:
'<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>'
後面加:
複製內容到剪貼簿
代碼:
, '</fieldset>', '</fieldset>', '</fieldset>'
查找
複製內容到剪貼簿
代碼:
"/\[font=([^\[\<]+?)\]/i",
下面加
複製內容到剪貼簿
代碼:
                        "/\[fbox=([^\[\<]+?)\]/i",
查找
複製內容到剪貼簿
代碼:
"<font face=\"\\1 \">",
下面加
複製內容到剪貼簿
代碼:
"<fieldset style=\"padding: 1.5em\"><legend>\\1</legend>",
引用:

最後一部,上傳附件中的圖片
images\common
下面覆蓋原有的
editor.gif文件
附件


演示圖1

演示圖2





Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

原帖:http://www.ejew.org/bbs/thread-54995-1-1.html

更簡單方法:用後台 Discuz! 代碼 來實現 fix by ejew

標籤: fbox
替換內容:
<fieldset style="padding: 1.5em"><legend>{1}</legend>{2}</fieldset>
例子:
複製內容到剪貼簿
代碼:
[fbox=標題]內容[/fbox]

解釋: fbox標籤
參數個數: 2
參數提示語:
請在這裡輸入FBOX標題
請在這裡輸入FBOX內容

嵌套次數:1










Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)