vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=231525

vB4 Template Conditionals List
by BBR-APBT
29 Dec 2009 05:01

I put this together because it seems lots of people are having problems with the new syntax for conditionals.

First off remember you can not use {vb:raw var} in template conditionals.

Show only members:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show only guest:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show specific user groups :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show one member:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show every one but one member:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show only moderators of any forum:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Show Moderator of one forum: Remember to change x

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show Moderator of current forum:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show in one forum: Remember to change x

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show is every forum but one: Remember to change x

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show in several forums:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show in only one file: Look for define('THIS_SCRIPT', 'calendar'); in the top of the php file you want it to show in.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show in every file but one: Look for define('THIS_SCRIPT', 'calendar'); in the top of the php file you do not want it to show in.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


If $customvar is set:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


If $customvar equals:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


If $customvar does not equal:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


vBulletin else statement:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


vBulletin else if statement:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


This is all that I can think of right now off the top of my head.
Please feel free to add any I forgot and I will add them to this list and give you credit.

nubian 29 Dec 2009 08:30

subscribed!

Antyrael 29 Dec 2009 15:34

Thanks for this list! :)

Asterix_ita 30 Dec 2009 09:26

Excuse me a question, to the undersigned not work conditions with $forum[forumid] is the variable that changed?

thanks


PS example

<vb:if condition="!in_array($forum[forumid], array(18,19))">

text text

</vb:if>

Hornstar 31 Dec 2009 06:31

very nice, this has helped me understand all the conditionals much better.

Hasanudin 31 Dec 2009 11:13

subscribe too..

nice, thx u

nymyth 31 Dec 2009 14:10

this is so clutch...nice

rbc 31 Dec 2009 20:37

super, thanks & happy new yeahr ;)

baghdad4ever 01 Jan 2010 08:38

thank you very much

ragtek 01 Jan 2010 10:23

Quote:

Originally Posted by Asterix_ita (Post 1942260)
Excuse me a question, to the undersigned not work conditions with $forum[forumid] is the variable that changed?

thanks


PS example

<vb:if condition="!in_array($forum[forumid], array(18,19))">

text text

</vb:if>

$forum[forumid] have to be registered to the template.
There's an other article here.

Asterix_ita 01 Jan 2010 10:37

Quote:

Originally Posted by ragtek (Post 1943831)
$forum[forumid] have to be registered to the template.
There's an other article here.

thanks, I must enter the new logic. Happy New Year

MikeWarner 02 Jan 2010 12:27

Hi - thanks for this post, however, can you provide conditionals for CMS sections please?

BBR-APBT 02 Jan 2010 16:19

Quote:

Originally Posted by MikeWarner (Post 1944821)
Hi - thanks for this post, however, can you provide conditionals for CMS sections please?

I don't have the CMS and most of these will work for the CMS.

You may have to preregister the var.

abumohamed 05 Jan 2010 19:44

Thanks

hochun 06 Jan 2010 00:14

Hello everybody! I have one problem with porting one of my products to VB4.

I have the setting for a product called vfsms_can_stick_by_sms - it's comma separated list of forum-sections where this product is turned on.

In this product I have the following plugin:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And in template SHOWTHREAD I have next conditional:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I have few problems:

1. variable $vfsms_allowed4sticky_forums can be accessed only as a {vb:raw vfsms_allowed4sticky_forums} and I can not put it to the condition
2. variable $forumid is not accessible anymore

Please, somebody, help me!

--------------- Added 06 Jan 2010 at 00:28 ---------------

but everything is ok if I pass variable directly from the showthread.php:



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and in template also replace $forumid on $thread[forumid]

This is absolutely wrong way of doing the thing I need, pls tell me how to do it without changes in showthread.php!

BBR-APBT 07 Jan 2010 23:12

well first off this is a thread for conditionals. Thats why your not getting much help with your whole script.

Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

SledgeHead 08 Jan 2010 06:03

How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.

BBR-APBT 08 Jan 2010 18:53

Quote:

Originally Posted by SledgeHead (Post 1950116)
How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.

Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

nice
by putuajun
08 Jan 2010 19:55

subscribed :)

SledgeHead 08 Jan 2010 21:11

Quote:

Originally Posted by BBR-APBT (Post 1950504)
Do you have a conditional specific question? If not please start a new thread and do not hijack this one.

I apologize. I was wondering for the conditional tags to use to accomplish this.

BBR-APBT 09 Jan 2010 03:15

Quote:

Originally Posted by SledgeHead (Post 1950619)
I apologize. I was wondering for the conditional tags to use to accomplish this.

You will need more then a conditional to accomplish this.

SledgeHead 09 Jan 2010 05:07

Right. From my understanding you make a custom profile field and then incorporate they field number into the conditional. No?

BBR-APBT 09 Jan 2010 05:19

you may have to also register variables depending where you want to put it.



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


abdicar 11 Jan 2010 19:30

I want to setup an alias for my forum, for the porn forum. So, how I can show that forum, ONLY if the people is accessing using the alias domain name?

In PHP It is easy, but i don't know how can be possible now in vB.

Adam H 14 Jan 2010 23:05

I could actually kiss you , great list was waiting for some one to get a list done like this.

BBR-APBT 15 Jan 2010 05:01

Quote:

Originally Posted by riverwire (Post 1955983)
I could actually kiss you , great list was waiting for some one to get a list done like this.

I at least hope your a female. ;)

TimberFloorAu 18 Jan 2010 23:23

Brilliant list mate :up:

Really helps, keep up the great work. Ste

RL714 23 Jan 2010 01:10

Useful for adding a advertisement or other information after the first post on every page.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


huuquynh 23 Jan 2010 18:08

I want to use condition with the custom field. For example, I use custom field number 6 for private information, and I want the member can view it but hide it for everyone.

Is there any example?

3DUInc 26 Jan 2010 02:49

Excellent thank you very much :)

RL714 26 Jan 2010 22:51

Quote:

Originally Posted by huuquynh (Post 1964520)
I want to use condition with the custom field. For example, I use custom field number 6 for private information, and I want the member can view it but hide it for everyone.

Is there any example?

you can use this line to show only register user
Quote:

<vb:if condition="$show['member']">Show this to members only</vb:if>

huuquynh 27 Jan 2010 18:11

Quote:

Originally Posted by RL714 (Post 1967429)
you can use this line to show only register user

sorry for my bad english. I mean the private information is showed for him only, the other members can not see it.

the condition you give is for every member... it can not be used in this case.

RL714 30 Jan 2010 00:50

Quote:

Originally Posted by huuquynh (Post 1968107)
sorry for my bad english. I mean the private information is showed for him only, the other members can not see it.

the condition you give is for every member... it can not be used in this case.

this the one you're looking for huuquynh, replace the user id

Quote:

<vb:if condition="$bbuserinfo['userid'] == 318713">Show this only to the member with the user id of 318713</vb:if>

huuquynh 30 Jan 2010 16:36

Hi RL714,

I think your code is right. But this is not simple likes that, because it is not for only a member or owner site. I mean the number 318713 is the dynamic number, it is exactly userid in custom field table. So if condition is: $bbuserinfo['userid'] is exactly his userid, so he can see the value. But if the other member can not see.

For example: you can see your custom field number 6, but I can not see it. And vice versa, I can see my custom field number 6, but you can not see mine.

sadiq6210 30 Jan 2010 20:17

Thanks :)

Veer 31 Jan 2010 00:56

Thank you for the article.

Please guide me in converting this to vb4:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and this one too please:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


egyptsons 02 Feb 2010 01:24

Thanks for your article

I want to add advertisement after the first post in some special forums
so I edit the "ad_showthread_firstpost" Template and add this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But nothing change in the special forums and the ads not appear

also if I used this

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it's appear in all forums not only the special (1,2,3)

Can you advice me plz ?

Best regards

fly 02 Feb 2010 22:29

Hoping someone can help...

I'm trying to convert this template conditional (in threadbit, I'm guessing it matters)...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Using the guide here, I know it should look like this, but it doesn't work:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Could it be that the $ignore variable isn't available in that template? I've seen mention of that in other articles here, I think.

isurua 03 Feb 2010 05:52

Anyone know a way of getting this to work?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

{vb:raw title} returns The Latest exactly as I would expect when put into the style but for some reason it may not be working inside a conditional statement. =\

fly 03 Feb 2010 11:21

Quote:

Originally Posted by isurua (Post 1973651)
Anyone know a way of getting this to work?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

{vb:raw title} returns The Latest exactly as I would expect when put into the style but for some reason it may not be working inside a conditional statement. =\

Quote:

Originally Posted by from first post
First off remember you can not use {vb:raw var} in template conditionals.

that

egyptsons 04 Feb 2010 02:44

this is not work too with me :(

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

anyone can advice ??

isurua 04 Feb 2010 04:20

Quote:

Originally Posted by flypaper (Post 1973788)
that

Yes well aren't I the ignorant one? Hahah

Do you know if there is any work around?

btotw 06 Feb 2010 22:59

I have an idea.

I want to give someone control of their own thread. I figure that a good way to do that would be to duplicate the supermoderator group, calling it "threadModerator", then only display the "show admintools" dropdown IF the current user is both a threadAdmin AND is author of the current thread.

In other words, if the threadmoderator group is "100," How can I then say

If currently_logged_in_user is threadmoderator and
If currently_logged_in_user = thread_starter then
show admintools

I figure its something close to:

<vb:if condition="is_member_of($bbuserinfo, 100)">
<vb:if condition="is_author_of($thread)">
show admintools
</vb:if>
</vb:if>

It has to be something close to this...though I dont know how to query the system to find out the author of a thread...nor do I know how to reference the "show admintools" function...but I figure I've reasoned this out and given enough effort that one of you...who are MUCH better programmers than I...is willing to help me (and anyone that wants to use the code, giving myself and the person who cleans this up the credit).

How bout it people? Can someone help with this...?

mabersoft 09 Feb 2010 22:24

What would the code be to only show on forumhome?

matthieugoua 10 Feb 2010 15:58

Quote:

Originally Posted by egyptsons (Post 1974321)
this is not work too with me :(

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

anyone can advice ??

not work for me

Adam H 11 Feb 2010 22:25

Can any one tell me what i would have to use to get a sign to come up only when a thread is closed ?

So basically if a thread is closed i want a certain peace of HTML to show up

TheSupportForum 19 Feb 2010 10:16

i need some help with the variables below to work with certian group and also an option not to show to certian groups can anyone help

so far i have this




Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

i need to where to add the section to not allow certain groups
i hope i got the code in the correct order so far

i wanna add {vb:raw vboptions.wmf_grp_noperm}

but not sure where to put it and if i need to add anything else to my exist code after the one i want inserted

AzzidReign 21 Feb 2010 17:16

lol Wish I would have saw this before. Oh well, I figured it out :P Thanks for this though!

smartkidbk5 25 Feb 2010 05:41

Quote:

Originally Posted by egyptsons (Post 1972657)
Thanks for your article

I want to add advertisement after the first post in some special forums
so I edit the "ad_showthread_firstpost" Template and add this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But nothing change in the special forums and the ads not appear

also if I used this

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it's appear in all forums not only the special (1,2,3)

Can you advice me plz ?

Best regards

Same with me. Anyone know the correct conditionals?

Alp Ozdemir 25 Feb 2010 13:52

Try this;


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


princeedward 04 Mar 2010 10:24

:erm: errrmmm... hi

how about showing something here to a thread starter but not to his first post....is there any conditional on this please?

appreciate any help

thanks and best regards...

:p

hatchet 07 Mar 2010 00:47

Is there anything that I can pull the date of the last post of a thread?
$thread['lastpostdate'] or something like that. I'm trying to see if the last post date is older than 90 days and if so - output a custom phrase.
Thanks.

boatdesign 11 Mar 2010 07:54

I'm trying to use a conditional to color code certain forums in the What's New and Search Results.

In search_threadbit I've tried the following, with no success (only the else shows for threads in these forums too.)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I thought that since forumid is actually in the link, it would be a piece of cake, but it's a no go as above. I must be missing something obvious.

I read here about assigning a variable to a template, so tried creating a new plugin to do so, but can't seem to make that work either. One question is that the template is labeled search_threadbit but that's not a choice in the add plugin screen for a hook location - only search_results_threabit which doesn't seem to exist as a template. So I'm a bit lost there.

Any guidance? Many thanks.
(new to VB4 today)

DesignWerks 11 Mar 2010 12:50

Quote:

Originally Posted by M4tEUSh (Post 1993295)
So how to properly construct a condition with {vb:raw var}?

Bumping this question. I have my conditional working but it would be more efficient if I could use it with a plugin for an external php page which updates several areas of my site at once so <vb:if condition="!is_member_of($bbuserinfo, 12)">{vb:raw includemyexternalpage}</vb:if> hides the section from usergroup 12.

Is it possible to put the condition in the plugin?

boatdesign 12 Mar 2010 05:59

Quote:

Originally Posted by boatdesign (Post 2001366)
I'm trying to use a conditional to color code certain forums in the What's New and Search Results.

In search_threadbit I've tried the following, with no success (only the else shows for threads in these forums too.)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I thought that since forumid is actually in the link, it would be a piece of cake, but it's a no go as above. I must be missing something obvious.

I read here about assigning a variable to a template, so tried creating a new plugin to do so, but can't seem to make that work either. One question is that the template is labeled search_threadbit but that's not a choice in the add plugin screen for a hook location - only search_results_threabit which doesn't seem to exist as a template. So I'm a bit lost there.

Any guidance? Many thanks.
(new to VB4 today)

Sorry - I got lost and couldn't see the forest for the trees. Thanks to Lynne for pointing out that for the search_threadbit template $thread[forumid] not $foruminfo[forumid] was the ticket.

kingMOB 13 Mar 2010 23:22

Is there an "at least this" conditional?

I have this conditional to list just the blogs from a specific category:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It works well, but only if the blog entry is marked with only this category (6). If I choose one more category to the blog, let's say 5 and 6, this conditional no longer works.

Any help? =)

nack 16 Mar 2010 00:12

Hi, how would you direct guests to login with <if condition>?

MrToasty 16 Mar 2010 12:10

I have a custom template being called at the template hook in the postbit called postbit_userinfo_right_after_posts which works fine with static text from the template outside of conditionals, however when I try to use text in a conditional or pull a field such as {vb:var post.fieldX}, nothing happens...

I am able to call conditionals in the postbit template without any problems, just not in the custom template.

The conditional and field I'm trying to use is:-


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas?

cmiller1014 19 Mar 2010 05:03

What about a conditional to have an ad appear after every 2 posts? used to be easy in vb 3.8, not now! :( :(

meonet 19 Mar 2010 08:44

Hello,

I would like to show different size ads for memvers and guests, someone can help me to see if this code it's correct?

Quote:

<vb:if condition="in_array($bbuserinfo['usergroupid'], array(usergroupshere))">
advert here
</vb:if>
Thanks

princeedward 19 Mar 2010 14:02

is there any conditional list to show something only if the said member is offline?
it means the below code belong to the user...so i want to hide it when they are online...
it can only be seen once that they are offline...is that possible guys?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

appreciate any possible help on this guys...

thanks and best regards...

:o

princeedward 21 Mar 2010 12:40

Quote:

Originally Posted by princeedward (Post 2006433)
is there any conditional list to show something only if the said member is offline?
it means the below code belong to the user...so i want to hide it when they are online...
it can only be seen once that they are offline...is that possible guys?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

appreciate any possible help on this guys...

thanks and best regards...

:o

any cofirmation at least for the thread starter or some more experienced coder out there please...or any respectable staff?

hmmm...:rolleyes:

princeedward 24 Mar 2010 20:29

Bump!-Bump!-Bump!

:mad:

TalkVirginia 24 Mar 2010 21:02

It seems simple enough.. I wish I could help. Unfortunately I'm not familar in that area. Hopefully my response will help in attracting attention to your question. ;)

princeedward 26 Mar 2010 06:36

TalkVirginia...thanks a lot but i guess and notice that most of well experienced coder are not quite there anymore or interested of replying to any message who needs help regarding code like this or product...we have still some around but not paying or giving attention to post message like this...but if you post it to paid forum...they are quite fast and your pm box is full in a minute or 2....:p well thats my own opinion only...well i am not like that or tryin not to be like that...as long as i can...i am willing always to share my knowledge...or anything that i know...without any single cents...thanks is quite enough...

anyway hope someone who is more experienced coder someday will go reply here and share his knowledge...i might share him too some cents...;)

best regards to all

:p

TalkVirginia 26 Mar 2010 10:33

I think most want us to do as much research on our own, provide our analysis and findings before they offer any input. Granted, this is important to do but sometimes we need a knudge in the right direction... sometimes. :) Off the top of my head I would say you might be able to find something already existing in postbit and/or postbit_legacy where it shows the online status icon. I'll have to go back and re-read the thread I guess in case that's not what you are looking for.

--------------- Added 26 Mar 2010 at 10:39 ---------------

Quote:

Originally Posted by M4tEUSh (Post 1993295)
So how to properly construct a condition with {vb:raw var}?

for example, if {vb:raw var} is smaller than 6, show XYZ

I don't know if anyone has answered this or if you have already figured it out but you would need to handle this logic in your php code then render the variable accordingly.

Mutt 18 Apr 2010 17:23

I'd like to add that you can use AND & OR for example


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Olivier Turbis 25 Apr 2010 22:58

What about show to users having one post? Please? Thank you in advance! :)

zipperty 02 May 2010 12:24

Crystal clear - Subscribed.... thank you

Blackhat 03 May 2010 01:23

I'm trying this in the css files stored among the templates. Anyone care to tell me whats wrong ? :)

Quote:

html {
<vb:if condition="$post['field26']">
background-image:url($post[field26]);
<vb:else />
background:{vb:stylevar doc_background};
</vb:if>
}

Flyte 04 May 2010 00:02

is there a way to get this to work in a CMS article? or maybe with bbcode?

TimberFloorAu 17 May 2010 22:55

Can we set conditional to ONLY show if user has filled in Profile Field ? Otherwise it is blank

spillage 31 May 2010 14:37

I've been working with some of the code provided here to show Adsense ads to non members only.

I found that using <vb:if condition... gave an error when trying to save the code.
Missing if statment relative to the </vb:if>

The following worked

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


merk_aus 13 Jun 2010 05:15

Wow thanks for this greatly appreciated; I have dedicated this entire day to me to fix up all the little things on my site such as all of the template edits, permissions and most importantly all of the conditionals and so this thread and the time taken to create it is greatly appreciated.

malmazan 16 Jun 2010 18:18

Quote:

Originally Posted by BBR-APBT (Post 1941139)
Show in several forums:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I all templates i edit the above did not work.

What did work was:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Though your conditional may work in some other templates.

merk_aus 18 Jun 2010 02:53

Can someone tell me if this is right to put in our footer to not have something show on the CMS and to not show it to guests:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I just want someone to tell me if it is correct, if not what is correct.

Lizard King 19 Jun 2010 16:02

The correct this_script for CMS is


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Trek 22 Jun 2010 04:31

****UPDATE***

Ok, finally figured it out, had to pass in usergroups in the $show variable from the plugin.

So in the plugin:

$show[gm_ugs] = explode(',', trim($vbulletin->options['gm_user_groups_allowed']));

and in the template, the condition is:

<vb:if condition="is_member_of($bbuserinfo, $show[gm_ugs])">

I'm sure that's obvious to most of you, but... just incase someone else has the same question, hopefully that helps.


--------------------------

How do you check multiple usergroups in a template?

Such as:

<vb:if condition="is_member_of($bbuserinfo, $usergroups)">

where $usergroups = "6,15,10"

Specifically:

<vb:if condition="is_member_of($bbuserinfo, array($vboptions['gm_user_groups_allowed']))">

Is what I am trying, but it only seems to work if $vboptions['gm_user_groups_allowed'] is not an array and is a single value.

Webmist 23 Jun 2010 05:26

Quote:

Originally Posted by SledgeHead (Post 1950116)
How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.



I have profile field 8 with radio single selection as the type. It's set with options of yes and no. It seems to be working.



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


noppid 23 Jun 2010 06:28

Quote:

Originally Posted by Webmist (Post 2057874)
I have profile field 8 with radio single selection as the type. It's set with options of yes and no. It seems to be working.



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This would use many many less clock cycles and allocate less memory.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And watch how you spell 'yes' when you create your custom fields, case matters.

ICannt.org 28 Jun 2010 08:40

Quote:

Originally Posted by BBR-APBT (Post 1941139)
Show is every forum but one: Remember to change x

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Show in several forums:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Hello all,

How would I be able to make a mix of this? ie: Show in all forums except for 40, 41, and 42?

Cheers

egyptsons 28 Jun 2010 13:19

Quote:

Originally Posted by ICannt.org (Post 2060895)
Hello all,

How would I be able to make a mix of this? ie: Show in all forums except for 40, 41, and 42?

Cheers

I want to know how to do that too
coz the old conditional not work also the new one

BirdOPrey5 30 Jun 2010 04:30

I am curious if there is a conditional that I can use in the threadbit or forumhome template that will let me display X if a certain forum is being displayed...
$forum[forumid] doesn't work in the threadbit template, it has no value at all... is there an alternative way? Basically I want to only display something if forumdisplay.php?f=2 is the page I'm on.

kether1 12 Jul 2010 22:07

subscribe.
K

RobbieZ 14 Jul 2010 11:36

Show Moderator of one forum: Remember to change x

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This condition does not work. Shows in all forums and not just 'x' !!!

ubcforums 15 Jul 2010 20:12

Hi guys..I have a donators group,
how can I show something only in the postbit of donators group list ?

Thanks :)

BirdOPrey5 15 Jul 2010 20:45

Quote:

Originally Posted by ubcforums (Post 2069616)
Hi guys..I have a donators group,
how can I show something only in the postbit of donators group list ?

Thanks :)

Edit the postbit (or postbit_legacy) and add


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change "9" to your paid usergroup id... if more than one then separate by comma: 9, 10, 11

ubcforums 17 Jul 2010 13:40

Quote:

Originally Posted by BirdOPrey5 (Post 2069640)
Edit the postbit (or postbit_legacy) and add


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change "9" to your paid usergroup id... if more than one then separate by comma: 9, 10, 11

does, this show the defined text only to members or group 9 ??
..i want to show the text in the postbit of the every member of group 9, visible to other groups..

Thanks

BirdOPrey5 17 Jul 2010 17:16

That would show whatever you put above the </vb:if> only to users in usergroup id 9... If you want to display it to everyone you wouldn't use the IF statement at all. I don't think I fully understand the question.

ubcforums 17 Jul 2010 19:47

if the member belongs to a group,,a text should appear in the post bit of that member..
which will be visible to every one..

Thanks :)

fitnesshealth 27 Jul 2010 01:49

I have a piece of code added to the end of footer template but I want this piece of code to be visible only when i'm reading a thread (any thread).

May I ask if there's any conditional for this?

BirdOPrey5 27 Jul 2010 03:05

Quote:

Originally Posted by fitnesshealth (Post 2075012)
I have a piece of code added to the end of footer template but I want this piece of code to be visible only when i'm reading a thread (any thread).

May I ask if there's any conditional for this?

try this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


fitnesshealth 27 Jul 2010 08:41

Thanks, works great!

encryption 31 Jul 2010 22:11

I would really benefit from a similar list of conditionals from php code, rather than conditionals. I can do nearly anything I want in a template thanks to this list, but trying to determine if a user is a member of a usergroup via php code is still foreign to me. Does anybody know of a list of these, or is anybody willing to translate this list to a php counterpart list? :)

ICannt.org 07 Aug 2010 08:40

Quote:

Originally Posted by ICannt.org (Post 2060895)
Hello all,

How would I be able to make a mix of this? ie: Show in all forums except for 40, 41, and 42?

Cheers

Any idea on this?
Cheers

adom7 07 Aug 2010 12:54

Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?

Lynne 07 Aug 2010 16:24

Quote:

Originally Posted by ICannt.org (Post 2080415)
Any idea on this?
Cheers


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Quote:

Originally Posted by adom7 (Post 2080470)
Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?

I think you are going to require more than a condition. You'll have to write plugin that takes TIMENOW (the current time in unix time) and converts it to the users time (don't forget that there are timezones to consider here) and then use the result there in your condition. You can look in the API here - http://members.vbulletin.com/api/ - for vbdate and that should help.

adom7 07 Aug 2010 19:09

Quote:

Originally Posted by Lynne (Post 2080525)

Quote:

Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?
I think you are going to require more than a condition. You'll have to write plugin that takes TIMENOW (the current time in unix time) and converts it to the users time (don't forget that there are timezones to consider here) and then use the result there in your condition. You can look in the API here - http://members.vbulletin.com/api/ - for vbdate and that should help.

Thank you, Lynne
But I can't do that by myself. I hope someone handle it :erm:
I would like to use it for adsense.

Come2Daddy 11 Aug 2010 19:47

Beautiful :)

XLCR GODFATHER 13 Aug 2010 22:02

Please Help.
I am unable to duplicate results in other Templates

I have been able to set linked images to show in the postbit_legacy template for custom profile fields with no problem using


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I tried

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But this shows the user who is viewing the informations link (if set) as apposed to the member who's profile they are viewing

So what I am asking is, is there an alternative conditional for?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or is there something I am missing else where?

Thank you in advance for any help....


All times are GMT. The time now is 01:26.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.