![]() |
Show code in theme based on profile option?
I'm trying to make something on my siite disabled based on a profile option? I hard coded the item into the theme.
Also, is there a way to do this via which usergroup they are in? |
I'm not sure what you mean by "hardcoded". If you're using templates, you should be able to put the code for the stuff you want disabled in an "if" tag, like:
Code:
<vb:if condition="$bbuserinfo[fieldX] == 'something'"> or to do it by usergroup Code:
<vb:if condition="!is_member_of($bbuserinfo, X)"> Of course you need to change the X's and 'something' to the appropriate values. |
Thanks. It works perfectly.
On a variation on the second code you gave, is there a way to add that to the postbit template to show a special image or title if the user is in this usergroup? |
Quote:
Yes, just edit the postbit or postbit_legacy template and add something like: Code:
<vb:if condition="is_member_of($bbuserinfo, X)"> By the way, you can include more than one usergroup if you want, by listing the ids, like: Code:
<vb:if condition="is_member_of($bbuserinfo, 5, 6, 7)"> |
Quote:
Basically what i've done is set up a supporter system. Those that donate have the ads disabled (Which is thanks to the second code block in the first post) now i want to add a badge to that users posts to aknowdge they are a supporter. The subscription system adds them to group 12. |
Oh right, that would be the viewer. I should have realized if you wanted it in the postbit you probably wanted the poster. In that case just replace $bbuserinfo with $post.
Code:
<vb:if condition="is_member_of($post, X)"> |
Thanks! Works great.
|
All times are GMT. The time now is 01:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|