The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Fetching childforums ID?
Guys can you give me a hand?
I'm trying to fetch Childforums IDs from forumids array but stuck with fetch_child_forums. Thx! |
#2
|
|||
|
|||
What problem are you having? It looks like fetch_child_forums returns a comma separated string by default, although you can pass 'ARRAY' as the secon parameter to get an array of ids instead. It uses $allforumcache, so I suppose it's possible that that's not set where you're trying to call it.
|
#3
|
||||
|
||||
Hi,
I want use it in Manage ADs as condition something like: in_array($GLOBALS[forumid], array($foruminfo['childlist']) But cant figure it out. |
#4
|
|||
|
|||
What condition are you trying to check for? It looks like what you have is checking if the current forum is in it's own child list.
|
#5
|
||||
|
||||
I want to use Google Ads in some forums and included sub-forums.
For example: - main forum (forumid 1) -- childforum (forumid 2) -- childforum (forumid 3) -- childforum (forumid 4) -- etc... So I saw that in childlist field is written also the parent forum too (1,2,3,4,5,...etc) and I thought I can use it. |
#6
|
|||
|
|||
Well, there is also a parentlist, so I think what you'd want to do is check the parentlist for forumid 1 (if 1 is the actual parent forum id). But the problem is that parentlist is a comma separated list, so in_array() won't work. You could call explode() to make an array, but you can't use explode() in a template condition. So I can't think of any way except to have a plugin to help out. For example, you might make a plugin like this:
Code:
$show['forum_google_ads'] = in_array(1, explode(',', $foruminfo['parentlist'])); Code:
<vb:if condition="$show[forum_google_ads]"> ... </vb:if> |
Благодарность от: | ||
masterross |
#7
|
||||
|
||||
Thx mate!
This was really easy. I lost whole my day Thx again! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|