The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Display a forum block only to certain usergroups
I'm having a hard time doing this.
I've used an HTML content type with this, and no luck: Code:
<vb:if condition="is_member_of($bbuserinfo, 1, 2, 3, 4, 15, 17)"> text </vb:if> Code:
<vb:if condition="!is_member_of($bbuserinfo, 16)"> text </vb:if> |
#2
|
|||
|
|||
You can't use <vb:if... in html, only in a template. You could put your html in a template, make your widget PHP Direct Execution and use:
PHP Code:
or you could use this code without making a template PHP Code:
|
#3
|
|||
|
|||
Quote:
Thanks! |
#4
|
|||
|
|||
Oops...yeah, I'm not sure what problem you're having exactly, but I just realized that it won't work like that because of the caching. I'm not sure if there's a way to write a PHP type block that doesn't cache. I'll look in to it...
--------------- Added [DATE]1313869007[/DATE] at [TIME]1313869007[/TIME] --------------- OK - should have thought of this before, sorry. Anyway, go back to using a static html widget. Copy the contents of the template vbcms_widget_static_page and create a new widget with the same contents but surround it with the 'if' tags, like Code:
<vb:if condition="!is_member_of($bbuserinfo, 16)"> <div class="cms_widget"> <div class="block"> <div class="cms_widget_header"> <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3> </div> <div class="cms_widget_content_restore_widget_content"> {vb:raw static_html} </div> </div> </div> </vb:if> Save it with some new name, then configure your widget and put that template in as the template name and your html in the html box. |
#5
|
|||
|
|||
Would it be possible to have a Latest Threads forum block where a usergroup was shown latest threads for some forums and another usergroup was shown latest threads for other forums?
|
#6
|
|||
|
|||
You would need code of some sort to make that work. I just reread this thread and realized that the original post asked about forum blocks and I was thinking widgets for some reason, so pjkcards, if you read this, sorry about that.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|