vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   IF Conditions (https://vborg.vbsupport.ru/showthread.php?t=231707)

utahraves 12-30-2009 07:38 PM

IF Conditions
 
I've tried using a IF Condition in my version 4 to block something out to unregistered users.
I use:
Code:

<vb:if condition="$post['usergroupid'] != 1">
BLOCKEDOUTINFOHERE
</vb:if>

Can not get this for the life of me to work... :( I was looking for a vb4 updated list of if conditions

Should I be using...
Code:

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

<vb:else />
BLOCKEDOUTINFOHERE
</vb:if>

I'm at a complete loss of what to do here... I seem to be blanking out what should be done. Thanks in advance for any help.

Lynne 12-30-2009 08:06 PM

The conditions for vb4 are the same as for vb3 except that you put "vb:" before the line... so <vb:if and </vb:if and <vb:else etc. The actual condition itself though should be the same.

You also didn't tell us what template you are modifying. That is usually essential information when helping out.

utahraves 12-30-2009 08:09 PM

I'm editing the footer. I have a java script thing that runs at the bottom of the window but I don't want it displaying for unregistered people.

Thanks for that - I will look up a list of the conditions so I can try and figure out what my deal is...

Lynne 12-30-2009 08:14 PM

The $post variable is not available in the footer. Not only that, but $post['usergroupid'] is the usergroupid of the person making the post, so it makes no sense to use it in the footer. You want $bbuserinfo and yes, you should use is_member_of.

utahraves 12-30-2009 08:21 PM

Thanks!

For people that use this thread in the future, I used:

Code:

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



All times are GMT. The time now is 03:27 AM.

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.00996 seconds
  • Memory Usage 1,715KB
  • 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
  • (3)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