Hi,
I use the following code to add some banners to certain forums in the header template:
before I start to add more than hundred subforums to this list, I`d love to know if it is possible to also base the condition on the parent ID or even parentlist.
Example:
My forum structure is:
The parent ID of forum number 6 would be 4. So a conditional based on parent ID 4 would result in 5 and 6. But if I wanted all sub-forums of forum/category number 3 (top level) in the result, I`d have to ask if the ID 3 is contained in the field parentlist.
With SQL I`d this:
But how to do this with conditionals? Is this possible?
btw.: the above mentioned SQL statement is a very good way to receive all sub-forum IDs of a given category or parent forum recursively if you need them for the classic array with list-of-IDs conditional.
thank you - all the best,
Sacha
I use the following code to add some banners to certain forums in the header template:
Code:
<vb:elseif condition="in_array($GLOBALS['forumid'], array('3' , '391'))" />
Example:
My forum structure is:
Code:
3 4 5 6 7 8 9 10
With SQL I`d this:
Code:
SELECT forumid FROM `forum` WHERE ( LOCATE(',3,', CONCAT(',',parentlist,','))>0 OR LOCATE(',3,', CONCAT(',',parentlist,','))>0 );
btw.: the above mentioned SQL statement is a very good way to receive all sub-forum IDs of a given category or parent forum recursively if you need them for the classic array with list-of-IDs conditional.
thank you - all the best,
Sacha
Comment