vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   vBulletin Template Conditionals (https://vborg.vbsupport.ru/showthread.php?t=215032)

genxstan 05-17-2011 09:00 AM

Can somebody tell me how to hide code tags with something else for unregistered users using if conditional statement?

BirdOPrey5 05-17-2011 10:16 AM

You need to edit your bbcode templates, such as the template: bbcode_code

Put the entire template in a template conditional- something like:

Code:

<if condition="$show[member]">

original template code here

<else />
You must be logged in to view this code.
</if>

Do this for all the code templates you want (CODE, PHP, HTML) and their associated "print" templates as well otherwise people can see them if they go to print the page.

genxstan 05-18-2011 05:15 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2196728)
You need to edit your bbcode templates, such as the template: bbcode_code

Put the entire template in a template conditional- something like:

Code:

<if condition="$show[member]">

original template code here

<else />
You must be logged in to view this code.
</if>


Do this for all the code templates you want (CODE, PHP, HTML) and their associated "print" templates as well otherwise people can see them if they go to print the page.

Thanks for the help mate :)

Curious Too 09-03-2011 04:19 PM

I have an ad that I want to show to one particular social group. This is the code I tried but it didn't work:

if condition="$groups[groupid] == X
if condition="$group[groupid] == X
if condition="$grps[groupid] == X

Are there any conditionals for social groups?

BirdOPrey5 09-03-2011 07:02 PM

Quote:

Originally Posted by Curious Too (Post 2241581)
I have an ad that I want to show to one particular social group. This is the code I tried but it didn't work:

if condition="$groups[groupid] == X
if condition="$group[groupid] == X
if condition="$grps[groupid] == X

Are there any conditionals for social groups?

$group[groupid] is what is used throughout the groups.php script. If that isn't working it probably isn't available in the template you are trying to use it on- where are you trying these conditionals?

The only other possibility would be to try
Code:

$vbulletin->GPC[groupid]
so
Code:

<if condition="$vbulletin->GPC[groupid] == x">

Curious Too 09-03-2011 07:14 PM

I'm trying to use it in the ad location template ad_navbar_below. This didn't work either:

<if condition="$vbulletin->GPC[groupid] == x">

BirdOPrey5 09-03-2011 09:11 PM

Yeah I looked through the code, this just isn't going to be possible with a template conditional. For who knows what reason the people who programmed social groups did not make them behave like forums and threads which would have been logical.

Curious Too 09-03-2011 10:25 PM

Thank you for trying to help.

|Jordan| 01-13-2012 06:41 AM

I'm trying to make a conditional that will display in all forums except 8 forums,

Quote:

<if condition="$show['newthreadlink'] && $forum['forumid'] != 6,7,8,9,22,23,24,25">
Is this syntax right?

HMBeaty 01-13-2012 07:13 AM

Quote:

Originally Posted by |Jordan| (Post 2287188)
I'm trying to make a conditional that will display in all forums except 8 forums,



Is this syntax right?

Close. It should be....
HTML Code:

<if condition="$show['newthreadlink'] && !in_array($forum['forumid'], array(6,7,8,9,22,23,24,25))">


All times are GMT. The time now is 11:36 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.01320 seconds
  • Memory Usage 1,738KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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