3.2: Easiest way to get all Forums, Subforums, Threads etc.

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
margau
Registered User
Posts: 4
Joined: Fri Aug 03, 2018 6:54 am

3.2: Easiest way to get all Forums, Subforums, Threads etc.

Post by margau »

Hello together,
i'm currently writing a small API for my phpBB-Board (i need it for a mobile app).
Currently, i have completed the authentication-part, but i'm stuck at reading out the forum list:

I already found https://area51.phpbb.com/docs/code/3.2. ... orums.html, but it seems to cover the RSS-part, not the "native" list.
I would prefer to not run SQL-Queries by myself, but set up on the "High Level"-PHP-API - is there currently a way to archieve this?

I'm not using a "direct" extension: the API is not embedded as extension in phpBB, but located "nearby" and including the common.php.

Thanks and best regards
margau
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: 3.2: Easiest way to get all Forums, Subforums, Threads etc.

Post by mrgoldy »

It might just be me, but I am having a hard time figuring out what you're asking ...
If you want to get all forums, you'll have to use a SQL query, you can not use an already existing one, as not all forums are queried on every page.
Same as for topics, only certain topics are queried at a time, depending on which forum you are in and on what page.

But to provide a solid answer, I think you'll have to provide a bit more detail on what you're trying to achieve.
Are you making a feed, do you want to display forums / topics, what is it you're after?
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
margau
Registered User
Posts: 4
Joined: Fri Aug 03, 2018 6:54 am

Re: 3.2: Easiest way to get all Forums, Subforums, Threads etc.

Post by margau »

Hello,
thank's for the answer.

What i'm trying to build is a REST-API, whose structure is similar like the normal starting page:

GET /api/forum
{
{name: "First Forum", id: 1},
{name: "Second Forum, id: 2},
{name: "Child", id: 3, parent: 1}
}
GET /api/threads/1?limit=10
{
// return latest 10 threads in Forum 1 (First Forum)
}

and so on.

I wan't it to be as much Top-Level as possible, so i would prefer to avoid SQL-Requests for stylistic reasons.

Final goal is to be flexible with mobile frontends, so i can bind to whatever representation I have to. Current plan is an app with Ionic (we don't want to use Tapatalk for privacy reasons).

Best regards
margau
User avatar
martti
Registered User
Posts: 911
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: 3.2: Easiest way to get all Forums, Subforums, Threads etc.

Post by martti »

Post Reply

Return to “Extension Writers Discussion”