Create Forum with parent

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
kizuzi
Registered User
Posts: 21
Joined: Sat Mar 28, 2020 7:41 am

Create Forum with parent

Post by kizuzi »

Hy,

I want top create a Forum in my Extension but I can not understand how the parent function is working. If I set the parent_id, that seems to be ignored but I do not understand, how the column forum_parents will be filled that seems to be the colloumn that is used to show the forum in the correct relation.

Can someone explain that to me?

Best Regards, Daniel
User avatar
3Di
Former Team Member
Posts: 16155
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Name: Marco
Contact:

Re: Create Forum with parent

Post by 3Di »

Look at includes/acp/acp_forums mode add

There is the event core.acp_manage_forums_request_data
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
kizuzi
Registered User
Posts: 21
Joined: Sat Mar 28, 2020 7:41 am

Re: Create Forum with parent

Post by kizuzi »

Dear 3Di,

I can see it, but how that can help me to understand the rows forum_parents and parent_id?

Best Regards, Daniel
rxu
Extensions Development Team
Posts: 3467
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Create Forum with parent

Post by rxu »

kizuzi, this is mostly not phpBB specific but about common storing hierarchical data in a database, f.e. https://graybox.co/knowledge/blog/stori ... a-database where the tree structure is stored in left/right ids. parent_id points to direct node parent.
forum_parents is empty on forum creation but got filled later on the 1st forums list rendering to simplify getting forum parents info, see https://github.com/phpbb/phpbb/blob/3.3 ... #L878-L881.
kizuzi
Registered User
Posts: 21
Joined: Sat Mar 28, 2020 7:41 am

Re: Create Forum with parent

Post by kizuzi »

Dear rxu,

Thank you. Many Thanks. Its seems that I have understand that now.

Best Regads, Daniel
Post Reply

Return to “Extension Writers Discussion”