Quote:
|
This is driving me up the f*cking wall. Can someone help me?
I've created a custom forum block template that I want to use for advertisements only. Basically, I want the advertisements to display to everyone EXCEPT for our subscribers. I've tried variations of code but either the advertisements appear to all usergroups or to none. Code:
<vb if condition="is_member_of($bbuserinfo, 1,2,3,4,5,6,7,8,15,16,17)"> I can't seem to add an ELSE statement of any kind because all I get is an "Invalid Nesting" error. |
I think the problem might be caching. Try setting "Cache Time" to 0 and see if that works.
You should be able to use <vb:else /> to have an else section (but it needs the closing slash). ETA: also, your first line is missing a colon. It should start with <vb:if condition=.... |
What should I add after <vb:else />? :)
|
Quote:
Code:
<vb:if condition="is_member_of($bbuserinfo, 1, 2, 3)"> Do you have it working at all yet? |
I've got it how I described in the original post, except now with the colon. All groups can see the advert.
I'm trying to get it so that subscribers (11) don't see the advert, or the forum block for that matter. |
So how did you create it exactly? Did you choose "Custom HTML/PHP" block? And how did you fill in the rest of the form?
|
I copied the original block_html template and then made a new one named "adblock_html" with the same coding. I then added the conditionals (see above) and adjusted the settings for my Amazon advert block to use the "adblock_html" template.
|
That sounds good. Did you set the cache time to 0?
As Scanu posted in the other thread, something like this should work and it's a little shorter: Code:
<vb:if condition="!is_member_of($bbuserinfo, 11)"> |
What the...
I swear I did that yesterday. xD Ah well, that seems to have done the trick! Thank you very much mate! Gosh, all this stuff isn't very noob friendly haha. |
What's the conditional to check if a user is a member of a particular social group?
|
Quote:
|
Hmm... Which templates can it work on?
|
Something like this.
Code:
<vb:if condition="$group[groupid] == 106 OR $group[groupid] == 28"> |
Quote:
|
Are you making it in a sidebar template? It's not going to work in static HTML.
|
Quote:
|
Quote:
Then you wrap it in the conditional like this: Code:
<vb:if condition="is_member_of($bbuserinfo, x,x,x)"> And you are good to go! Make sure you replace the red "x" with the usergroups you which to only show it to. |
Appreciate the help CheechDogg! I believe it worked for me :)
|
Good stuff Game glad it worked buddy...
|
If you want to show something to somebody with less than 10 posts, what's the conditional for that?
|
Quote:
Code:
<vb:if condition="$vbulletin->userinfo['posts'] < 10"> |
Code:
<vb:if condition="!is_member_of($bbuserinfo, 11)"><strong><bold><font color="#FF6600"> Supporter</font color></bold> does that code look right? |
Quote:
Code:
<vb:if condition="!is_member_of($bbuserinfo, 11)"><span style="color:#FF6600;font-weight:bold;"> Supporter</span></vb:if> |
This works and should replace the non-working code given in the first post. Thank you Alp Ozdemir!
Quote:
|
hello! I want to show in some groups (1,2,3,4,5,6) postbit banner but don't know how to do it as this conditions are only to show TO groups but not FROM groups :( please help!
|
Quote:
Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3,4)">Content here</vb:if> |
$bbuserinfo['userid']
or $vbulletin->userinfo['userid'] not work in vb4 :( |
Please post your whole conditional statement and associated references.
What template? What line number in that template? What version of vBulletin? There is no way we can determine anything from the data you have given us. :( |
Quote:
tbworld, here is example: http://www.rcgroups.com/forums/showt...16#post7877841 this is vb3 forum but... I want in postbit_legacy template for some groups add banner and change background as it's done in above forum So my code should look like: <div id="postbit_legacy_left"> avatar... info... <vb:if condition="IF USER WHO POST THIS FROM GROUPS: IDs OF PREMIUM GROUPS (1,2,3)">HERE COMES BANNER CODE</vb:if> </div> is it more clear now? Thanks ;) |
Quote:
|
u didn't get my question... what condition for vb4 to make some stuff showed only when post created by some usergroups members?
In postbit template: HTML Code:
{vb:raw post.usertitle} |
if used in the postbit templates, then:
<vb:if condition="is_member_of($post,6,7)"> stuff </vb:if> |
Need a vBulletin 5 version on page manager
|
Where would I find the ''THIS_SCRIPT'' names for files? Is there any easy way? I'm trying to find some mod additions.
|
You should look in php files of vB installation.
For example, take a look in index.php, you'll find there (in the beginning) this: PHP Code:
|
Quote:
|
If it isn't in the file, then you can't use that condition; you would need to use another condition. Your best bet is to ask in the modification thread if there is a condition you may use.
|
This thread is from 2010 and no one has updated the original post to reflect that $forum['forumid'] should actually read $foruminfo['forumid']. The list is technically inaccurate for noobs since the first variable doesn't work. It's been 4 years; could someone update it please? I sent a user over to fetch the conditional and he was telling me it wouldn't work. guess what, he was right!
|
This conditional doesn't work anymore. Suggestions to fix it?
Show is every forum but one: Remember to change x Code: Code:
<vb:if condition="$forum[forumid] != x">Show this if forum id is not x</vb:if> |
All times are GMT. The time now is 07:35 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|