PDA

View Full Version : vBulletin API question


pjclas
11-17-2012, 06:08 PM
So honestly, I have no idea if this has been asked... I've done a lot of searching and have not been able to find my answers so I apologize in advance if this has been answered before.

I've been trying to interact with vBulletin for my site and the only supported external API I've found is the DataManager. That works well for what it is, but it doesn't provide all the things I need.

For instance, I need a way to find out what child forums a category has. I realize I can do this using the $vbulletin->forumcache global, but for me that seems like bad programming. I would like to be able to call an API that will remain supported from version to version that returns children of some forum id. There are functions in the vBulletin API like fetch_child_forums, but this has major side effects. It adds each subsequent query to the forumcache variable and returns that. In other words, if you call this in a loop for multiple forums, you constantly get back the data from all the prior calls.

I thought vBulletin was designed with the potential to be highly integrated with an existing site, but it seems that it's very challenging to do this properly. I don't like having to know details about the format of the vb database and such... I recently converted from SMF, and they provided lots of APIs that made all this easy.

I have to assume I'm just missing something here, right? Any help would be appreciated. I'm making this all work with my site, but I'm not sure I'm doing it right...

kh99
11-17-2012, 06:26 PM
I thought vBulletin was designed with the potential to be highly integrated with an existing site, ...

Yeah, I'm not sure that's true, at least with vb3 or 4. I can't say that nothing like you want exists anywhere as a mod or external product, but the vbulletin code itself doesn't really have an api that was meant to do what you're talking about. There is documentation of an API here: https://members.vbulletin.com/api/, but as youve noticed it doesn't have an interface for everything. I think the data managers are (for some reason) meant only for writing, which is obviously nice since you don't have to understand everything that needs to be done, but when it comes to reading the information you want, it seems like you're on your own unless there happens to be an existing function.

pjclas
11-17-2012, 06:33 PM
Thanks for the response. This was the same conclusion I came to, I just figured I'd ask around to see if I was missing something.