Not logged in. · Lost password · Register
Forum: Customising UNB Modifications and plug-ins RSS
Useful ABBC add-ons
Avatar
NFG #1
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
Subject: Useful ABBC add-ons
I've been adding features to my forum and thought maybe other people would be interested in my solutions.  To add any of these to your own forum, simply copy the code into your abbctags.php file (in unb_lib/plugins)

Youtube videos
Some users wanted to see inline youtube videos, so I created an ABBC tag called [toob].  The code is:

    $ABBC['Tags']['toob'] = array(
     'htmlopen0'  => '<center><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com.au/v/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>',
     'htmlcont0'  => '',
     'htmlclose0' => '</center>',
     'textcont0'  => 'http://www.youtube.com/v/$1',
     'htmlblock'  => true,
     'minparam'   => 0,
     'maxparam'   => 0,
     'openclose'  => true,
     'nocase'     => true,
     'nested'     => false,
     'proccont'   => true,
     'subset'     => ABBC_CUSTOM
);

Note that it requires the user enclose only the video ID, not the entire video URL.  For example, [toob]Qr4S-43ss2![/toob]  This is so I didn't have to add any logic to prevent them from linking any evil flash files.
This post was edited on 2008-11-20, 06:27 by NFG.
Avatar
NFG #2
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
Next, I added a tag for SVG files.  This was required 'cause, while Opera was happy to display SVGs between two [img] tags, there was no way Firefox, IE or Safari/Chrome could deal with it.  So, now there's an [svg] tag. 

Throw a URL between two SVG tags, same as IMG tags, and presto!  For example:  [svg]http://wherever.whatever/folder/img.svg[/svg]

This code even displays a "your browser sucks!" message for IE users:

    $ABBC['Tags']['svg'] = array(
     'htmlopen0'  => '<center><object data="$1" type="image/svg+xml"><a href="http://opera.com"><img src="/grafx/games/logos/SVG-Warning.png"></a></object>',
     'htmlcont0'  => '',
     'htmlclose0' => '</center>',
     'textcont0'  => '',
     'htmlblock'  => true,
     'minparam'   => 0,
     'maxparam'   => 0,
     'openclose'  => true,
     'nocase'     => true,
     'nested'     => false,
     'proccont'   => true,
     'subset'     => ABBC_CUSTOM
);

Whatever appears between the <object> tags will be shown to browsers that can't deal with the SVG content.  IE users in this case will see an error image that links to Opera.com.  The image linked above (SVG-Warning.png) is this one.  You should probably use one with your own logo on it.  =)

Alternately, you could just use text.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20110527-dev, © 2003-2011 by Yves Goergen
Page created in 177.8 ms (89.9 ms) · 40 database queries in 138.1 ms
Current time: 2012-02-08, 09:13:23 (UTC +01:00)