digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Website and Server Troubleshooting (https://www.digitalfaq.com/forum/web-tech/)
-   -   VBulletin, show code on newthread.php only for certain forums (https://www.digitalfaq.com/forum/web-tech/3170-vbulletin-show-code.html)

admin 06-06-2011 03:58 AM

vBulletin, show code on newthread.php only for certain forums
 
This is quick note for myself (and anybody else that may find it helpful).

When creating subforum-specific warnings, or only shows posticons to certain sub-forums (for example, as used in conjunction with posticon-enforcing plugins/products and code edits), simply use this IF statement in the vBulletin style sheet.

PHP Code:

<if condition="in_array($forumid, array(5))">
CODE TO BE DISPLAYED
</if> 

In this code example, the subforum with forumid "5" will be the only forum where, when making a new thread, that code will be displayed to a member. In any other forum (for example, subforums 1-4) the code between the IF statements will be missing.

This was used on a site where posticons are required in specific subforums. Rather than create many subforums, and requiring users to click deeper and deeper, similar-but-different content is being sorted with posticons. With this change, however, the newthread style was edited, to move the post icons above the title/message box, with a warning that you MUST select an icon. Only forums that required icons had permission to view those icons, as they were not intended to be used site-wide. (Advanced posticon permissions via plugin from vBulletin.org.) Only a single generic icon was available/used in any other subforum. Since the non-required subforums did not need such text, and it would only confuse members (since there was only one icon to "choose" from), it was hidden via this PHP vBulletin query.

Yes, that's a bit rambling -- but it's my notes. I'm allowed. :cool:

If you have questions on this specific hack/mod, simply reply.
If you need other/more vBulletin help, hosting help, web design help, etc -- post a new topic.

admin 06-07-2011 09:30 AM

To add more than one forum, this would be the code:

PHP Code:

<if condition="in_array($forumid, array(1,2,3,4,5))">
CODE TO BE DISPLAYED
</if> 

Where 1,2,3,4,5 were the five forum IDs (forumid).


All times are GMT -5. The time now is 08:29 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.