[BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

[BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

MOD Title: Prime Nest BBCodes
MOD Description: This MOD will allow Custom BBCodes to be nested. The maximum number of times that a custom BBCode is allowed to be nested can be set when creating or editing custom BBCodes (in the Administration Control Panel).
MOD Version: 0.0.1

MOD Download: Main Download Site
Last Stable version: 0.0.1

Demo Board: http://www.absoluteanime.com/forum/view ... 95&t=30647
Demo Username: Not Required
Demo Password: Not Required

Version 0.0.0 (Sept. 6, 2007)
  • Initial release
Version 0.0.1 (Sept. 7, 2007)
  • Fixed: No styling (nesting or otherwise) would work on nested tags that were posted when their maximum depth was set to zero, even if the max depth was later changed to a positive integer.
Last edited by primehalo on Thu Feb 14, 2008 6:26 pm, edited 2 times in total.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

To update from 0.0.0 to 0.0.1:

Find

Code: Select all

                    $data['second_pass_match'] = preg_replace('%(\\\\\[' . $test . '[^]]*])%se', "str_replace('=(.*?)', '=([^\]]*)', '$1') . '(?!.*' . preg_replace('/=.*?\\\]/', '=[^\]]*\\]', '$1') . '.*)'", $data['second_pass_match']);  
After, add

Code: Select all

                    $data['second_pass_match'] = str_replace(':$uid', '(?::$uid)?', $data['second_pass_match']);  
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
playerfr
Registered User
Posts: 851
Joined: Fri Jul 18, 2003 9:50 am
Location: France - Paris

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by playerfr »

I dont understand what this mod do. What do you mean be Nested ? They are hidden ?

Thanks
All kind of help for your Forums / Sites. Installing for you the forum, the Mods, creating Custom Mods : for small fee http://www.phpbbhelpers.com
Wickedlad
Registered User
Posts: 40
Joined: Tue Jun 19, 2007 12:05 pm

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by Wickedlad »

It would be nice, thanks.
joebart72
Registered User
Posts: 743
Joined: Thu Feb 01, 2007 5:54 am

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by joebart72 »

playerfr wrote:I dont understand what this mod do. What do you mean be Nested ? They are hidden ?

Thanks
+1 ;)
I learn English with phpbb.com :)
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

playerfr wrote:I dont understand what this mod do. What do you mean be Nested ? They are hidden ?

Thanks
Nested means you can put one inside the other. Check out the 2nd post on the example page:
http://www.absoluteanime.com/phpbb3/vie ... 5&p=12#p12
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
playerfr
Registered User
Posts: 851
Joined: Fri Jul 18, 2003 9:50 am
Location: France - Paris

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by playerfr »

I still dont understand why this is needed ? As i can do as many bbcode inside in each others and it works by default :? maybe i am miss understanding something :oops:

for example look this is changing colors and highlight everything and no nest mod here
All kind of help for your Forums / Sites. Installing for you the forum, the Mods, creating Custom Mods : for small fee http://www.phpbbhelpers.com
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

playerfr wrote:I still dont understand why this is needed ? As i can do as many bbcode inside in each others and it works by default :? maybe i am miss understanding something :oops:

for example look this is changing colors and highlight everything and no nest mod here
You don't need it for coloring text (although in some cases it could make coloring more convenient). I was just using that as an example so you can see how it works. Look at the other example on the page, the one with the spoiler. The main Spoiler box contains other spoiler boxes inside it, which would not be possible normally.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
playerfr
Registered User
Posts: 851
Joined: Fri Jul 18, 2003 9:50 am
Location: France - Paris

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by playerfr »

ok thx :)
All kind of help for your Forums / Sites. Installing for you the forum, the Mods, creating Custom Mods : for small fee http://www.phpbbhelpers.com
Shanti
Registered User
Posts: 131
Joined: Fri Apr 12, 2002 3:47 pm
Location: Wisconsin, USA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by Shanti »

This is a great mod...I'm only wondering how this didn't get into the core functionality of the Gold release. Is there a functional reason for custom BBCode parsing to be suppressed inside other custom BBCodes?

I'm going to test this out on my 3.0 install before I do my final conversion, so I'll let you know how it goes! I'm hoping since it was developed for RC7 that it should be fine.

PS - A suggestion - the XML format is really slick-looking, but you may also want to include a standard MOD format file in your install package against the day that EasyMod for 3.0 comes around, or for those who just find text files easier to work with, as I do. ;)
Shanti
It is better to light one candle...
http://www.RealmsofKaos.com
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

Shanti wrote:This is a great mod...I'm only wondering how this didn't get into the core functionality of the Gold release. Is there a functional reason for custom BBCode parsing to be suppressed inside other custom BBCodes?

I'm going to test this out on my 3.0 install before I do my final conversion, so I'll let you know how it goes! I'm hoping since it was developed for RC7 that it should be fine.

PS - A suggestion - the XML format is really slick-looking, but you may also want to include a standard MOD format file in your install package against the day that EasyMod for 3.0 comes around, or for those who just find text files easier to work with, as I do. ;)
I have no idea why this wasn't included. I also don't understand why they went with the whole bitfield thing which can seriously screw up custom BBCodes if you ever change them around.

I'm pretty sure EasyMod for 3.0 will use the MODX format, not the text format. When I started, I used both, but through all the updates it became too difficult to maintain two sets of instructions. And since MODX is required for 3.0, I went with that.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
AVRFreak32
Registered User
Posts: 3
Joined: Sat Apr 21, 2007 3:06 pm

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by AVRFreak32 »

Great mod.
Really, will this ever be implemented in basic features?
If not, why'd hell not.

I need this nesting functionality, but I don't want to overmod my board.
I don't need this ACP stuff for setting custom depth, I'd rather hardcode the depth to 100 (or infinite), and have a simpler mod for my board.

Can you tell me which phpbb files I need to edit (which mod sections in your mod) are required for me to do this?
I'll study your code sections in detail once you point me to the most important code part of the mod.


Thanks.
moustafamin
Registered User
Posts: 230
Joined: Thu Aug 30, 2007 8:10 am

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by moustafamin »

does it support other editors???
cause I'm using hoteditor..

and anoher question.. does it work only for the new created bbcodes... I mean, can't I apply it for the default bbcodes of the hoteditor???
User avatar
primehalo
Former Team Member
Posts: 2898
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by primehalo »

AVRFreak32 wrote:Great mod.
Really, will this ever be implemented in basic features?
If not, why'd hell not.

I need this nesting functionality, but I don't want to overmod my board.
I don't need this ACP stuff for setting custom depth, I'd rather hardcode the depth to 100 (or infinite), and have a simpler mod for my board.

Can you tell me which phpbb files I need to edit (which mod sections in your mod) are required for me to do this?
I'll study your code sections in detail once you point me to the most important code part of the mod.


Thanks.

Code: Select all

//-- mod: Prime Nest BBCodes ------------------------------------------------//
// Here we put the uid in the nested tags that didn't get it above.
                    if ($bbcode_data['bbcode_id'] > NUM_CORE_BBCODES && !empty($bbcode_data['max_depth']))
                    {
                        for ($depth = 0; preg_match($regexp, $this->message); $depth++)
                        {
                            $this->message = preg_replace($regexp, $replacement, $this->message);
                        }
                        if ($depth > $bbcode_data['max_depth'])
                        {
                            $this->warn_msg[] = sprintf($user->lang['QUOTE_DEPTH_EXCEEDED'], $bbcode_data['max_depth']);
                        }
                    }
//-- end: Prime Nest BBCodes ------------------------------------------------//   
moustafamin wrote:does it support other editors???
cause I'm using hoteditor..

and anoher question.. does it work only for the new created bbcodes... I mean, can't I apply it for the default bbcodes of the hoteditor???
The editor shouldn't matter. It only works for custom BBCodes, but you can modify it to work with any, though it's not as easy as it sounds. The regular expression to match BBCode tags are stored in the database, and my MOD modifies this regular expression so that it will only match the inner most of nested tags.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
mag00_br
Registered User
Posts: 43
Joined: Thu Jan 03, 2008 3:09 pm
Location: Brasil -SP
Contact:

Re: [BETA] Prime Nest BBCodes - Allows Nesting of custom BBCodes

Post by mag00_br »

I did not see nothing on demoboard.

Have another site to see this MOD?

[]'s
*[NMT]*Mag00* / [Granja] Falco Peregrinus / | CDA | Mr.Orange |
http://www.granjaklan.com/forum
Image
Locked

Return to “[3.0.x] MODs in Development”