Log in

View Full Version : Accessing the $forum array


AlexOnFire
03-31-2010, 11:24 AM
Hi guys,

I'm new to vbulletin but have found it fantastic so far. I'm currently modding my forumhome template so that next to each category (ie. a forum set to no posts) it has the number of subforums inside (rather than a threadcount).

When I call $forum[subforums] however it returns nothing. Am I using it incorrectly and if so can anyone tell me where I can read more about the $forum array? I've searched for a while to no avail...

Thanks in advance!

Marco van Herwaarden
04-01-2010, 07:47 AM
The easiest way is to create a small plugin that dumps the contents of the array. The contents may change depending on the page that is loading it.

AlexOnFire
04-01-2010, 10:41 PM
Thanks for your reply Marco, much appreciated.

I've realised that I had to set my subforums depth setting to 1 in order for $forum[subforums] to contain anything. Now that I can see that, I just need to be able to retrieve an integer for the 'count' of subforums rather than the insertable 'summary' of them.

<?php var_dump($forum) ?> isn't giving me any sort of result in the forumbit_level2_nopost template - is there another way I should be using it?

edit: Just realised I can't run php from inside templates, looking more into plugins now.

--------------- Added 1270165709 at 1270165709 ---------------

This seems to be getting too complicated, fast - all I want to do is get the number of subforums in a category on forumbit_level2_nopost, just like I can do for threadcount or replycount - surely this variable exists already and I don't have to create a plugin with hooks in a template (while not knowing which template I should be hooking) ?