UBBC [box] tag SP1/1.1
1.2
This mod adds an extra [box] UBBC tag
Anything contained within the [box]...[/box] tags will appear in a box similar to the code box or quote box, but without any heading text, or additional formatting.
The width, background colour and alignment of the box can be changed by using [box width=???], [box color=???], [box align=???], [box color=??? width=???], [box align=??? colour=???], [box width=??? align=???], [box width=??? color=??? align=???] or any other combination.
Width can be a number (pixels) or a percentage (%), color/colour can be a name (white) or number (#FFFFFF) amd align can be "left", "right" or "center"
The style can be controlled by changing the style settings for .messagebox in the template
To install: Apply the mod and upload the modified files - that's it!
Version 1.1 - bug fix: The boxes are now displayed on the printable thread display, but any align, width or color attributes are ignored.
Version 1.2 - bug fix: Empty boxes (nothing between the [box][/box] tags are now displayed correctly.
BHRA Webmaster
http://www.bhra.org.uk
english.lng
$txt{'706'} = qq~Code:~;
$txt{'706a'} = qq~~;
template.html
/* Post quote/code colors */
.messagebox { color: #000000; background-color: #DEE7EF; }
Sources/YaBBC.pl
sub quotemsg {
sub box {
$parameter{'width'} = ""; $parameter{'color'} = ""; $parameter{'colour'} = ""; $parameter{'align'} = "";
my ($tmpstuff, $tmpmessage) = @_;
foreach $dummy (split(/ /,$tmpstuff)) {
($key, $value) = split(/=/,$dummy);
$parameter{$key} = $value;
}
if ($parameter{'width'} eq "") {$parameter{'width'} = "90%";}
if ($parameter{'color'} ne "") {$parameter{'color'} = qq~ bgcolor="$parameter{'color'}" style="background-color:$parameter{'color'}"~;}
if ($parameter{'colour'} ne "") {$parameter{'color'} = qq~ bgcolor="$parameter{'colour'}" style="background-color:$parameter{'colour'}"~;}
if ($parameter{'align'} ne "") {$parameter{'align'} = qq~ align="$parameter{'align'}"~;}
$_ = $txt{'706a'};
$_ =~ s~BOXWIDTH~$parameter{"width"}~ig;
$_ =~ s~BOXSTYLE~$parameter{'color'}~ig;
$_ =~ s~BOXALIGN~$parameter{'align'}~ig;
$_ =~ s~BOXMESSAGE~$tmpmessage~ig;
return $_;
}
$message =~ s~\[quote\s+author=(.*?)link=(.*?)\s+date=(.*?)\s*\]\n*(.*?)\n*\[/quote\]~"emsg($1,$2,$3,$4)~eisg;
$message =~ s~\[box+(.*?)\](.*?)\[\/box\]~&box($1,$2)~eisg;
Sources/Printpage.pl
$threadpost =~ s~\[quote\s+author=(.*?)link=(.*?)\s+date=(.*?)\s*\]\n*(.*?)\n*\[/quote\]~
on $3, $1 wrote:~isg;
$threadpost =~ s~\[box+(.*?)\](.*?)\[\/box\]~~isg;