The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using conditionals and vb code on VB4 CMS pages
Hi there. Just posted this on .com, but after searching, I'm not sure if I should post it here instead... it's a bit confusing knowing where to post what... but here goes
I have some code on a page that I want to display only to certain usergroups and I also want to include their username if they are allowed to see it. How would I write this, and do I have to use a PHP or Static HTML content type in order to do it? This is what I can gather I should do... is it correct?... Code:
<vb:if condition="is_member_of($bbuserinfo, 5,6,7)"> <div> <p>Hello {vb:raw bbuserinfo.username},</p> <p>Stuff for admins is displayed here</p> </div> <vb:else /> <p>I'm sorry. You are not authorized to view this page.</p> </vb:if> Thanks for any help in advance! |
#2
|
||||
|
||||
An html content page (static page?) may only contain straight html. Conditions are not real html. If you want a page that interacts with your users, then you would need a PHP Direct Eval page. And, you should do the condition via the permissions area of the CMS (admincp > vbulletin cms > permissions) and only allow certain usergroups to see that section.
|
#3
|
|||
|
|||
I tried putting the username code in a php content type and that didn't parse. How would I go about doing this?
|
#4
|
||||
|
||||
Without seeing your exact code, I can't tell you what you did wrong. Can you please post it?
|
#5
|
|||
|
|||
The code is what I posted originally. I used in in both a static HTML page, and a php page. Neither parsed.
I have managed to make my page now using the misc.php?do=page&page=MyPage with custom_MyPage as a custom template |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|