Create BBCodes in ACP  2.2.11  Invision Power Board 1.3
Mod Beschreibung Erzeuge deine eigenen BBCodes und Buttons im ACP und speichere sie in der Datenbank
Mod Kompatibilität Invision Power Board 1.3
Mod Kategorie Major Mod
Mod Autor Peter
Mod Emailadresse des Autors Peter@ibforen.de
Dokumentationspfad sources/mods/bbcode/mod_bbcode_howto.htm
Mod Version 2.2.11
Hinweis Weitergabe ohne Zustimmung ist untersagt. Download von ibforen.de
Alle Änderungen sind am mod_token zu erkennen

Dieses html-howto wurde erstellt mit The ModInstaller 1.3.2 von
Peter@ibforen.de, released on 29th January, 2007
Erstellungsdatum: 2010-06-06

Es darf ohne ausdrückliche Genehmigung nicht weiterverwendet werden.

Hinweis
  • Dieser Mod ist keine Freeware.
  • Eine Weitergabe dieser Anleitung oder einer der Mod-Dateien ist untersagt. Die Distribution des Mods und seiner Dateien ist nur mit meiner ausdrücklichen Genehmigung gestattet.
  • Die Anpassung des Mods an die Skins des eigenen Boards ist ausdrücklich gewünscht. Dabei darf jedoch nicht mein Copyright verletzt werden und abgewandelte Codeteile weitervertrieben werden.
  • Eine Verletzung dieser Regelung führt letztendlich dazu, dass ich künftig keine frei verfügbaren Modifikationen mehr produziere. In diesem Sinne bitte ich darum, die schöpferische Leistung aller Programmierer zu respektieren und die Urheberschaften zu beachten.
Mod Token mod_bbcode

 Inhalt

1 History und Change Logs
2 Veränderungen
3 Kopieren
4 Kodieren
5 Anpassen
6 Kommentar
7 Ältere History und Change Logs

 1.  History und Change Logs

2.2.11


2.2.10


2.2.9


2.2.8


2.2.7


2.2.6/b]


[b]2.2.5



2.2.4


2.2.3


2.2.2


2.2.1


2.2


2.1g


2.1c


2.1

Update:


 2.  Veränderungen
Changed file Changed function
admin.php do_admin_stuff(..), do_admin_stuff(..)
html/ibfcode.js class properties or methods
html/ibfcode.js closeall(..), simpletag(..)
html/ibfcode.js doInsert(..)
html/ibfcode.js simpletag(..)
html/ibfcode.js tag_image(..)
html/ibfcode.js tag_list(..)
html/ibfcode.js tag_url(..)
index.php body
sources/Admin/admin_pages.php body
sources/Admin/ad_groups.php group_form(..)
sources/Admin/ad_groups.php save_group(..)
sources/calendar.php class properties or methods
sources/calendar.php class properties or methods(..), new_event(..), new_event(..)
sources/lib/post_parser.php convert(..)
sources/lib/post_parser.php convert(..), regex_parse_quotes(..)
sources/lib/post_parser.php regex_build_url(..)
sources/lib/post_parser.php regex_html_tag(..)
sources/lib/post_parser.php regex_sql_tag(..)
sources/lib/post_parser.php unconvert(..)
sources/lib/post_parser.php wrap_style(..)
sources/lib/post_q_reply_post.php show_form(..)
sources/Messenger.php class properties or methods
sources/Messenger.php edit_saved(..)
sources/Messenger.php send_form(..)
sources/Post.php html_post_body(..)
sources/Post.php html_start_form(..)
sources/Post.php html_topic_summary(..)
sources/Topics.php Topics(..)
sources/Usercp.php signature(..)

 3.  Kopieren

Achtung: Update 2.0 ⇒ 2.01

Vor der erneuten Installation mit dem ModInstaller und vor dem Hochladen dieser Dateien unbedingt die alte Version mit der alten CodeChange.php deinstallieren, dabei aber nicht die Änderungen an der Datenbank zurücknehmen

Das ist notwendig, damit die Änderungen an den post_xxx_post.php in sources/lib entfernt werden können. Sie sind in der neuen Version nicht mehr erforderlich.


Kopiere dann alle Dateien im Ordner upload des Archivs in das Root-Verzeichnis deines Boards und behalte dabei die Struktur bei.


 4.  Kodieren


Schritt  1:  Öffne admin.php

  Suche in function do_admin_stuff(..), do_admin_stuff(..)

    $IN['act'] = $IN['act'] == '' ? "idx" : $IN['act'];

     Füge darunter ein den blauen Code

    $IN['act'] = $IN['act'] == '' ? "idx" : $IN['act'];



//-- mod_bbcode begin
    if ($IN['act'] == "bbcode") {
        if (file_exists(ROOT_PATH."sources/mods/bbcode/mod_bbcode_ad_func.php")) {
            require ROOT_PATH."sources/mods/bbcode/mod_bbcode_ad_func.php";
            $idx=new bbcode;
        }
        else {
            die("Could not call required function from file 'sources/mods/bbcode/mod_bbcode_ad_func.php'<br>Does it exist?");
        }
    }
//-- mod_bbcode end



Schritt  2:  Öffne index.php

  Suche

require ROOT_PATH."conf_global.php";

     Füge darunter ein den blauen Code

require ROOT_PATH."conf_global.php";



//-- mod_bbcode begin
    if (file_exists(ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php")) {
        require ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php";
        $my_bbcode = new bbcode_user;
    }
    else {
        die("Could not call required function from file 'sources/mods/bbcode/mod_bbcode_func.php'<br>Does it exist?");
    }
//-- mod_bbcode end



Schritt  3:  Öffne sources/Admin/ad_groups.php

  A. Suche in function save_group(..)

                             'g_edit_topic'            => $IN['g_edit_topic'],
                             'g_email_limit'        => intval($IN['join_limit']).':'.intval($IN['join_flood']),

     Füge darunter ein den blauen Code

                             'g_edit_topic'            => $IN['g_edit_topic'],
                             'g_email_limit'        => intval($IN['join_limit']).':'.intval($IN['join_flood']),



//-- mod_bbcode begin
                             'mod_bbcodes_set'=> $IN['button_set'],
//-- mod_bbcode end


  B. Suche in function group_form(..)

                                                  $SKIN->form_yes_no("g_hide_from_list", $group['g_hide_from_list'] )
                                         )      );

     Füge darunter ein den blauen Code

                                                  $SKIN->form_yes_no("g_hide_from_list", $group['g_hide_from_list'] )
                                         )      );



//-- mod_bbcode begin
        $lang = $std->load_words($this->lang, 'mod_bbcode_ad_lang', $ADMIN->lang_id);

        $DB->query("SELECT * FROM ibf_bbcodes_sets");

        while ($s = $DB->fetch_row())
            $sets[] = array('0' => $s['id'], '1' => $s['name'] );
        $ADMIN->html .= $SKIN->add_td_row( array($lang['ad_bbcodeset'],
                                                 $SKIN->form_dropdown("button_set", $sets, $group['mod_bbcodes_set']),
                                          )      );
//-- mod_bbcode end



Schritt  4:  Öffne sources/lib/post_parser.php

  A. Suche in function convert(..)

            $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
            if (!$ibforums->vars['std_buttons_off'])
//-- mod_bbcode end


            $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );

  B. Suche in function convert(..)

            $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );

     Füge darunter ein den blauen Code

            $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );



//-- mod_bbcode begin
            global $my_bbcode;
            if (!class_exists("bbcode_user") ) {
                if (file_exists(ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php")) {
                    require ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php";
                    $my_bbcode = new bbcode_user;
                }
                else {
                    die("Could not call required function from file 'sources/mods/bbcode/mod_bbcode_func.php'<br>Does it exist?");
                }
            }
            $txt = $my_bbcode->convert($txt);
//-- mod_bbcode end


  C. Suche in function convert(..), regex_parse_quotes(..)

        $txt = preg_replace( "/\n/", "<br>", $txt );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $txt = str_replace( "\n", "<br />", $txt );
//-- mod_bbcode end


        $txt = preg_replace( "/\n/", "<br>", $txt );

  D. Suche in function unconvert(..)

        if ($code == 1)
        {

     Füge darunter ein den blauen Code

        if ($code == 1)
        {



//-- mod_bbcode begin
            global $my_bbcode;
            if (!class_exists("bbcode_user") ) {
                if (file_exists(ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php")) {
                    require ROOT_PATH."sources/mods/bbcode/mod_bbcode_func.php";
                    $my_bbcode = new bbcode_user;
                }
                else {
                    die("Could not call required function from file 'sources/mods/bbcode/mod_bbcode_func.php'<br>Does it exist?");
                }
            }
            $txt = $my_bbcode->unconvert($txt);
//-- mod_bbcode end


  E. Suche in function unconvert(..)

            $txt = preg_replace( "#(\[/QUOTE\])\s*?<br>\s*#si", "\\1\n", $txt );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
            $txt = preg_replace( "#(\[/QUOTE\])\s*?<br \/>\s*#si", "\\1\n", $txt );
//-- mod_bbcode end


            $txt = preg_replace( "#(\[/QUOTE\])\s*?<br>\s*#si", "\\1\n", $txt );

  F. Suche in function unconvert(..)

        $txt = preg_replace( "#<br>#", "\n", $txt );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $txt = str_replace( "<br />", "\n", $txt );
//-- mod_bbcode end


        $txt = preg_replace( "#<br>#", "\n", $txt );

  G. Suche in function wrap_style(..)

        return array( 'START' => "</div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>{$possible_use[$in[STYLE]][1]}</b> {$in[EXTRA]}</td></tr><tr><td id='{$possible_use[ $in[STYLE] ][0]}'>",

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        global $std;
        
        if (!isset($ibforums->lang_id)) {
            if ( defined( 'IN_ACP' ) ) {
                global $ADMIN;
                $ibforums->lang_id = $ADMIN->lang_id;
            }
            else {
                $ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : $ibforums->vars['default_language'];
            }
            $ibforums->lang = $std->load_words($ibforums->lang, 'mod_bbcode_lang', $ibforums->lang_id);
        }
        
        if (!isset($ibforums->lang['bb_code_title'])) {
            $ibforums->lang = $std->load_words($ibforums->lang, 'mod_bbcode_lang', $ibforums->lang_id);
        }
        
        $possible_use['CODE'] = array( 'CODE',  $ibforums->lang['bb_code_title'] );
        $possible_use['QUOTE'] = array( 'QUOTE',  $ibforums->lang['bb_quote_title'] );
        $possible_use['SQL'] = array( 'CODE',  $ibforums->lang['bb_sql_title'] );
        $possible_use['PHP'] = array( 'CODE',  $ibforums->lang['bb_php_title'] );
        return array( 'START' => "<div style='width:___BOXWIDTH___px;'><div class='codebox_title' style='width:70%;float:left;'><b>{$possible_use[$in[STYLE]][1]}</b> {$in[EXTRA]}</div><!--CODEBOX_DIV_BEGIN<div class='codebox_title' style='width:28%;float:left;font-size:9px;text-align:right;'><a href='#' onclick='return SelectAllInBox(this,___JSQUOTE___{$possible_use[ $in[STYLE] ][0]}___JSQUOTE___)'>BOX_SELECT</a>&nbsp;&nbsp;&nbsp;<a href='#' onclick='return ToggleBox(this,___JSQUOTE___{$possible_use[ $in[STYLE] ][0]}___JSQUOTE___)'>BOX_EXPAND</a></div>CODEBOX_DIV_END--><br clear='all' /><div id='{$possible_use[ $in[STYLE] ][0]}' CODEBOX_STYLE>",
                      'END'   => "</div></div>"
                    );
//-- mod_bbcode end


        return array( 'START' => "</div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>{$possible_use[$in[STYLE]][1]}</b> {$in[EXTRA]}</td></tr><tr><td id='{$possible_use[ $in[STYLE] ][0]}'>",

  H. Suche in function regex_html_tag(..)

        $html = preg_replace( "/^<br>/", "", $html );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $html = preg_replace( "`^<br />`", "", $html );
//-- mod_bbcode end


        $html = preg_replace( "/^<br>/", "", $html );

  I. Suche in function regex_sql_tag(..)

        $sql = preg_replace( "/^<br>/", "", $sql );

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $sql = preg_replace( "`^<br />`", "", $sql );
//-- mod_bbcode end


        $sql = preg_replace( "/^<br>/", "", $sql );

  J. Suche in function regex_build_url(..)

        return $url['st'] . "<a href='".$url['html']."' target='_blank'>".$show."</a>" . $url['end'];

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        global $ibforums;
        $domain = parse_url($ibforums->vars['board_url']);
        $domain = $domain['scheme']."://".$domain['host'];
        if ($ibforums->vars['url_nofollow'] && strpos($url['html'], $domain) === FALSE )
            return $url['st'] . "<a href='".$url['html']."' target='_blank' rel='nofollow'>".$show."</a>" . $url['end'];
        else
//-- mod_bbcode end


        return $url['st'] . "<a href='".$url['html']."' target='_blank'>".$show."</a>" . $url['end'];


Schritt  5:  Öffne sources/lib/post_q_reply_post.php

  Suche in function show_form(..)

        //-------------------------------------------------
        // Do we have any posting errors?

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        if (isset($ibforums->input['quote'])) {
            $this->quoted_post['post'] = $std->txt_htmlspecialchars(utf8_decode($_GET['quote']));
        }
//-- mod_bbcode end


        //-------------------------------------------------
        // Do we have any posting errors?


Schritt  6:  Öffne sources/lib/usercp_functions.php


Schritt  7:  Öffne sources/Admin/ad_settings.php


Schritt  8:  Öffne sources/Admin/admin_pages.php

  Suche

?>

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
$PAGES[2][] = array( 'BBCodes', 'act=bbcode');
//-- mod_bbcode end


?>


Schritt  9:  Öffne html/ibfcode.js

  A. Suche

var HTML_open = 0;

     Füge darunter ein den blauen Code

var HTML_open = 0;



//-- mod_bbcode begin
//-- bbcode_open begin
//-- bbcode_open end
//-- mod_bbcode end


  B. Suche

var is_mac    = (myAgent.indexOf("mac")!=-1);

     Füge darunter ein den blauen Code

var is_mac    = (myAgent.indexOf("mac")!=-1);



//-- mod_bbcode begin
var is_opera = (myAgent.indexOf("opera") != -1);
if (is_opera) {
    var myVersion = parseFloat(myAgent.substr(myAgent.indexOf('opera') + 6, 4) );
}
//-- mod_bbcode end


  C. Suche in function closeall(..), simpletag(..)

                eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '");

     Füge darüber ein den blauen Code



/*-- mod_bbcode exclude begin


                eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '");

  D. Suche in function closeall(..), simpletag(..)

eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '");

     Füge darunter ein den blauen Code

eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '");



-- mod_bbcode exclude end */

//-- mod_bbcode begin
                if (tagRemove == 'CODE')
                    eval("document.REPLIER." + tagRemove + "_.value = document.REPLIER." + tagRemove + "_.value.replace(/\\*$/,'');");
                else {
                    if (document.getElementsByName(tagRemove)[0])
                        eval("document.REPLIER." + tagRemove + ".value = document.REPLIER." + tagRemove + ".value.replace(/\\*$/,'');");
                    else if (document.getElementsByName("sel" + tagRemove)[0])
                        eval("document.REPLIER.sel" + tagRemove + ".value = document.REPLIER.sel" + tagRemove + ".value.replace(/\\*$/,'');");
                }
//-- mod_bbcode end


  E. Suche in function simpletag(..)

                eval("document.REPLIER." + thetag + ".value += '*'");

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
                if (thetag == 'CODE')
                    eval("document.REPLIER." + thetag + "_.value += '*'");
                else
//-- mod_bbcode end


                eval("document.REPLIER." + thetag + ".value += '*'");

  F. Suche in function tag_list(..)

function tag_list()
{

     Füge darunter ein den blauen Code

function tag_list()
{



//-- mod_bbcode begin
    var Text = get_SelectedText();
    if (Text) {
        doInsert( "[LIST]\n[*]" + Text.replace(/\n/g, "\n[*]") + "[/LIST]\n", "", false);
        return;
    }
//-- mod_bbcode end


  G. Suche in function tag_url(..)

    var enterTITLE = prompt(text_enter_url_name, "My Webpage");

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
    var enterTITLE = get_SelectedText();
    if (!enterTITLE)
//-- mod_bbcode end


    var enterTITLE = prompt(text_enter_url_name, "My Webpage");

  H. Suche in function tag_image(..)

function tag_image()

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
function tag_self(tag) {
    doInsert("[" + tag + "/]", "", false);
}

function tag_one(tag) {
    eval("info = " + tag + "_info;");
    eval("preset = " + tag + "_preset;");
    eval("error = " + tag + "_error;");

    var param   = prompt(info, preset);

    if (!param) {
        alert(error);
        return;
    }

    doInsert("[" + tag + "]" + param + "[/" + tag + "]", "", false);
}


function tag_multiple(tag, params)
{

    var parameters = "";
    var params_array = new Array(params.length);
    for (i = 1; i <= params.length; i++) {
        eval("info = " + tag + "_info" + i + ";");
        eval("preset = " + tag + "_preset" + i + ";");
        eval("error = " + tag + "_error" + i + ";");
        param = prompt(info, preset);
        if (!param) {
            alert(error);
            return;
        }
         params_array[params[i-1] - 1] = param;
    }
    parameters = params_array.slice(0,params_array.length-1).join(",");
    doInsert("[" + tag + "=" + parameters + "]" + params_array[params_array.length-1] + "[/" + tag + "]", "", false);

}


function tag_select(theval, thetag) {
    if (theval == 0)
        return;
    if(doInsert("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true))
        pushstack(bbtags, thetag);
    eval("document.REPLIER.sel" + thetag + ".selectedIndex  = 0;");
    cstat();
}

function tag_newlist(tag, params)
{

    if (params == "2") {
        eval("info1 = " + tag + "_info1;");
        eval("preset1 = " + tag + "_preset1;");
        eval("info2 = " + tag + "_info2;");
        eval("preset2 = " + tag + "_preset2;");
    }
    else {
        eval("info2 = " + tag + "_info1;");
        eval("preset2 = " + tag + "_preset1;");
    }
    var option = "start";
    var option_list = "";
    
    if (params == "2") {
        param = prompt(info1, preset1);
    }

    while ( (option != "") && (option != null) )
    {
        option = prompt(info2, preset2);
        if ( (option != "") && (option != null) )
        {
            option_list = option_list + "[*]" + option + "\n";
        }
    }
    
    if ( option_list != "" ) {
        if (params == "2") 
            doInsert( "[" + tag + "=" + param + "]\n" + option_list + "[/" + tag + "]\n", "", false);
        else
            doInsert( "[" + tag + "]\n" + option_list + "[/" + tag + "]\n", "", false);
    }
}

function simple_BBCode(text) {
    if (text == "") return;

    var obj_ta = document.REPLIER.Post;

    text = text.replace(/\{cr\}/g,"\n");

    if ( (myVersion >= 4) && is_ie && is_win) {
        if(obj_ta.isTextEdit) {
            obj_ta.focus();
            var sel = document.selection;
            var rng = sel.createRange();
            rng.colapse;
            if((sel.type == "Text" || sel.type == "None") && rng != null){
                rng.text = text;
            }
        }
        else{
            obj_ta.value += text;
        }
    }
    else {
        if ( (myVersion >= 4) && is_win && (!is_opera || (is_opera && myVersion >= 8))) {
            var length = obj_ta.textLength;
            var start = obj_ta.selectionStart;
            var end = obj_ta.selectionEnd;
            var head = obj_ta.value.substring(0,start);
            var rng = obj_ta.value.substring(start, end);
            var tail = obj_ta.value.substring(end, length);
            if( start != end ){
                rng = text;
                obj_ta.value = head + rng + tail;
                start = start + rng.length;
            }
            else{
                obj_ta.value = head + text + tail;
                start = start + text.length;
            }
            obj_ta.selectionStart = start;
            obj_ta.selectionEnd = start;
        }
        else {
            obj_ta.value += text;
        }
    }

    obj_ta.focus();
    return;
}

function get_SelectedText() {
    var obj_ta = document.REPLIER.Post;

    if ( (myVersion >= 4) && is_ie && is_win) {
        if(obj_ta.isTextEdit) {
            var sel = document.selection;
            var rng = sel.createRange();
            rng.colapse;
            return rng.text;
        }
    }
    else {
        if ( (myVersion >= 4) && is_win && (!is_opera || (is_opera && myVersion >= 8))) {
            var length = obj_ta.textLength;
            var start = obj_ta.selectionStart;
            var end = obj_ta.selectionEnd;
            if( start != end ){
                return obj_ta.value.substring(start, end);
            }
        }
    }
}

<!-- bbcode_function -->
//-- mod_bbcode end


function tag_image()

  I. Suche in function doInsert(..)

        if(isSingle)
            isClose = true;

        obj_ta.value += ibTag;

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        // this should work with Mozillas
        if ( (myVersion >= 4) && is_win && (!is_opera || (is_opera && myVersion >= 8))) {
            var length = obj_ta.textLength;
            var start = obj_ta.selectionStart;
            var end = obj_ta.selectionEnd;
            var head = obj_ta.value.substring(0,start);
            var rng = obj_ta.value.substring(start, end);
            var tail = obj_ta.value.substring(end, length);
            if( start != end ){
                if (ibClsTag != "" && length > 0)
                    ibTag += rng + ibClsTag;
                else if (isSingle)
                    isClose = true;
                rng = ibTag;
                obj_ta.value = head + rng + tail;
                obj_ta.selectionStart = start;
                obj_ta.selectionEnd = start + rng.length;
            }
            else{
                if(isSingle)
                    isClose = true;
                obj_ta.value = head + ibTag + tail;
                start = start + ibTag.length;
                obj_ta.selectionStart = start;
                obj_ta.selectionEnd = start;
            }
        }
        else {
//-- mod_bbcode end


        if(isSingle)
            isClose = true;

        obj_ta.value += ibTag;

  J. Suche in function doInsert(..)

        if(isSingle)
            isClose = true;

        obj_ta.value += ibTag;

     Füge darunter ein den blauen Code

        if(isSingle)
            isClose = true;

        obj_ta.value += ibTag;



//-- mod_bbcode begin
        }
//-- mod_bbcode end



Schritt 10:  Öffne sources/Post.php

  A. Suche in function html_start_form(..)

        $form = $this->html->get_javascript();

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        global $my_bbcode;
        if (isset($my_bbcode) && $ibforums->vars['codebox_collapsed']) {
            $this->output = $my_bbcode->change_codebox_style($this->output);
        }
        else {
            $this->output = str_replace("___JSQUOTE___", "\"", $this->output);
            $this->output = str_replace("CODEBOX_STYLE", "", $this->output);
            $this->output = str_replace("___BOXWIDTH___", $ibforums->vars['codebox_width'], $this->output);
            $this->output = str_replace("___BOXHEIGHT___", $ibforums->vars['codebox_height'], $this->output);
            $this->output = str_replace("___HEIGHT___", "height:{$ibforums->vars['codebox_height']}px;", $this->output);
        }
//-- mod_bbcode end


        $form = $this->html->get_javascript();

  B. Suche in function html_post_body(..)

        return $this->html->postbox_buttons($raw_post);

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        global $my_bbcode;
        $raw_post = $my_bbcode->update_postbox($this->html->postbox_buttons($raw_post));
        $raw_post = $my_bbcode->insert_codes($raw_post);
        $raw_post = $my_bbcode->clean_comments($raw_post);
        return $raw_post;
//-- mod_bbcode end


        return $this->html->postbox_buttons($raw_post);

  C. Suche in function html_topic_summary(..)

            $row['post']   = str_replace( "<br>", "<br />", $row['post'] );

     Füge darunter ein den blauen Code

            $row['post']   = str_replace( "<br>", "<br />", $row['post'] );



//-- mod_bbcode begin
            global $my_bbcode;
            if (isset($my_bbcode) && $ibforums->vars['codebox_collapsed']) {
                $row['post'] = $my_bbcode->change_codebox_style($row['post']);
            }
            else {
                $row['post'] = str_replace("___JSQUOTE___", "\"", $row['post']);
                $row['post'] = str_replace("CODEBOX_STYLE", "", $row['post']);
                $row['post'] = str_replace("___BOXHEIGHT___", $ibforums->vars['codebox_height'], $row['post']);
                $row['post'] = str_replace("___BOXWIDTH___", $ibforums->vars['codebox_width'], $row['post']);
                $row['post'] = str_replace("___HEIGHT___", "height:{$ibforums->vars['codebox_height']}px;", $row['post']);
            }
//-- mod_bbcode end



Schritt 11:  Öffne sources/Messenger.php

  A. Suche in function send_form(..)

         $this->output .= $this->post_html->pm_postbox_buttons($old_message);

     Füge darunter ein den blauen Code

         $this->output .= $this->post_html->pm_postbox_buttons($old_message);



//-- mod_bbcode begin
        global $my_bbcode;
        $this->output =  $my_bbcode->update_postbox($this->output );
        if (!$ibforums->skin['use_rte_bbcode_compat'])
            $this->output = $my_bbcode->insert_codes($this->output);
//-- mod_bbcode end


  B. Suche

         $this->output .= $this->html->send_form_footer();

     Füge darunter ein den blauen Code

         $this->output .= $this->html->send_form_footer();



//-- mod_bbcode begin
        $this->output = $my_bbcode->clean_comments($this->output);
//-- mod_bbcode end


  C. Suche in function edit_saved(..)

         $this->output .= $this->post_html->postbox_buttons( str_replace( "<br>", "\n", $msg['message']) );

     Füge darunter ein den blauen Code

         $this->output .= $this->post_html->postbox_buttons( str_replace( "<br>", "\n", $msg['message']) );



//-- mod_bbcode begin
        global $my_bbcode;
        $this->output =  $my_bbcode->update_postbox($this->output );
        if (!$ibforums->skin['use_rte_bbcode_compat'])
            $this->output = $my_bbcode->insert_codes($this->output);
//-- mod_bbcode end



Schritt 12:  Öffne sources/mod_cp.php


Schritt 13:  Öffne sources/Topics.php

  Suche in function Topics(..)

        //-------------------------------------
        // Print the footer

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $this->output = str_replace("><{P_QUOTE}>", " onclick=\"javascript:t=get_SelectedText(); if (t != '') {document.location.href=this.href + '&quote=' + encodeURIComponent(t);return false;}\"><{P_QUOTE}>", $this->output);
        global $my_bbcode;
        if (isset($my_bbcode) && $ibforums->vars['codebox_collapsed']) {
            $this->output = $my_bbcode->change_codebox_style_topics($this->output);
        }
        else {
            $this->output = str_replace("___JSQUOTE___", "\"", $this->output);
            $this->output = str_replace("CODEBOX_STYLE", "", $this->output);
            $this->output = str_replace("___BOXHEIGHT___", $ibforums->vars['codebox_height'], $this->output);
            $this->output = str_replace("___BOXWIDTH___", $ibforums->vars['codebox_width'], $this->output);
            $this->output = str_replace("___HEIGHT___", "height:{$ibforums->vars['codebox_height']}px;", $this->output);
        }
//-- mod_bbcode end


        //-------------------------------------
        // Print the footer


Schritt 14:  Öffne sources/calendar.php

  A. Suche in function class properties or methods(..), new_event(..), new_event(..)

        $this->output  = str_replace( '<!--IBF.EMO-->'

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        global $my_bbcode;
        $this->output =  $my_bbcode->update_postbox($this->output );
        $this->output = $my_bbcode->insert_codes($this->output);
//-- mod_bbcode end


        $this->output  = str_replace( '<!--IBF.EMO-->'

  B. Suche

        $this->output = preg_replace( "/<!--SIG-->.+?<!--ESIG-->/s", "", $this->output );

     Füge darunter ein den blauen Code

        $this->output = preg_replace( "/<!--SIG-->.+?<!--ESIG-->/s", "", $this->output );



//-- mod_bbcode begin
        $this->output  = $my_bbcode->clean_comments($this->output );
//-- mod_bbcode end



Schritt 15:  Öffne sources/Usercp.php

  A. Suche in function signature(..)

         $this->output .= $this->html->signature($this->member['signature'], $t_sig, $std->return_md5_check());

     Füge darunter ein den blauen Code

         $this->output .= $this->html->signature($this->member['signature'], $t_sig, $std->return_md5_check());



//-- mod_bbcode begin
        global $my_bbcode;
        $this->output = $my_bbcode->insert_codes($this->output);
//-- mod_bbcode end


  B. Suche in function signature(..)

         $this->page_title = $ibforums->lang['t_welcome'];
         $this->nav        = array( "<a href='".$this->base_url."act=UserCP&amp;CODE=00'>".$ibforums->lang['t_title']."</a>" );

     }

     function do_signature() {

     Füge darüber ein den blauen Code



//-- mod_bbcode begin
        $this->output = $my_bbcode->clean_comments($this->output);
//-- mod_bbcode end


         $this->page_title = $ibforums->lang['t_welcome'];
         $this->nav        = array( "<a href='".$this->base_url."act=UserCP&amp;CODE=00'>".$ibforums->lang['t_title']."</a>" );

     }

     function do_signature() {

 5.  Anpassen

Manuelle Installation


Installiere diesen Mod nicht manuell, verwende den ModInstaller. Es ist so leicht.

Wie bitte ? Du willst doch manuell installieren? Gegen meine ausdrückliche Empfehlung ?

Na gut. Kopiere ./sources/mods/bbcode/mod_bbcode_install.php in das Wurzelverzeichnis deines ipb. Das ist jenes Verzeichnis, wo index.php und admin.php liegen.

Starte dann das Installationsscript über deinen Browser. Es wird die fehlenden Tabellen und Felder in die Datenbank einfügen.

Ändere nun alle Dateien so, wie es in dieser Dokumentation beschrieben ist. Gehe sorgfältig vor, um die richtigen Codeteile zu ändern. Achte auf die betroffenen Funktionen. Manchmal treten die Suchstellen mehrmals im Code auf. Ändere jede Stelle.





 6.  Kommentar

Du findest einige BBCodes als importierbares Archiv im Ordner archive_in. Sie sind in zwei Versionen vorhanden:


Ebenso sind zwei Archive für die BBCodes Sets vorhanden.

Installiere sie über die Importfunktionen unter ACPSystem SettingBBCodes

Bei der Verwendung der Microsoft-Filter, die auch nur mit dem Internet Explorer darstellbar sind, muss der Boardwrapper so aussehen:
Zitat


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Parameter
Es sind nicht mehr als 4 Parameter möglich.

Quote-Boxen etc. und neuer css-Style
In post_parser.php werden die Boxen für Quote, Code etc. mit einem neuen Wrapper versehen, um überlange Zeilen zu verwalten. Browser auf Mozilla- oder Opera-Basis zeigen nun zuverlässig Scrollleisten an.
Für den Internet-Explorer müssen jedoch Breite und Höhe solcher Bereiche angegeben werden, bevor er die Scrolleisten korrekt zeigt. Solche konstanten Werte führen jedoch in Mozillas und Opera zu Darstellungsfehlern bei geschachtelten Boxen.

Hier sollte man lieber zu Prozentangaben greifen und in Kauf nehmen, dass für den Internet-Explorer keine Verbesserung möglich ist.

Damit Mozillas und Opera aber das neue Verhalten lernen, muss ein neuer css-Style im ACP eingebaut werden:

Code

.codebox_title {width:100%;padding:1px;vertical-align:middle;text-align:left;overflow:hidden;}


Du kannst auch mal ruhig etwas Feedback bringen. Würde mich freuen.

 7.  Ältere History und Change Logs

2.06



2.04



2.0


1.6


1.5


1.3, 1.4
Intern

1.2


1.1


1.0