Support ⇒ Modules & Blocks ⇒ nbbcode.php and List ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

nbbcode.php and List Reply to topic

Go to page Previous 1, 2

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


Did some more changes and now available at code.google.com/p/drag...mp;name=v9

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


Just ran my saved test cases through the newest version and the results remain the same/correct.

Including in SCM v9 does raise the minimum PHP version for v9 from IIRC 5 to 5.3 though? Probably not issue for those doing 'daily' builds as likely on >= 5.3, but will need noting for next DF v9 release > 9.4.0.0.

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 next release should be v10 and that is PHP >= 5.3 anyway Smile
Secondly, PHP 5.3 is EOL since 14 Aug 2014.
All PHP 5.3 users are encouraged to upgrade to the current stable version of PHP 5.5 or previous stable version of PHP 5.4, which are supported till at least 2016 and 2015 respectively.

We know hosting providers are slow thus still supporting 5.3 is ok i think.

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


Oops, I've discovered a tiny bug in the revised List processing.

While [list][*][i]Test[/i][*]Test 2[/list] works

  • Test
  • Test 2



[list][*]Test in which [i]italics[/i] is used[*][b]Test[/b] 2[/list] does not - the space before the [ i ] gets dropped as does everything after the [ /i ]
  • Test in which italics is used
  • Test 2

I think it fails in all cases when less than the whole bullet is enclosed in [ i ] or [ b ] etc.

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


Fixed in SCM 😃

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


Excellent! Works a treat.

Thanks for the quick turnaround.

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 above released - along with some other improvements - as v9 of my Enhanced BBCode hack.

For DF 9.4 only. And requires PHP 5.3 as indicated above.

More details here.

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

Last edited by layingback on Sat Feb 28, 2015 9:33 am; edited 1 time in total


Nice!
It has a lot options and fixes i see 😉

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


Thanks DJ. Been a long process but learnt a lot along the way.

Think it's pretty much done at this point, but I still want to add automagical linking of @username in a post. ( Though it won't work on yours of course Wink )

There are 2 improvements which could still be made, but being as they are in js I'll leave for someone else Smile

  1. The (slightly revised) 'allowed BBCodes' display in Quick Reply provides a short list of BBCodes so as not to 'scare off' a newbie. A click on the plus icon just does a Preview to get you the full BBCode set. Would be better if all BBCodes were downloaded and javascript used to toggle back and forth between allowed and all. The javacript would have to be inline and generated so that the allowed list of codes and whether full were available could still be controlled from the nbbcode call.
  2. Creating a table is still a little daunting. These guys do a nice web utility but it would need to be reimplemented in a clean manner to include as it is free as in beer not ideas. But in js it could possibly act right within the BBCode table.

But as is it has proven to be capable of everything anyone has wanted to create in a user or admin post, so it is pretty complete!

[ I developed it originally as I wanted my clients to maintain their own sites, and none knew HTML, only MS Word. But it is now being used in many sites, not just mine. ]

Believe it could be incorporated in DF10 with no issues. There might be some resistance to the <p></p> inclusion around all text blocks. It's there to support images up to HD (1920px wide) because at that point reading a 1920px wide text column gets old fast, so I use CSS on p to limit text to around 800px. Has turned out to be very relevant to mobile too, as the mobile browser scaling can handle 800px but fails before 1920! But as long as $bb_codes['text_start'] = ''; // allow redefinition in {theme}/bbcode.inc - lb $bb_codes['text_end'] = ''; is present the theme can add the paragraph codes or not.

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

Last edited by layingback on Sat Feb 28, 2015 10:02 am; edited 1 time in total


I'm adding the detection of @username and making it clickable if username is indeed a user.

Adding to function make_clickable in nbbcode.php:
$ret = preg_replace_callback("#(^|[\n ])@([a-z0-9\-_\.]+?)(\s)#i", function ($matches) {return $matches[1].'@'.(!is_null(getusrdata($matches[2], 'user_id')['user_id']) ? '<a href="'.getlink('Your_Account/profile='.$matches[2]).'" target="_blank" title="'.$matches[2].'">'.$matches[2].'</a>' : $matches[2]).$matches[3];}, $ret);

[ Didn't want to add another e modifier Wink And the resulting code is more readable.]

My question is while !is_null(getusrdata('username', 'user_id')['user_id'] works, I wonder if there is a better - more understandable - way of determining member status from a text username?

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

Last edited by layingback on Mon Mar 30, 2015 9:29 pm; edited 1 time in total


layingback wrote
My question is while !is_null(getusrdata('username', 'user_id')['user_id'] works, I wonder if there is a better - more understandable - way of determining member status from a text username?


To answer my own question ...
is_array(getusrdata('username', 'user_id') works and is a little more understandable.

[ I had to find an alternative because getusrdata('username', 'user_id')['user_id'] raised a parse error - 'Unexpected [' - under PHP5.3 although fine under PHP5.5! ]

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


Version X with both @username and paragraph indent among other new features is available. (Has been available for over a month but no takers ... )

Probably worth getting just for the new Help file.

Details of this release here. Download from here.

Note this may well be the last in this series of hacks, as I don't see anything that I still want to add. ( Beyond the holy grail of image upload on the fly Smile )

I'm not sure but I suspect it may be one of the most complete BBCode parsers out there - for any CMS.

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


If anyone's holding back until it's tested, be aware that rosbif now has it running on 4 sites. And I have it on 2, this one and pentaxslr.eu where it has been in use by non-power users for a couple of months without issue.

But if you find something, please let me know so that I can try and address.

Non-English translations of the bbcode.php language file and/or the Help file Forums/lang_bbcode.php gratefully received.

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
Note this may well be the last in this series of hacks, as I don't see anything that I still want to add. ( Beyond the holy grail of image upload on the fly Smile )

This should be possible in v10 with the JavaScript class: PoodleXHR

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

All times are UTC
Go to page Previous 1, 2


Jump to: