AUBBC
view release on metacpan or search on metacpan
2) The names must be spelled the same as the name passed to method user_level();
3) Security access is determined by low to high numbers and with the default Guest
will be number/level 0 in the array. if the links was set for User
the links level will have to be 1 = User making any lower level unable to
see any bbcode links but, the Administrator would still see all.
=head2 Tag Security Levels
To change the security level of links, images and code use this method this way:
$aubbc->tag_security(
code => { level => 0, text => 'register to see this', },
img => { level => 0, text => 'register to see this', },
url => { level => 0, text => 'register to see this', },
);
level - the array number of the security level
text - the text or HTML to show if user has no access
Build your own tags has 2 new variables now:
$aubbc->add_build_tag(
name => 'ok',
pattern => 'l,s',
type => 1,
function => 'My_Message::check_ok_tag',
level => 3,
error => 'register to see this',
);
level - the array number of the security level
error - the text or HTML to show if user has no access
For the build tags leaving the variables blank will default level to 0 and
error to the $AUBBC::BAD_MESSAGE string.
=head2 User Access
This method receives the current users security level name from the web application.
$aubbc->user_level('Administrator');
If you are using the tag security you will want to set the user_level after the user
was authenticated by the web application and before do_all_ubbc is used.
=head1 Settings
These settings effect a large part of what the do_all_ubbc method can do and what other
methods can do in do_all_ubbc. some settings are used in many methods
=head2 $aubbc->settings();
This is the method to change them when needed.
$aubbc->settings(
aubbc => 1,
utf => 1,
smileys => 1,
highlight => 1,
# est.....
);
=head2 aubbc
Enable or Disable Main AUBBC Tags Default 1 is Enabled, 0 is Disable.
=head2 utf
Enable or Disable UTF Tags Default 1 is Enabled, 0 is Disable.
=head2 smileys
Enable or Disable Smiley Tags Default 1 is Enabled, 0 is Disable.
=head2 highlight
Enable or Disable Code Highlight Default 1 is Enabled, 0 is Disable.
=head2 highlight_function
This can replace the highlighter of AUBBC with a custome one
must provide the text name of the pre-defined subroutine that receives the code
tags text and returns the highlighted text.
=head2 no_bypass
Enable or Disable User Tags for bypassing hole tag sets Default 0 is Disable, 1 is Enabled.
Bypass tag must be at the very beginning of the message!!!!
Must also be in the order of the "Bypass Tag list:" but not on a new line \n
and if #none is used the other bypass tags will not be removed.
Bypass Tag list:
#none
#noaubbc
#nobuild
#noutf
#nosmileys
=head2 for_links
Enable or Disable Tags for Links Default 0 is Disable, 1 is Enabled.
Some AUBBC Tags are not good to use in a link like other links.
If Enabled will only use the UTF and Smiley tags.
=head2 aubbc_escape
Enable or Disable AUBBC Tag Escape Default 1 is Enabled, 0 is Disable.
Escaping a Tag:
[b]Stuff[/b] # Normal Tag Bold
[b]]Stuff[/b]] # Escaped Tag Bold
[[b]Stuff[[/b] # Escaped Tag Bold
[[b]]Stuff[[/b]] # Escaped Tag Bold
Small Bug if Enabled:
Any use of ]] will equal ] and any [[ will equal [
=head2 no_img
Enable or Disable the [img] tags Default 0 allows the tags and 1 will just not
convert the tag.
There are some uncontrollable security issues with allowing anyone to post
an image link.
=head2 icon_image
Enable or Disable Custom Image Size Default 1 is Enabled, 0 is Disable.
If enabled will use the values from image_hight and image_width
in all Image Tags [img]/images/large_pic.gif[/img]
=head2 image_hight
The Default Image height is 60px.
Only used when icon_image is Enabled.
=head2 image_width
The Default Image width is 90px.
Only used when icon_image is Enabled.
=head2 image_border
Enable or Disable Image Border Default 0 is Disable, 1 is Enabled.
=head2 image_wrap
Enable or Disable Image wrap Default 1 is Enabled, 0 is Disable.
Fixed - in do_ubbc the [url] tag produces a bug if a link is used as a name
the fix converts the period and/or colon of the name so its not seen as a new
link.
Improvement - in do_unicode removed then changed the two regexs to do a 3 in 1 filter.
Improvement - in html_to_text added a code to fix a <br> bug if ppl use html or xhtml line break.
Improvement - moved the pattern building code from do_build_tag to add_build_tag
so it only runs one time
Improvement - in add_build_tag using a hash array to store the build tag data so
there is no need to use split in do_build_tag
Improvement - in do_all_ubbc moved script_escape to a location where one call
to the function is needed
Improvement - in do_all_ubbc added check for undefined "$message" variable
Improvement - in script_escape added check for undefined "$text" variable
Improvement - in html_to_text added check for undefined "$html" variable
Improvement - in escape_aubbc converting the brackets one time with the html
code name so the filter will only need to run one time in do_all_ubbc. This
also fixes one bug in escape_aubbc
Removed - In script_escape removed the \cM regex, it is very rare that anyone will need
it so it wont be missed.
v2.0 - 10/07/2008 13:52:11
Fixed single tag [name] for build tags
Changed the regex in plain URL's
Removed bad patter setting and now using a more standard way to detect bad image tags
Fixed dynamic view in XHTML for the protect email method.
Added js_print method which will print out the javascript needed for the new protect email method
Added values for the code highlighter so it can support CSS classes
Added highlighting of variables and changed 2 quote regex to allow multi line quotes
and a few other things that make this 2.0
v1.30 - 09/08/2008 14:12:10
Fixed the function check in add_build_tag(), when the 1.20 changes where made this check was neglected
Edited add_build_tag() Error messages, hopefully they make more sense.
Now add_build_tag() name allows - and _ in it.
v1.20 - 09/07/2008 09:23:09
Fixed bug that bypassed utf tag converter if square bracket wasn't detected
Fixed Makefile.PL
v1.10 - 09/02/2008 09:49:46
Added two more tags [big]..[/big] and [small]..[/small].
Removed utf tag style [ux23] and [u://0931] to make more tag names available.
Changed add_build_tag() to use hash variable, see "Build your own tags" for the new style.
Changed the way functions should work for built tags, the custom function for built tags will receive the tag name and data of the tag. This is so one function can handle many tags.
Removed other site tags and setting other_sites_pattern, an example of them are in "Build your own tags"
Removed [time] tag, example in "Build your own tags".
Email now allows names with & sign
Now every message that is passed to do_all_ubbc() gets escaped before being returned if script_escape is Enabled.
All tags in %AUBBC_TAGS will only convert if lowercase.
"new" now uses the most standard referenced object method.
Removed DOS_prevent() method, since the script has been tested more and was causing a timing problem.
Removed [cd]#code[/cd] code tag, which had no code_class or code_extra.
Commented bad_pattern check for [email] tags, this security check is not needed because the next line will take care of all email tag security.
Added missing $AUBBC{image_border}, $AUBBC{html_type} and $AUBBC{image_wrap} to the none icon image.
Changed names of left and right align images to [left_img]..[/img] and [right_img]..[/img], also updated examples to show tags.
Added missing $AUBBC{html_type} to quote, code tags and code_highlight function.
v1.0 01/20/2008 08:46:08
Released.
=head1 COPYLEFT
AUBBC.pm, v4.06 - 04/12/2011 By: N.K.A.
Advanced Universal Bulletin Board Code a Perl BBcode API
shakaflex [at] gmail.com
http://search.cpan.org/~sflex/
http://aubbc.googlecode.com/
Development Notes: Highlighting functions list and tags/commands for more
language highlighters. Ideas make some new tags like [perl] or have a command in the code
tag like [code]perl:$some ='perl';[/code] with a default highlighting method if
a command was not used. Then highlighting of many types of code could be allowed
even markup like HTML.
Notes: This code has a lot of settings and works good
with most default settings see the POD and example files
in the archive for usage.
=cut
( run in 1.043 second using v1.01-cache-2.11-cpan-39bf76dae61 )