Dragonfly CMS v9 ⇒ Modules & Blocks ⇒ Enhanced BBCode Hack v11 ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Enhanced BBCode Hack v11 Reply to topic


Note this is for DF 9.4 only. (DF >=9.3 can only use v8) And requires PHP 5.3 or later.

(From looking at the code I'm pretty sure that it won't install/work on latest version of V10 as used here).

If anyone is interested given the 2 restrictions above, I have just added Menu support!

You read that right - you can now easily create menus in BBCode Laughing

Why would you want to, you ask? Well I did, so I added the feature! Smile And as it is shared F/OSS I'll release it!

No way to demo it here, so see this post on my site:

http://layingback.net/Forums/viewtopic/p=3243/my_enhanced_bbcode_hack_-_v10_---__now_released/#3243

Link info for download is in same post.

Any issues please let me know. Enjoy!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


The hack works fine except it screws the forums block, see image below.

Any idea how to fix this?
Attachment: outpost.jpg
Description forums block
Filesize 71.46 KiB
Viewed 9 Time(s)
You are not allowed to view/download this attachment

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


Worked it out, you have to take out any spacing making the code 1 continuous string.

Bullet list and Number list don't show either. 😕

I have Dragonfly 9.4.0.0
PHP 5.4.44

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


Re your first post, can you direct me to a download for that Forums block, or the filename if it's a standard one. (I use 3 separate ones of my own, not a combo one.) I think it may be an issue with the block's code, as I didn't think Topic titles were BBCode encoded.

Extra spaces 'left' in the text are annoying. I delete the ones I can find! So I want to 'look' for these.

Re second post do you have a link to a page with the List error please that I can take a look at? I don't really mess with the List display function, it's part of standard DF BBCode, but of course this version has the new List code from DJMaze. Only requirement I know of is PHP 5.3 or greater, but I'll take a look if you have a link.

Finally, I don't know if it'll address any of your issues, but vX (v10) is still available to download, I just tried it. layingback.net/Downloa...ls/id=104/

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


The forum block that screwed up is the standard block-Forums
I had to change
$content .= '<b>•</b>  <a href="'.getlink('Forums&file=viewtopic&t='.$topic_id).'">'.$topic_title.'</a><br />';
to
$content .= '<b>•</b> <a href="'.getlink('Forums&file=viewtopic&t='.$topic_id).'">'.$topic_title.'</a><br />';
To fix the block.
---------------------------------------------------------------
Bullet list and Number list don't show either

I must of had too much Xmas cheer, i simply missed adding the [*] to make it work

---------------------------------------------------------------
I still have errors at the bottom of page

includes/nbbcode.php

Notice line 23: Undefined index: nbbcode
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


BobCat wrote
The forum block that screwed up is the standard block-Forums
I had to change
$content .= '<b>•</b>  <a href="'.getlink('Forums&file=viewtopic&t='.$topic_id).'">'.$topic_title.'</a><br />';
to
$content .= '<b>•</b> <a href="'.getlink('Forums&file=viewtopic&t='.$topic_id).'">'.$topic_title.'</a><br />';
To fix the block.

Oh! I thought you meant that you had to remove spaces from the Topic Title.

Not anything that I know how to do to this I'm afraid. It's caused by the newlines which used to get through when you entered tables in BBCode using line-breaks (which is the only sane way to enter them!). These white-spaces messed up Enhanced BBCode output for many releases (trailing lines at the end of all the text) until I found a way to search-and-replace them - but it does mean that it is now intolerant to unnecessary line-breaks in the code like the one you have removed here. I didn't realise there was one hidden in blocks-Forums. Sorry about that.

---------------------------------------------------------------
BobCat wrote
Bullet list and Number list don't show either

I must of had too much Xmas cheer, i simply missed adding the [*] to make it work

Phew! Thank goodness for that!

---------------------------------------------------------------
BobCat wrote
I still have errors at the bottom of page

includes/nbbcode.php

Notice line 23: Undefined index: nbbcode
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end
Notice line 584: Undefined index: align_start
Notice line 584: Undefined index: align_end

Firstly these are Notices not Errors, so no harm in leaving them (or even turning them off). Nothing I can do about the nbbcode one, that's the flag to permanently set the legacy vs new 'click on image link for all images' option. See documentation and/or the comments at top of nbbcode.php.

The others (align_start and align_end) are used in reDesign based themes - so that CSS can control the width of text to a suitable max-width like 800px, rather than have a 1920px wide text paragraph just because someone had uploaded a 1920px wide HD image and forced the page width out.

It's of no use on non-reDesign themes, and there could be many of these Notices, so they should be supprssed. I don't see them as all my sites boot into reDesign themes, but I believe if you would like to try the small patch below, it should hide them. Let me know if it works and I'll build into the next release (which will be out soon).

In nbbcode.php aound line 79 look for:
$bb_codes['text_start'] = ''; // allow redefinition in {theme}/bbcode.inc - lb $bb_codes['text_end'] = '';
and replace with:
$bb_codes['text_start'] = ''; // allow redefinition in {theme}/bbcode.inc for reDesign themes - lb $bb_codes['text_end'] = ''; $bb_codes['align_start'] = ''; $bb_codes['align_end'] = '';
Thanks for bringing this to my attention.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


TY the
$bb_codes['align_start'] = ''; $bb_codes['align_end'] = '';
fixed the errors

only get the error
includes/nbbcode.php Notice line 23: Undefined index: nbbcode
but that seems ok to put up with

Thanks again layingback

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


On line 23 of nbbcode.php replace:

if ($MAIN_CFG['nbbcode']['img_opt']) {$img_opt = 1;}

with:

if (isset($MAIN_CFG['nbbcode']['img_opt'])) {$img_opt = 1;}

Should get same result without raising a Notice if you haven't created the cms_config_custom field.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


layingback wrote
On line 23 of nbbcode.php replace:

if ($MAIN_CFG['nbbcode']['img_opt']) {$img_opt = 1;}

with:

if (isset($MAIN_CFG['nbbcode']['img_opt'])) {$img_opt = 1;}

Should get same result without raising a Notice if you haven't created the cms_config_custom field.

!empty instead of isset would be definitively better.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


Thank you Nano.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Thank You layingback, Thank You Nano

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Litespeed/Apache2.4.23/MySQL5.5.42/PHP 5.6.25/DF 9.4.0.0


BobCat wrote
Thank You layingback, Thank You Nano

layingback wrote
Thank you Nano.


We have a clickable 👍 on the left Wink

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


@Bobcat,

I wasn't going to support going to support any themes but reDesign type for the next release of my Enhanced BBCode, mostly because there didn't seem to be a demand.

So based on the above I decided to tackle it this morning. Took way longer than I expected - I had to resize some of the new icons, etc., but it's working now.

Main feature is that it only displays a simple BBCode table initially, same as the one on the Administration Page in Admin - just Bold, Italic, Underline, Image, Link, Email and Quote. Plus an Advanced link to bring up the rest. All done in CSS so fast.

If you are interested in beta testing, let me know and I'll notify you when it's ready for test.

@Nano,

There are lots of button icons now, is there a simple way to cache these, or load them quickly?

TIA!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


@layingback
Why dont you use sprites? and put all the buttons on a single PNG?

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


@greenday2k
Spites! That takes me back ... to the Commodore Rolling Eyes

Good idea, but the icons are currently img's not background images, and object-fit has poor support on anything but the latest browsers at the moment. Don't fancy restructuring all the ( working Wink ) nbbcode code just to make it work with background images ...

But you've given me another idea: Replace the entire bbcodetbl of icons with 1 big single background image with all the icon images displayed in the correct places. Then use the same transparent gif for each of the icon buttons to click on - with a single alternate version for selected ones for paired BBCodes (clear with blue border for standard themes, translucent green overlay for reDesign ones). I can use CSS/sprites for that pair.
May need 2 background images, if I continue to honour the icon size differences between the 2 types of themes, but only 1 per theme, so should solve my initial loading delay problems. Worth investigating. Thanks!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4

All times are UTC


Jump to: