Код: Выделить всё
##############################################################
## MOD Title: Extended Offtopic BBCode
## MOD Author: R@ < meos@mail.ru > (Kirill) N/A
## MOD Description: Adds [off][/off] BBCode tags for off-topic indication, this makes text marked with grey color and smaller size.
## MOD Version: 1.1.1
##
## Installation Level: Easy
## Installation Time: 7 Minutes
## Files To Edit(9): posting.php
## privmsg.php
## includes/bbcode.php
## language/lang_russian/lang_main.php
## language/lang_english/lang_main.php
## templates/subSilver/posting_body.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/subSilver.css
## templates/subSilver/bbcode.tpl
##
## Included Files: none
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes:
##
## Original idea of MOD belongs to Naj_Geetsrev < najgeetsrev@zonnet.nl > < http://www.stichtingdoelloos.com >
## Some pieces of code from this Mod were used
##
## Thanks to http://phpbbguru.net and especially to Xpert for help with mod
##
##############################################################
## MOD History:
##
## 2004-05-24 - Version 1.1.1
## - New replacement algorythm used, now Multiple BBCode MOD is not needed.
##
## 2004-03-29 - Version 1.1
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_BBCODE_T_HELP' => $lang['bbcode_t_help'],
#
#-----[ OPEN ]------------------------------------------
#
privmsg.php
#
#-----[ FIND ]------------------------------------------
#
'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_BBCODE_T_HELP' => $lang['bbcode_t_help'],
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url4'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [off] and [/off] for posting offtopic.
$text = str_replace("[off:$uid]", $bbcode_tpl['off_open'], $text);
$text = str_replace("[/off:$uid]", $bbcode_tpl['off_close'], $text);
#
#-----[ FIND ]------------------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [off] and [/off] for offtopic text.
$text = preg_replace("#\[off\](.*?)\[/off\]#si", "[off:$uid]\\1[/off:$uid]", $text);
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['bbcode_w_help'] = 'Вставить ссылку: [url]http://url[/url] или [url=http://url]текст ссылки[/url] (alt+w)';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bbcode_t_help'] = 'Offtopic: [off]текст[/off] (alt+t)';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['bbcode_w_help'] = 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bbcode_t_help'] = 'Offtopic: [off]text[/off] (alt+t)';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN off_open --><span class="off"> <!-- END off_open -->
<!-- BEGIN off_close --> </span><!-- END off_close -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
.helpline { background-color: {T_TR_COLOR2}; border-style: none; }
#
#-----[ AFTER, ADD ]------------------------------------------
#
/* Offtopic text */
.off { font-size: 10px; color: #999999 }
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.css
#
#-----[ FIND ]------------------------------------------
#
.helpline { background-color: #DEE3E7; border-style: none; }
#
#-----[ AFTER, ADD ]------------------------------------------
#
/* Offtopic text */
.off { font-size: 10px; color: #999999 }
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
w_help = "{L_BBCODE_W_HELP}";
#
#-----[ AFTER, ADD ]------------------------------------------
#
t_help = "{L_BBCODE_T_HELP}";
#
#-----[ FIND ]---------------------------------
#
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags
#
bbtags = new Array(
#
#-----[ IN-LINE FIND ]---------------------------------
#
'[url]','[/url]'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
,'[off]','[/off]'
#
#-----[ 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 ]------------------------------------------
#
<td><span class="genmed">
<input type="button" class="button" accesskey="t" name="addbbcode18" value="Off" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('t')" />
</span></td>
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]---------------------------------
#
# NOTE - the full line to look for is:
# <select name="addbbcodefontcolor" onChange="bbfontstyle('[color=' + #this.form.addbbcodefontcolor.options[this.form.addbbcodefontcolor.selectedIndex].value + ']', '[/color]')" #onMouseOver="helpline('s')">
#
name="addbbcode18"
#
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode18"
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
name="addbbcodefontcolor"
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.options
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontcolor.options
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.selectedIndex
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontcolor.selectedIndex
#
#-----[ FIND ]---------------------------------
#
# NOTE - the full line to look for is:
# </select> {L_FONT_SIZE}:<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + #this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]')" #onMouseOver="helpline('f')">
#
name="addbbcode20"
#
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode20"
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
name="addbbcodefontsize"
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.options
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontsize.options
#
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.selectedIndex
#
#-----[ IN-LINE REPLACE ]---------------------------------
#
this.form.addbbcodefontsize.selectedIndex
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM