vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Hiding content in the CMS with certain conditions. (https://vborg.vbsupport.ru/showthread.php?t=279243)

deverill2010 02-27-2012 09:09 PM

Hiding content in the CMS with certain conditions.
 
I have a custom form in a static page in the CMS, as well as some text.

In total I will have 3 forms but two of them I don't want to be seen by unregistered users and registered users must have 5 posts or more to be able to see the form. As the form is in a static page is there any code I can wrap around the form to do what I want?

I don't really want to have to go down the route of faffing about creating a new usergroup and promotions and stuff, plus I don't want to block the whole page just the specific form bit so they can't submit untill they are registered with 5 posts or more!

I know I need to us vb conditionals but what? As I have no idea what they are.

kh99 02-28-2012 04:12 PM

I don't think you can use template vb:if tags in a static html page. But instead of putting html in the big text area you can leave it blank and just change the template name to a template you want to use (see this article: https://vborg.vbsupport.ru/showthread.php?t=236245).

deverill2010 02-28-2012 04:33 PM

I've sorted it thanks :) Using a vb condition.

kh99 02-28-2012 04:51 PM

Did you put a condition right in an html static page? I thought I tried that and it didn't work.

deverill2010 02-28-2012 04:58 PM

Na I made a copy of the template it calls and renamed it, and put this around {vb:raw $pagetext}

Code:

<vb:if condition="$show['member'] AND $bbuserinfo['posts'] >= 5">
{vb:raw $pagetext}
<vb:else />
<b>Sorry you must be logged in and have at least 5 posts to view this form.</b>
</vb:if>



All times are GMT. The time now is 01:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00927 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete