# #-----[ OPEN ]--------------------------------------------- # includes/bbcode.php # #-----[ FIND ]--------------------------------------------- # // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. $text = bbencode_second_pass_code($text, $uid, $bbcode_tpl); # #-----[ AFTER, ADD ]-------------------------------------- # // [NFO] and [/NFO] $text = bbencode_second_pass_nfo($text, $uid, $bbcode_tpl); # #-----[ FIND ]--------------------------------------------- # // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. $text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, ''); # #-----[ AFTER, ADD ]-------------------------------------- # // [NFO] and [/NFO] $text = bbencode_first_pass_pda($text, $uid, '[nfo]', '[/nfo]', '', true, ''); # #-----[ FIND ]--------------------------------------------- # // Now, do all the non-first-level matches. These are simple. $text = str_replace("[code:$uid]", $code_start_html, $text); $text = str_replace("[/code:$uid]", $code_end_html, $text); return $text; } // bbencode_second_pass_code() # #-----[ AFTER, ADD ]-------------------------------------- # function bbencode_second_pass_nfo($text, $uid, $bbcode_tpl) { global $lang; $code_start_html = $bbcode_tpl['nfo_open']; $code_end_html = $bbcode_tpl['nfo_close']; $match_count = preg_match_all("#\[nfo:1:$uid\](.*?)\[/nfo:1:$uid\]#si", $text, $matches); for ($i = 0; $i < $match_count; $i++) { $before_replace = $matches[1][$i]; $after_replace = $matches[1][$i]; $after_replace = str_replace(" ", " ", $after_replace); $after_replace = str_replace(" ", " ", $after_replace); $after_replace = str_replace("\t", " ", $after_replace); $str_to_match = "[nfo:1:$uid]" . $before_replace . "[/nfo:1:$uid]"; $replacement = $code_start_html; $replacement .= $after_replace; $replacement .= $code_end_html; $text = str_replace($str_to_match, $replacement, $text); } $text = str_replace("[nfo:$uid]", $code_start_html, $text); $text = str_replace("[/nfo:$uid]", $code_end_html, $text); return $text; } # #-----[ OPEN ]--------------------------------------------- # {in your template directory}/bbcode.tpl # #-----[ FIND ]--------------------------------------------- # <!-- BEGIN code_open --></span> <table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> <td><span class="genmed"><b>{L_CODE}:</b></span></td> </tr> <tr> <td class="code"><!-- END code_open --> <!-- BEGIN code_close --></td> </tr> </table> <span class="postbody"><!-- END code_close --> # #-----[ AFTER, ADD ]-------------------------------------- # <!-- BEGIN nfo_open --></span> <table width="500" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> <td><span class="genmed"><b>NFO:</b></span></td> </tr> <tr> <td class="nfo"><!-- END nfo_open --> <!-- BEGIN nfo_close --></td> </tr> </table> <span class="postbody"><!-- END nfo_close --> # #-----[ OPEN ]--------------------------------------------- # {in your template directory}/posting_body.tpl # #-----[ FIND ]--------------------------------------------- # f_help = "{L_BBCODE_F_HELP}"; x_help = "{L_BBCODE_X_HELP}"; y_help = "{L_BBCODE_Y_HELP}"; # #-----[ AFTER, ADD ]-------------------------------------- # n_help = "NFO: [nfo]text[/nfo] (alt+n)"; # #-----[ FIND ]--------------------------------------------- # bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); # #-----[ REPLACE WITH ]--------------------------------- # NOTE: Clareful with this one if you have other bbcode mods installed # bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url],'[nfo]','[/nfo]'); # #-----[ FIND ]--------------------------------------------- # <td><span class="genmed"> <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> # #-----[ AFTER, ADD ]-------------------------------------- # NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly # <td><span class="genmed"> <input type="button" class="button" accesskey="n" name="addbbcode18" value="NFO" style="text-decoration: underline; width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('n')" /> </span></td> # #-----[ FIND ]--------------------------------------------- # <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> # #-----[ REPLACE WITH ]-------------------------------------- # NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly # <select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> # #-----[ FIND ]--------------------------------------------- # </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> # #-----[ REPLACE WITH ]-------------------------------------- # NOTE: If you have additional bbcode mods installed you will need to increase the addbbcodeXX accordingly # </select> {L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> # #-----[ OPEN ]--------------------------------------------- # {in your template directory}/{template}.css # #-----[ FIND ]--------------------------------------------- # /* Quote & Code blocks */ # #-----[ AFTER, ADD ]-------------------------------------- # .nfo { color: #000000; font-weight: normal; font-size: 11px; font-family: Terminal; background-color: #CCCCCC; border: solid 1px #666666 } # #-----[ SAVE, CLOSE, UPLOAD ALL FILES ]-------------------------------------- #