vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

tareqbd 03-01-2013 04:16 PM

I want to use day conditional. Please advise how to use it.
PHP Code:

<vb:if condition="($day == 'Friday')">
Today is Friday.
<
vb:else />
It's not Friday
</vb:if> 


Lynne 03-01-2013 04:55 PM

Quote:

Originally Posted by tareqbd (Post 2407209)
I want to use day conditional. Please advise how to use it.
PHP Code:

<vb:if condition="($day == 'Friday')">
Today is Friday.
<
vb:else />
It's not Friday
</vb:if> 


I don't think it will be a simple template condition. You will need a plugin first to get the day and then you may assign it to a variable to use in your template.

tareqbd 03-01-2013 05:24 PM

Quote:

Originally Posted by Lynne (Post 2407217)
I don't think it will be a simple template condition. You will need a plugin first to get the day and then you may assign it to a variable to use in your template.

Thank you. I will try as per your advise.

How can I get registration on/of condition.
Is it like <vb:if condition="$vboptions== 1"> ?
I want to use registration on/off condition. Please help.

Lynne 03-01-2013 05:46 PM

that would be the variable $vboptions['bbactive']

tareqbd 03-01-2013 05:50 PM

Quote:

Originally Posted by Lynne (Post 2407234)
that would be the variable $vboptions['bbactive']

But it's regarding registration active/inactive. Is it the same please?
Is it like <vb:if condition="$vboptions>registration['active']">

Lynne 03-01-2013 08:20 PM

Quote:

Originally Posted by tareqbd (Post 2407235)
But it's regarding registration active/inactive. Is it the same please?
Is it like <vb:if condition="$vboptions>registration['active']">

I thought that was what you were asking about. That is the option that determines whether registration is turned on or off, or active or inactive.
Quote:

Originally Posted by tareqbd (Post 2407224)
Thank you. I will try as per your advise.

How can I get registration on/of condition.
Is it like <vb:if condition="$vboptions== 1"> ?
I want to use registration on/off condition. Please help.


Hilary 04-06-2013 07:48 PM

Hello Lynne and everyone,

The smiliebox is causing havoc for me, so there are a couple of pages where I'd like it not to appear. I've worked out how to make it disappear for one of them, but I don't know how to make this happen for both.

Editing the template editor_ckeditor, every time it says 'if smiliebox' I add an extra condition:
<vb:if condition="$smiliebox" AND condition="THIS_SCRIPT != 'profile'">
That fixes it for the edit signature box. Smiliebox gone, editor full width.

But how can I make it so that the condition applies if there is a smiliebox and if I'm not on either the profile page or the showwiki page?

Huge thanks for any help.

~~~~~

Update:

I was using 'AND' because an earlier post on this thread said it was possible. Well... at least for me, it didn't work. I tried it both with and without the 'condition=' following. The result's always the same: only the final condition before the > is applied, none of the others. The example I gave above did indeed remove the smiliebox from the profile, but it had removed the first condition (which meant the smiliebox was appearing in all other editors eg quickreply). Didn't notice that until later...

The only way I found to apply three conditions was to create three nested 'ifs'. Not pretty, but it works.

Thanks to BBR-APBT for the original post!

GameOverViper 05-03-2013 09:46 PM

I'm wanting to hide some coding for my advertisements for a specific usergroup. How do I do this?

I originally used the show for usergroup code, but apparently that's no longer working right.

Hilary 05-04-2013 10:46 AM

What happens with
Code:

<vb:if condition!="is_member_of($bbuserinfo, 1)">ad code here</vb:if>
? (Where '1' is the number of the usergroup you don't want to see the ads, of course.) Not that I've tried this, but I have the positive version (showing certain links only to a given usergroup) and that's working fine in vB 4.

Lynne 05-04-2013 06:35 PM

Quote:

Originally Posted by Hilary (Post 2419883)
What happens with
Code:

<vb:if condition!="is_member_of($bbuserinfo, 1)">ad code here</vb:if>
? (Where '1' is the number of the usergroup you don't want to see the ads, of course.) Not that I've tried this, but I have the positive version (showing certain links only to a given usergroup) and that's working fine in vB 4.

It would actually be like this:

PHP Code:

 <vb:if condition="!is_member_of($bbuserinfo, 1)">ad code here</vb:if> 



All times are GMT. The time now is 05:52 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
  • Page Generation 0.04188 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete