Release of v8 of my BBCode Hack

Dragonfly issues as they relate to modules discussed here
  
24 Aug '13 Sat Aug 24, 2013 18:26    
layingback
Site Admin  
  •  

Post Release of v8 of my BBCode Hack

A new version of NBBCode with 4 significant fixes, plus minor corrections:

  1. Resize option is added to YouTube and vimeo, plus YouTube now has noControl option to hide control bar (always hidden by default by vimeo)
  2. EMail gets the option to use different display text to the actual email address, if omitted or same as email address then existing format is still used
  3. Font Size and Font Color pull-downs reset automatically, enabling easy multiple applications of same font or color
  4. 'BBCode Help' is changed to just 'Help' to alow more space for Tip Line, and 'Help' is moved to language files
  5. The [IMG] button is moved back to before the [IMGL] and [IMGR] buttons as new users seem to just pick the 1st one
  6. PHP now adds the <?php required by PHP5 automatically (and retroactively)

Here's a screen shot of the latest BBCode table. The screenshot is of reDesign3+ version, but the full functionality is still there for reDesign3 and for other themes. Both types of buttons are included in the pack.

And a list of the functions now supported. Those with an asterisk are enabled via this hack.

  • Bold
  • Italic
  • Underline
  • Strike*
  • Spoiler with CSS unhide*
  • Title for custom sub headings*
  • Text left to right
  • Text right to left
  • Email - with optional display text*
  • URL link - with follow option for Admin only*
  • IMG with URL link (eg to larger image)*
  • PDF link with PDF icon*
  • Justify full
  • Justify left
  • Center
  • Justify right
  • Text colour
  • Image - with resize and/or title/alt options*
  • Image float left with resize and/or title/alt*
  • Image float right with resize and/or title/alt*
  • Youtube embed - with resize & noControl*
  • Vimeo embed - with resize*
  • Flash
  • Flv
  • Quote
  • Code
  • PHP - with PHP5 <?php*
  • HR line
  • Marquee down
  • Marquee up
  • Marquee left
  • Marquee right
  • Font size
  • Search*
  • List*
  • Numbered list*
  • Lettered list*
  • Roman numeral list*
  • List symbol*
  • Table*
  • Table row*
  • Table heading*
  • Table cell*
  • Flags*

A complete up-to-date BBCode user help file with examples is included.

Get it here.

If you find this useful for your site, please consider a donation. TIA!



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
2 Sep '13 Mon Sep 02, 2013 05:13    
Gamekeeper
Sponsor  Sponsor
  •  

Post Re: Release of v8 of my BBCode Hack

Thank you for the update, everything seems to be working fine on ForumsPro!



Gamekeeper's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux, Apache 2.0, SQL 5.0.86, PHP 5.2.11,DF 9.2.

 
 
 
 
  
18 Sep '13 Wed Sep 18, 2013 18:14    
Kinsman
Contributor  Contributor
  •  

Post Re: Release of v8 of my BBCode Hack



Just curious why the fullscreen button no longer works?



Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

XP/1.4/4.1.21/4.4.7/ 9.2.1

 
 
 
 
  
18 Sep '13 Wed Sep 18, 2013 18:49    
layingback
Site Admin  
  •  

Post Re: Release of v8 of my BBCode Hack

Don't think it ever worked! Embarassed

You can tell I don't use Y/t Laughing

OK, here's the changes to includes/nbbcode.php around line 722 (note my line numbers may differ slightly ... I'm part way through adding optional support for mixing BBCode and HTML.)

In front of

Code:
<embed src=\"http://www.youtube.com

insert

Code:
<param name=\"allowFullScreen\" value=\"true\"></param>

- total of 3 times over next 4 lines.

In front of

Code:
width=\"

insert

Code:
allowfullscreen=\"true\" 

- total of 3 times over same 3 lines. (Include the trailing space.)

First param tells Flash, 2nd tells youtube player. Thanks go to these 2 sites: stackoverflow, beerplanet <- clever domain name ...

Quick enough fix for you Wink



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
18 Sep '13 Wed Sep 18, 2013 23:37    
Kinsman
Contributor  Contributor
  •  

Post Re: Release of v8 of my BBCode Hack

Works good here, I've obviously got it wrong somehow as still not working on our site.

PHP:
// [youtube] youtube video id [/youtube] code..
$patterns[] = "#\[(?:youtube|youtube(?: (?:w|width)=([0-9]{1,4})(?: (noc|nocontrol|nocontrols))?))\]([^ \"\n\r\t<]*?)\[/youtube\]#sie";
$replacements[] = "('\\1' == ''
? '<center><object allowfullscreen=\"true\" width=\"640\" height=\"390\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"640\" height=\"390\"></embed></object></center>'
: ('\\2' == ''
? '<center><object allowfullscreen=\"true\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9', '\\1').'\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9', '\\1').'\"></embed></object></center>'
: '<center><object allowfullscreen=\"true\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9noC', '\\1').'\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9noC', '\\1').'\"></embed></object></center>'))"
;



Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

XP/1.4/4.1.21/4.4.7/ 9.2.1

 
 
 
 
  
19 Sep '13 Thu Sep 19, 2013 06:16    
Kinsman
Contributor  Contributor
  •  

Post Re: Release of v8 of my BBCode Hack

yes i did miss abit, all working now. Prob not important, but i also added the script access parameter.

PHP:
$patterns[] = "#\[(?:youtube|youtube(?: (?:w|width)=([0-9]{1,4})(?: (noc|nocontrol|nocontrols))?))\]([^ \"\n\r\t<]*?)\[/youtube\]#sie";
$replacements[] = "('\\1' == ''
? '<center><object allowfullscreen=\"true\" width=\"640\" height=\"390\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"390\"></embed></object></center>'
: ('\\2' == ''
? '<center><object allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9', '\\1').'\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9', '\\1').'\"></embed></object></center>'
: '<center><object allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9noC', '\\1').'\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\3\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\3\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"\\1\" height=\"'.preg_replace_callback('#([0-9]{1,4})#', 'callbackFunction_16x9noC', '\\1').'\"></embed></object></center>'))"
;



Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

XP/1.4/4.1.21/4.4.7/ 9.2.1

 
 
 
 
  
19 Sep '13 Thu Sep 19, 2013 06:20    
Kinsman
Contributor  Contributor
  •  

Post Re: Release of v8 of my BBCode Hack



Just checking resize, all good. Very Happy



Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

XP/1.4/4.1.21/4.4.7/ 9.2.1

 
 
 
 
  
28 Dec '13 Sat Dec 28, 2013 17:52    
Gamekeeper
Sponsor  Sponsor
  •  

Post Re: Release of v8 of my BBCode Hack

I made the changes for YouTube full screen icon, these work fine but a similar problem exists for Vimeo videos where no full screen icon is visible at all.



Gamekeeper's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux, Apache 2.0, SQL 5.0.86, PHP 5.2.11,DF 9.2.

 
 
 
 
  
24 May '14 Sat May 24, 2014 21:56    
rosbif
BetaTester  BetaTester
  •  

Post Re: Release of v8 of my BBCode Hack

Did I read a discussion somewhere about spaces in image filenames? They seem to break this bbcode - is it possible to get them allowed?



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
25 May '14 Sun May 25, 2014 15:57    
layingback
Site Admin  
  •  

Post Re: Release of v8 of my BBCode Hack

Err, I think I have a working version - will need to check - but it is NOT endorsed by DF Staff. In fact the whole thread discussing this was moved to a restricted access forum!

I can look for the code and email to you (in a few days) but I'm not prepared to release it publicly as it MAY have a security issue.

But check if it has been fixed in latest DF code. (Although last DF version that I tested had it working for the space character but not %20, and as far as I'm aware no site uses the space character but several use %20!!!)



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
Link  QR 
Share this Printer Friendly Page  facebook   google+   linkedin   twitthis  
Show more ...



Forum Permissions - You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum