The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parentlist array
Hello,
I'm trying to construct a very basic plugin but i couldnt manage to use an array for parentlist field in new posts. Can you give me an example to do that? I want to write a conditional for forumid=15 and all its subforums without adding all subforum ids one by one using parentlist field. Thanks.. |
#2
|
|||
|
|||
You give very few details of what you want to do (such as hook location, etc), but if you're talking about the forum parentlist, then there is also a childlist that contains the ids of a forum's children.
|
#3
|
|||
|
|||
Currently i use this conditional in newpost complete.
Code:
if (in_array($foruminfo['forumid'], array(1,2,3..........etc))) |
#4
|
|||
|
|||
Try something like:
Code:
if (in_array($foruminfo['forumid'], split(',',$vbulletin->forumcache[$categoryid]['childlist']))) |
#5
|
|||
|
|||
I tried smth like that but didn't work. Probably i couldnt construct the conditional with a specific categoryid.
Code:
if ( $vbulletin->forumcache[$categoryid] == 48 AND in_array($foruminfo['forumid'], split(',',$vbulletin->forumcache[$categoryid]['childlist']))) Also i wonder if that conditional works if it's not a category but a regular forum with many subforums under it. |
#6
|
|||
|
|||
Sorry, that's my fault. There is no variable $categoryid, that was just an example. For instance if you want to check if the current forum is a child of forum 15, then you'd do this:
Code:
if (in_array($foruminfo['forumid'], split(',',$vbulletin->forumcache[15]['childlist']))) I should also mention that each forum is in its own childlist, so if you didn't want to include forum 15 in your condition then you'd have to check for that (although if 15 is a non-posting forum then it won't matter). |
#7
|
|||
|
|||
Thank you! That worked perfectly.
It's geat to have experts as you around here.. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|