vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How? IF statement in footer (https://vborg.vbsupport.ru/showthread.php?t=231214)

smooth-c 12-26-2009 10:10 AM

How? IF statement in footer
 
I have a chatbar mod for my board and I want users to be able to disable it if they wish. I have set up a profile field for simply "Yes" or "No" options and i've used this code in my footer template;

Code:

<if condition="$bbuserinfo['field17']=='Yes' OR $bbuserinfo['field17']=='No'>
<!-- CometChat Footer Code Start -->
<link type="text/css" rel="stylesheet" media="all" href="/discussion/cometchat/cometchatcss.php" charset="utf-8" />
<script type="text/javascript" src="/discussion/cometchat/cometchatjs.php" charset="utf-8"></script>
<!-- CometChat Footer Code End -->
</if>

I get an error with vb in the admincp saying "Malformed IF statement" - any ideas? Thank you

Lynne 12-26-2009 06:12 PM

You didn't close your condition quotes:
HTML Code:

<if condition="$bbuserinfo['field17']=='Yes' OR $bbuserinfo['field17']=='No'">

smooth-c 12-26-2009 07:22 PM

I ended up using this code;

Code:

<if condition="$bbuserinfo['field17']=='Yes'">
But i've ran into a problem

By default, Yes is the option for my User Profile Field yet as soon as I applied the code, everyone complained that the chatbar had gone.

After playing around, I worked out the only way to get it to show again was to set my option to "No, don't show" in the usercp, save changes then click "Yes, Show" and save changes and it'd show again.

What's up with that? Wierd. Anyway I can get around this?

+ the bar no longer shows for guests :( is that just the downside of having a userprofile field setting?

I've also attached a screenshot of the userprofile field if needed- http://img707.imageshack.us/img707/5205/profilej.jpg

Thank you

Lynne 12-26-2009 08:25 PM

Did you set the profile field values and later change them? Have you looked to see what is in the database for this field? Another way to write the condition could be:
HTML Code:

<if condition="$bbuserinfo['field17']!='No'">


All times are GMT. The time now is 02:26 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.01071 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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