############################################################## ## MOD Title: MOD Format_style ## MOD Author: Merlin Sythove Dennis www.pimpmyforum.nl ## MOD Description: Allow styling text with headers and paragraph styles ## MOD Version: 0.9.0 ## ## Installation Level: Easy ## Installation Time: 15 Minutes ## Files To Edit: ## posting.php ## includes/bbcode_php ## language/lang_english/lang_main.php ## templates/subSilver/posting_body.tpl ## templates/subSilver/bbcode.tpl ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: ## ## Currently it has 2 header styles and 4 paragraph styles, one of which is the ## normal body style. ## Add styles as needed in all files where you find "add styles here". ## Adjust the style html code in bbcode.tpl for each theme that you have. ############################################################## ## MOD History: ## ## 2007-08-31 - Version 0.9.0 ## - first release ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # // // That's all, Folks! # #-----[ BEFORE, ADD ]------------------------------------------ # //MOD Format_style //Add styles as needed for your templates $lang['style_title'] = 'Style'; $lang['style_tip'] = 'Style: [h1]text[/h1]'; $lang['style_none'] = 'Default'; $lang['style_h1'] = 'Header'; $lang['style_h2'] = 'Subheader'; $lang['style_p1'] = 'Leader'; $lang['style_p2'] = 'Body'; $lang['style_p3'] = 'Information'; $lang['style_p4'] = 'Notes'; // add styles here # #-----[ OPEN ]------------------------------------------ # templates/subSilver/bbcode.tpl # #-----[ FIND ]------------------------------------------ # # #-----[ AFTER, ADD ]------------------------------------------ # # #-----[ OPEN ]------------------------------------------ # templates/subSilver/posting_body.tpl # #-----[ FIND ]------------------------------------------ # f_help = "{L_BBCODE_F_HELP}"; # #-----[ AFTER, ADD ]------------------------------------------ # style_help="{L_STYLE_TIP}"; # #-----[ FIND ]------------------------------------------ # {L_FONT_COLOR}: # #-----[ BEFORE, ADD ]------------------------------------------ # {L_STYLE_TITLE}:   # #-----[ OPEN ]------------------------------------------ # posting.php # #-----[ FIND ]------------------------------------------ # 'L_FONT_HUGE' => $lang['font_huge'], # #-----[ AFTER, ADD ]------------------------------------------ # //MOD Format_style 'L_STYLE_TITLE'=> $lang['style_title'], 'L_STYLE_TIP'=> $lang['style_tip'], 'L_STYLE_NONE' => $lang['style_none'], 'L_STYLE_H1'=> $lang['style_h1'], 'L_STYLE_H2'=> $lang['style_h2'], 'L_STYLE_P1'=> $lang['style_p1'], 'L_STYLE_P2'=> $lang['style_p2'], 'L_STYLE_P3'=> $lang['style_p3'], 'L_STYLE_P4'=> $lang['style_p4'], // add styles here # #-----[ OPEN ]------------------------------------------ # includes/bbcode_php # #-----[ FIND ]------------------------------------------ # (in bbencode_second_pass at end) $text = preg_replace($patterns, $replacements, $text); # #-----[ AFTER, ADD ]------------------------------------------ # // MOD Format_style $text = str_replace("[h1:$uid]", $bbcode_tpl['h1_open'], $text); $text = str_replace("[/h1:$uid]", $bbcode_tpl['h1_close'], $text); $text = str_replace("[h2:$uid]", $bbcode_tpl['h2_open'], $text); $text = str_replace("[/h2:$uid]", $bbcode_tpl['h2_close'], $text); $text = str_replace("[p1:$uid]", $bbcode_tpl['p1_open'], $text); $text = str_replace("[/p1:$uid]", $bbcode_tpl['p1_close'], $text); $text = str_replace("[p2:$uid]", $bbcode_tpl['p2_open'], $text); $text = str_replace("[/p2:$uid]", $bbcode_tpl['p2_close'], $text); $text = str_replace("[p3:$uid]", $bbcode_tpl['p3_open'], $text); $text = str_replace("[/p3:$uid]", $bbcode_tpl['p3_close'], $text); $text = str_replace("[p4:$uid]", $bbcode_tpl['p4_open'], $text); $text = str_replace("[/p4:$uid]", $bbcode_tpl['p4_close'], $text); // add styles here # #-----[ FIND PARTIAL ]------------------------------------------ # in bbencode_first_pass at end $text = preg_replace("#\[img\] # #-----[ AFTER, ADD ]------------------------------------------ # // MOD Format_style $text = preg_replace("#\[h1\](.*?)\[/h1\]#si", "[h1:$uid]\\1[/h1:$uid]", $text); $text = preg_replace("#\[h2\](.*?)\[/h2\]#si", "[h2:$uid]\\1[/h2:$uid]", $text); $text = preg_replace("#\[p1\](.*?)\[/p1\]#si", "[p1:$uid]\\1[/p1:$uid]", $text); $text = preg_replace("#\[p2\](.*?)\[/p2\]#si", "[p2:$uid]\\1[/p2:$uid]", $text); $text = preg_replace("#\[p3\](.*?)\[/p3\]#si", "[p3:$uid]\\1[/p3:$uid]", $text); $text = preg_replace("#\[p4\](.*?)\[/p4\]#si", "[p4:$uid]\\1[/p4:$uid]", $text); // add styles here # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM