[COMMENT] /* +-------------------------------------------------------------------------- | Invision Board v1.3 | ======================================== | > Mod_Installer | > Module written by Peter(Pit) | > Peter member at ibforen.de, Pit member at invisionize.com | > email: Peter@ibforen.de | | > Mod_Installer Version Number: 1.3.2 (2007-01-08) | > 2003 - 2007 by Peter | | > This is the CodeChange.php for Mod Create BBCodes in ACP by Peter +-------------------------------------------------------------------------- */ [COMMENT_END] [INTERFACE] 'title' => 'Create BBCodes in ACP', 'sub_title' => 'Create your own BBCode and the button in ACP stored in the database', 'category' => 'Major Mod', 'compatible' => 'Invision Power Board 1.3', 'version' => '2.2.11', 'author' => 'Peter', 'email' => 'Peter@ibforen.de', 'mod_token' => 'mod_bbcode', [INTERFACE_END] [HISTORY] [b]2.2.11[/b] [list][*]Feature 'Enables BBCodes in user profile and custom profile fields' moved to Mod Security&Updates Remove changes in sources/Admin/ad_settings.php, sources/mod_cp.php, sources/Usercp.php, sources/lib/usercp_functions.php [/list] [b]2.2.10[/b] [list][*]Compatible with Mod RTE Editor (Step 11 A,C) [*]Bugfix in ACP => BBCodes if mod_bbcode_tags_lang.php does not exist (replace mod_bbcode_ad_func.php) [*]Bugfix in ModeratorCP during profile editing (Step 12 new) (Bug if BBCodes were allowed in profile) [/list] [b]2.2.9[/b] [list][*]Bugfix for custom user profile fields (Step 6 B) [/list] [b]2.2.8[/b] [list][*]Compatible with Mod Admin Lang Tool [*]Enables BBCodes in user profile and custom profile fields Set option in ACP [arrow] System Settings [arrow] User Profiles [*]Bugfix for nofollow attribut (internal links instead of external links) New installation necessary [/list] [b]2.2.7[/b] [list][*]Nofollow attribut for BBCode URL (Activation in ACP) Changes in post_parser.php, last step, mod_bbcode_lang.php and mod_bbcode_ad_func.php Install mod with The ModInstaller [/list] [b]2.2.6/b] [list][*]BBCode List now uses marked text. No prompts for entries. Each linefeed results in an entry. Changes only in html/ibfcode.js Install with The ModInstaller [/list] [b]2.2.5[/b] [list][*]Bugfix for collapsable code boxes Changes only in mod_bbcode_func.php [/list] [b]2.2.4[/b] [list][*]BBCode URL now uses marked text for url description (no second prompt!) Changes only in html/ibfcode.js Install with The ModInstaller [/list] [b]2.2.3[/b] [list][*]Codeboxes can be displayed in collapsed mode Copy new file upload/html/mod_bbcode.js to html/mod_bbcode.js Exchange language files, mod_bbcode_func.php, mod_bbcode_ad_func.php and CodeChange.php Install the mod newly with The ModInstaller [/list] [b]2.2.2[/b] [list][*]Test of BBCode in edit or create mode fully implemented Echange mod_bbcode_func.php and mod_bbcode_ad_func.php. No other changes. [/list] [b]2.2.1[/b] [list][*]Compatible with Security-Project >2.1.1 (Renaming admin.php) [/list] [b]2.2[/b] [list][*]Improved functionality for BBCodes with use of functions See help text in ACP Update mod_bbcode_func.php and language files [/list] [b]2.1g[/b] [list][*]GeSHi compatible Changes in mod_bbcode_func.php and post_parser.php Step 4, Part G [/list] [b]2.1c[/b] [list][*]
problem in post_parser.php fixed [/list] [b]2.1[/b] [list][*]New BBCode type: Self closing BBCodes like [hr/] for
[*]Integrated assigning sets to groups [*]Import improved [*]Javscript improved [*]Updating of ibfcode.js in ACP [/list] Update: [list][*]New installation without previous deinstallation. Best with The ModInstaller. [/list] [HISTORY_END] [SQL] [QUERY] ALTER TABLE ibf_groups ADD mod_bbcodes_set int(3) default 0 [QUERY] UPDATE ibf_groups SET mod_bbcodes_set="1" WHERE mod_bbcodes_set="" [QUERY] CREATE TABLE IF NOT EXISTS ibf_bbcodes_sets ( name varchar(50) NOT NULL default "", bbcodes text, id bigint(20) unsigned NOT NULL auto_increment, PRIMARY KEY (id) ) TYPE=MyISAM [QUERY] CREATE TABLE IF NOT EXISTS ibf_bbcodes ( id bigint(20) unsigned NOT NULL auto_increment, name varchar(100) default "", btype int(1) NOT NULL, code text, html text, simple text, func text, tag varchar(10) default '', button int(1) default '0', accesskey varchar(1) default '', options text, help varchar(100) default "", image int(1) default 0, url varchar(100) default "", prompted int(1) default 0, info1 varchar(100) default "", info2 varchar(100) default "", info3 varchar(100) default "", info4 varchar(100) default "", preset1 varchar(100) default "", preset2 varchar(100) default "", preset3 varchar(100) default "", preset4 varchar(100) default "", error1 varchar(100) default "", error2 varchar(100) default "", error3 varchar(100) default "", error4 varchar(100) default "", PRIMARY KEY (id) ) TYPE=MyISAM [QUERY] ALTER TABLE ibf_bbcodes ADD func text AFTER html [QUERY] ALTER TABLE ibf_bbcodes ADD simple text AFTER html [QUERY] ALTER TABLE ibf_bbcodes ADD image int(1) default 0 AFTER help [QUERY] ALTER TABLE ibf_bbcodes ADD url varchar(100) default "" AFTER image [QUERY] ALTER TABLE ibf_bbcodes ADD info3 varchar(100) default "" AFTER info2 [QUERY] ALTER TABLE ibf_bbcodes ADD info4 varchar(100) default "" AFTER info3 [QUERY] ALTER TABLE ibf_bbcodes ADD preset3 varchar(100) default "" AFTER preset2 [QUERY] ALTER TABLE ibf_bbcodes ADD preset4 varchar(100) default "" AFTER preset3 [QUERY] ALTER TABLE ibf_bbcodes ADD error3 varchar(100) default "" AFTER error2 [QUERY] ALTER TABLE ibf_bbcodes ADD error4 varchar(100) default "" AFTER error3 [QUERY] ALTER TABLE ibf_bbcodes CHANGE code code text [QUERY] ALTER TABLE ibf_bbcodes CHANGE html html text [QUERY] ALTER TABLE ibf_bbcodes CHANGE simple simple text [QUERY] ALTER TABLE ibf_bbcodes CHANGE func func text [QUERY] ALTER TABLE ibf_bbcodes CHANGE tag tag varchar(10) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE button button int(1) default '0' [QUERY] ALTER TABLE ibf_bbcodes CHANGE accesskey accesskey varchar(1) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE options options text [QUERY] ALTER TABLE ibf_bbcodes CHANGE help help varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE image image int(1) default 0 [QUERY] ALTER TABLE ibf_bbcodes CHANGE url url varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE prompted prompted int(1) default 0 [QUERY] ALTER TABLE ibf_bbcodes CHANGE info1 info1 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE info2 info2 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE info3 info3 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE info4 info4 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE preset1 preset1 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE preset1 preset1 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE preset2 preset2 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE preset3 preset3 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE preset4 preset4 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE error1 error1 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE error2 error2 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE error3 error3 varchar(100) default "" [QUERY] ALTER TABLE ibf_bbcodes CHANGE error4 error4 varchar(100) default "" [SQL_END] [CODE] [MOD_TOKEN] mod_bbcode [FNAME] admin.php [STEP] [SEARCH] $IN['act'] = $IN['act'] == '' ? "idx" : $IN['act']; [INSERT] //-- 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'
Does it exist?"); } } //-- mod_bbcode end [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] index.php [STEP] [SEARCH] require ROOT_PATH."conf_global.php"; [INSERT] //-- 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'
Does it exist?"); } //-- mod_bbcode end [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Admin/ad_groups.php [STEP] [SEARCH] 'g_edit_topic' => $IN['g_edit_topic'], 'g_email_limit' => intval($IN['join_limit']).':'.intval($IN['join_flood']), [INSERT] //-- mod_bbcode begin 'mod_bbcodes_set'=> $IN['button_set'], //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] $SKIN->form_yes_no("g_hide_from_list", $group['g_hide_from_list'] ) ) ); [INSERT] //-- 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 [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/lib/post_parser.php [STEP] [SEARCH] $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt ); [INSERT] //-- mod_bbcode begin if (!$ibforums->vars['std_buttons_off']) //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt ); [INSERT] //-- 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'
Does it exist?"); } } $txt = $my_bbcode->convert($txt); //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] $txt = preg_replace( "/\n/", "
", $txt ); [INSERT] //-- mod_bbcode begin $txt = str_replace( "\n", "
", $txt ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] if ($code == 1) { [INSERT] //-- 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'
Does it exist?"); } } $txt = $my_bbcode->unconvert($txt); //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] $txt = preg_replace( "#(\[/QUOTE\])\s*?
\s*#si", "\\1\n", $txt ); [INSERT] //-- mod_bbcode begin $txt = preg_replace( "#(\[/QUOTE\])\s*?
\s*#si", "\\1\n", $txt ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] $txt = preg_replace( "#
#", "\n", $txt ); [INSERT] //-- mod_bbcode begin $txt = str_replace( "
", "\n", $txt ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] return array( 'START' => "
{$possible_use[$in[STYLE]][1]} {$in[EXTRA]}
", [INSERT] //-- 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' => "
{$possible_use[$in[STYLE]][1]} {$in[EXTRA]}

", 'END' => "
" ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] $html = preg_replace( "/^
/", "", $html ); [INSERT] //-- mod_bbcode begin $html = preg_replace( "`^
`", "", $html ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] $sql = preg_replace( "/^
/", "", $sql ); [INSERT] //-- mod_bbcode begin $sql = preg_replace( "`^
`", "", $sql ); //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] return $url['st'] . "".$show."" . $url['end']; [INSERT] //-- 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'] . "".$show."" . $url['end']; else //-- mod_bbcode end [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/lib/post_q_reply_post.php [STEP] [SEARCH] //------------------------------------------------- // Do we have any posting errors? [INSERT] //-- mod_bbcode begin if (isset($ibforums->input['quote'])) { $this->quoted_post['post'] = $std->txt_htmlspecialchars(utf8_decode($_GET['quote'])); } //-- mod_bbcode end [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/lib/usercp_functions.php [STEP] [SEARCH] [INSERT] [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Admin/ad_settings.php [STEP] [SEARCH] [INSERT] [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Admin/admin_pages.php [STEP] [SEARCH] ?> [INSERT] //-- mod_bbcode begin $PAGES[2][] = array( 'BBCodes', 'act=bbcode'); //-- mod_bbcode end [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] html/ibfcode.js [STEP] [SEARCH] var HTML_open = 0; [INSERT] //-- mod_bbcode begin //-- bbcode_open begin //-- bbcode_open end //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] var is_mac = (myAgent.indexOf("mac")!=-1); [INSERT] //-- 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 [MODE] insert_below [STEP] [SEARCH] eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '"); [INSERT] /*-- mod_bbcode exclude begin [MODE] insert_above_bol [STEP] [SEARCH] eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '"); [INSERT] -- 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 [MODE] insert_below [STEP] [SEARCH] eval("document.REPLIER." + thetag + ".value += '*'"); [INSERT] //-- mod_bbcode begin if (thetag == 'CODE') eval("document.REPLIER." + thetag + "_.value += '*'"); else //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] function tag_list() { [INSERT] //-- mod_bbcode begin var Text = get_SelectedText(); if (Text) { doInsert( "[LIST]\n[*]" + Text.replace(/\n/g, "\n[*]") + "[/LIST]\n", "", false); return; } //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] var enterTITLE = prompt(text_enter_url_name, "My Webpage"); [INSERT] //-- mod_bbcode begin var enterTITLE = get_SelectedText(); if (!enterTITLE) //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] function tag_image() [INSERT] //-- 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); } } } } //-- mod_bbcode end [MODE] insert_above [STEP] [SEARCH] if(isSingle) isClose = true; obj_ta.value += ibTag; [INSERT] //-- 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 [MODE] insert_above [STEP] [SEARCH] if(isSingle) isClose = true; obj_ta.value += ibTag; [INSERT] //-- mod_bbcode begin } //-- mod_bbcode end [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Post.php [STEP] [SEARCH] $form = $this->html->get_javascript(); [INSERT] //-- 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 [MODE] insert_above [STEP] [SEARCH] return $this->html->postbox_buttons($raw_post); [INSERT] //-- 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 [MODE] insert_above [STEP] [SEARCH] $row['post'] = str_replace( "
", "
", $row['post'] ); [INSERT] //-- 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 [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Messenger.php [STEP] [SEARCH] $this->output .= $this->post_html->pm_postbox_buttons($old_message); [INSERT] //-- 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 [MODE] insert_below [STEP] [SEARCH] $this->output .= $this->html->send_form_footer(); [INSERT] //-- mod_bbcode begin $this->output = $my_bbcode->clean_comments($this->output); //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] $this->output .= $this->post_html->postbox_buttons( str_replace( "
", "\n", $msg['message']) ); [INSERT] //-- 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 [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/mod_cp.php [STEP] [SEARCH] [INSERT] [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Topics.php [STEP] [SEARCH] //------------------------------------- // Print the footer [INSERT] //-- mod_bbcode begin $this->output = str_replace("><{P_QUOTE}>", " onclick=\"javascript:t=get_SelectedText(); if (t != '') {document.location.href=this.href + '"e=' + 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 [MODE] insert_above [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/calendar.php [STEP] [SEARCH] $this->output = str_replace( '' [INSERT] //-- 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 [MODE] insert_above [STEP] [SEARCH] $this->output = preg_replace( "/.+?/s", "", $this->output ); [INSERT] //-- mod_bbcode begin $this->output = $my_bbcode->clean_comments($this->output ); //-- mod_bbcode end [MODE] insert_below [FNAME_END] [MOD_TOKEN] mod_bbcode [FNAME] sources/Usercp.php [STEP] [SEARCH] $this->output .= $this->html->signature($this->member['signature'], $t_sig, $std->return_md5_check()); [INSERT] //-- mod_bbcode begin global $my_bbcode; $this->output = $my_bbcode->insert_codes($this->output); //-- mod_bbcode end [MODE] insert_below [STEP] [SEARCH] $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "".$ibforums->lang['t_title']."" ); } function do_signature() { [INSERT] //-- mod_bbcode begin $this->output = $my_bbcode->clean_comments($this->output); //-- mod_bbcode end [MODE] insert_above [FNAME_END] [CODE_END] [COPY] [b]Attention: Update 2.0 [arrow] 2.01[/b] Before a new installation of version 2.01 and [b]before uploading these files[/b] you must uninstall the previous 2.0 with the old CodeChange.php. [b]But do not remove then changes on the database. Otherwise you will loose your current bbcodes.[/b] This step is necessary because of the new mod structure. Changes in sources/lib/post_xxx_post.php are not longer needed, so we have to remove the changes. Then copy all files in folder upload of archive into the root dir of your board. Take care of the structure of this archive. [List] [*]upload/html/mod_bbcode.js [arrow] html/mod_bbcode.js [*]sources [arrow] sources [*]lang/en [arrow] lang/en [*]lang/de [arrow] lang/xx (xx = dir of your German lang files) [b][color=red]Attention: Do not overwrite existing mod_bbcode_tags_lang.php !![/color][/b] [/list] [COPY_END] [CUSTOMIZE] [CUSTOMIZE_END] [COMMENT_MOD] You will find some BBCodes as importable sql-archive in dir archive_in. There are two variants: [list][*][b]ibf_bbcodes-standard_incremental.sql[/b] Import this archive if there exists already BBCodes in table ibf_bbcodes [*][b]ibf_bbcodes-standard.sql[/b] Import this archive if no BBcodes in ibf_bbcodes exists that means if table ibf_bbcodes is empty. [/list] Similar meanings for the BBCodes sets ibf_bbcodes_sets-standard_incremental.sql and ibf_bbcodes_sets-standard.sql. Install these archives with the import functions in [b]ACP[/b] [arrow] [b]System Setting[/b] [arrow] [b]BBCodes[/b] If you want to use BBCodes based on Microsoft filters - only seen in Internet Explorer - be sure that you board wrapper looks like this: [quote] [size=3][color=blue]<?xml version="1.0" encoding="iso-8859-1"?>[/color][/size] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> [/quote] [b]Parameters[/b] Do not use more than 4 parameters. [b]Quote boxes et.al. and new css style[/b] In post_parser.php I have wrapped boxes for Quote, Code etc. with new div-styles in order to manage very long lines. In those cases browsers based on Gecko (Mozilla, Firefox) or Opera will now show scroll bars. They will not stretch the view any longer. But the Internet Explorer needs absolute values (in px) for width and height before showing scroll bars correctly. But absolute values are bad for Mozillas and Opera if the boxes are nested. By the way: They do it in the right way and once more IE is not reliable. So I suggest using relative values (in %). So we will have no improvement for IE but all advantages for the orther browsers. In order to teach Mozillas and Opera this new behavior we have to create one new css style. Using ACP insert: [code].codebox_title {width:100%;padding:1px;vertical-align:middle;text-align:left;overflow:hidden;} [/code] Don't hesitate to give me some feedback. [COMMENT_MOD_END] [HISTORY_OLD] [b]2.06[/b] [list][*]Parameter usable in arbitrary order [*]Bugfixes Update: [*]Exchange in sources/mods/bbcode [list][*]CodeChange.php [*]mod_bbcode_list[/list] [*]Install again with The ModInstaller or process Step 6, Part E manually [/list] [b]2.04[/b] [list][*]Minor bugfix for list bbcodes [*]Takes care for the new Opera 8.x version [*]Set the language for standard BBCode buttons [*]For standard BBCodes CODE, QUOTE, SQL and HTML set the language for titles in html output [/list] [b]2.0[/b] [list][*]BBCodes with own functions [*]Now up to 4 parameters [*]BBcodes in calendar [/list] [b]1.6[/b] [list][*]Run BBCode on marked text for Mozillas, too [*]Smaller bugfixes [/list] [b]1.5[/b] [list][*]Replace the entire ipb default button systems [*]Dialogues for user entries [*]List buttons [*]Using ipb-variables [/list] [b]1.3, 1.4[/b] Internal revisions [b]1.2[/b] [list][*]Buttonsets [*]Assign buttonsets to groups [*]Button title and help text dependent on the user's language [/list] [b]1.1[/b] [list][*]Improved Management [*]Now buttons for 2-value BBcodes with dropdown fields [*]Activation of BBCodes [*]Sorting of BBCodes [/list] [b]1.0[/b] [list][*]1- and 2-value BBcodes [*]Buttons for 1-value BBcodes [*]Test of BBCodes at edit time with preview [/list] [HISTORY_OLD_END]