Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2009, 02:31 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-04-2009, 06:43 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Reply With Quote
  #3  
Old 07-04-2009, 10:15 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
PHP Code:
if ($vbulletin->options['fireworks_enabled'] AND $vbulletin->userinfo["{$vbulletin->options[fireworks_field]}"] == 'Yes')
{
    
// some code here

Thanks.

--------------- 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
Reply With Quote
  #4  
Old 07-05-2009, 05:05 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$post[{$vboptions[rapidsharethanks_field]}]
Reply With Quote
  #5  
Old 07-05-2009, 05:11 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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
Reply With Quote
  #6  
Old 07-05-2009, 06:36 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, put the curly braces in the wrong place. (Me being lazy and not really paying attention...)
Code:
{$post[$vboptions[rapidsharethanks_field]]}
Reply With Quote
  #7  
Old 07-05-2009, 06:53 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 07-06-2009, 08:03 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 07-09-2009, 10:14 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still need help with this issue!
Reply With Quote
  #10  
Old 08-14-2009, 01:14 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:49 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.04469 seconds
  • Memory Usage 2,263KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete