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)

BirdOPrey5 05-26-2011 03:44 PM

In the showthread template there is this code:

Code:

<vb:if condition="$show['closethread']"><span>+</span> {vb:rawphrase reply_to_thread}<vb:else />{vb:rawphrase closed_thread}</vb:if>
So
Code:

<vb:if condition="$show['closethread']">
is the condition but if it's TRUE the thread is OPEN, if it's FALSE the thread is closed... at least that is what it looks like to me.

TundraSoul 05-26-2011 07:05 PM

This conditional is being placed in a forum block, but doesn't work correctly. I only wish to display the code to members who are logged in. Not guests.

Here's what I have:

Code:

<vb:if condition="$show['member']">

sadly, everyone sees this even those who are not logged in.

</vb:if>

What's the correct way of writing this?

Thanks!

Hasanudin 05-26-2011 07:14 PM

@BirdOPrey5
thx, but its not work to me.. :(
* my code at postbit_legacy


@tundrasoul
may be this..?

Code:

<vb:if condition="$show['guest']">
<vb:else />
Show this to all not guest users

</vb:if>


TundraSoul 05-26-2011 07:27 PM

Quote:

Originally Posted by Hasanudin (Post 2200318)

Code:

<vb:if condition="$show['guest']">
<vb:else />
Show this to all not guest users

</vb:if>


No, that didn't work either. The code still display to everyone.

Hasanudin 05-26-2011 07:36 PM

or this.. ?

Code:

<vb:if condition="!is_member_of($bbuserinfo, 1)">Show this to user group not guest</vb:if>
usergroup 1 = guest

TundraSoul 05-26-2011 07:47 PM

Quote:

Originally Posted by Hasanudin (Post 2200326)
or this.. ?

Code:

<vb:if condition="!is_member_of($bbuserinfo, 1)">Show this to user group not guest</vb:if>
usergroup 1 = guest

It makes no sense, it should be but it doesn't. vB 4.13.

The code still displays to everyone including guests.

Hasanudin 05-26-2011 09:04 PM

@tundra
this is worked for me :
Code:

<vb:if condition="$bbuserinfo['usergroupid'] == 1">
showing just for guest..
<vb:else />
showing other guest
</vb:if>


TundraSoul 05-26-2011 09:22 PM

Quote:

Originally Posted by Hasanudin (Post 2200354)
@tundra
this is worked for me :
Code:

<vb:if condition="$bbuserinfo['usergroupid'] == 1">
showing just for guest..
<vb:else />
showing other guest
</vb:if>



Did you try it in the forum block code?

It doesn't work there for me, using vB 4.13.

BirdOPrey5 05-27-2011 03:40 PM

Quote:

Originally Posted by Hasanudin (Post 2200318)
@BirdOPrey5
thx, but its not work to me.. :(
* my code at postbit_legacy


@tundrasoul
may be this..?

Code:

<vb:if condition="$show['guest']">
<vb:else />
Show this to all not guest users

</vb:if>


Both you guys are probably having the same issue, the variable isn't used in your template by default so you must register it there. There's another article here on how to register variables for use in templates: https://vborg.vbsupport.ru/showthread.php?t=228078

For example the closedthread check is only done in showthread, not postbit, so you have to pre-register it for postbit.

baghdad4ever 06-08-2011 01:38 PM

hi

how to display Google ads to the guest and in home page only?


All times are GMT. The time now is 01:07 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.01372 seconds
  • Memory Usage 1,742KB
  • 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
  • (10)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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