vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Conditional Statement Question (https://vborg.vbsupport.ru/showthread.php?t=217811)

TheInsaneManiac 07-04-2009 01:31 AM

Conditional Statement Question
 
if ($vbulletin->options['fireworks_enabled'] && $vbulletin->userinfo['$vbulletin->options[\'fireworks_field\']'])

How can I make that so my if my field = yes it displays the code and if it = no it doesn't.

Would this be correct?
if ($vbulletin->options['fireworks_enabled'] && $vbulletin->userinfo['$vbulletin->options[\'fireworks_field\']'] = Yes)

BTW $vbulletin->options[\'fireworks_field\'] is linked to my vbulletin profile field which is 142.

Dismounted 07-04-2009 05:43 AM

PHP Code:

if ($vbulletin->options['fireworks_enabled'] AND $vbulletin->userinfo["{$vbulletin->options[fireworks_field]}"] == 'Yes')
{
    
// some code here



TheInsaneManiac 07-04-2009 09:15 AM

Quote:

Originally Posted by Dismounted (Post 1842529)
PHP Code:

if ($vbulletin->options['fireworks_enabled'] AND $vbulletin->userinfo["{$vbulletin->options[fireworks_field]}"] == 'Yes')
{
    
// some code here



Thanks. :D

--------------- Added [DATE]1246769635[/DATE] at [TIME]1246769635[/TIME] ---------------

Hey what about this one? It's for a template, but Im having issues:
a href="$post[$vboptions[rapidsharethanks_field]]"

This will be in the postbit and fireworks field is in my options which I have as field81. I tried it that way but I get:
WHITESPACE, expecting T_STRING

Dismounted 07-05-2009 04:05 AM

Code:

$post[{$vboptions[rapidsharethanks_field]}]

TheInsaneManiac 07-05-2009 04:11 AM

Quote:

Originally Posted by Dismounted (Post 1843040)
Code:

$post[{$vboptions[rapidsharethanks_field]}]

Yea that was the first thing I tried, but again:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING

Dismounted 07-05-2009 05:36 AM

Sorry, put the curly braces in the wrong place. :p (Me being lazy and not really paying attention...)
Code:

{$post[$vboptions[rapidsharethanks_field]]}

TheInsaneManiac 07-05-2009 05:53 AM

Still errors out
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

Code:

"http://www.rapidshare.com/{$post[$vboptions[rapidsharethanks_field]]}"
Because it is a link should it look like this:
Code:

"'http://www.rapidshare.com/' . {$post[$vboptions[rapidsharethanks_field]]}"
Or something along those lines?

TheInsaneManiac 07-06-2009 07:03 AM

O it has nothing to do with the link because it will work if I just change it to:
http://www.rapidshare.com/$post[fieldw/e]

So how can I get it to work with $vboptions in it? I've tried everything except for the right away apparently.

I tried {$post[$vboptions[rapidsharethanks_field]]} like you said, but with no luck. :(

TheInsaneManiac 07-09-2009 09:14 AM

I still need help with this issue!

TheInsaneManiac 08-14-2009 12:14 AM

Someone!


All times are GMT. The time now is 11:05 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.02827 seconds
  • Memory Usage 1,734KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete