Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2005, 03:46 PM
ultranerds ultranerds is offline
 
Join Date: Dec 2004
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Profile field in condition?

Hi,

I've added a new profile field for the forum users. It looks like;

Amazon.co.uk Search Box Single-Selection Menu Editable field14 [Edit] [Delete]

Its basically a yes/no select-box option, which is shown on the user profile page.

I'm basically trying to do something like;

<if condition="$bbuser['amazon_profile'] ne "No">
.. show amazon code
</if>

Is this possible?

TIA

Andy
Reply With Quote
  #2  
Old 04-26-2005, 04:46 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Certainly is, I use it a TON on the forumhome page as I have quite a few hacks in there so it lets people disable the ones they don't want to see

PHP Code:
<if condition="$bbuserinfo[field14] == 'No'">
your amazon code
</if> 
Notice the no IS case sensitive, so if you typed in for them to select from yes or no, you'll need to change the above to 'no'
Reply With Quote
  #3  
Old 04-27-2005, 08:31 AM
ultranerds ultranerds is offline
 
Join Date: Dec 2004
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Thanks for the reply

However, it doesn't seem to be working :'(

I have;

field: $bbuserinfo[field14] <br>

..which prints;

Quote:
field:
The code looks like;

<if condition="$bbuserinfo[field14] == 'Yes'">

... in "navbar".

Do I need to do anything special to load the user options?

Also, may be pushing my luck here <G>

Can anyone point me in the right direction, so I can do something like this with the nav bar;

<if condition=IS_TOP>
... show one type of code
</if>

<if condition=IS_BOTTOM>
... show another type of code
</if>

Basically, I want to try and put 2 different codes on each page. One for the top navbar, and the other for the bottom one.

TIA

Andy
Reply With Quote
  #4  
Old 04-27-2005, 11:14 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So what your trying to do is create a yes/no radio button that users select what kind of navbar they see?
Reply With Quote
  #5  
Old 04-27-2005, 11:38 AM
ultranerds ultranerds is offline
 
Join Date: Dec 2004
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Not really.

I need a Yes/No option for the users, in their profile (which I have), and then a condition to see if the user option has been set, and show accordingly. If no option is set.. then it show the amazon search code

To keep things simpler, I'll leave the other part until I've got this working <G>

Cheers
Reply With Quote
  #6  
Old 04-27-2005, 02:41 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a Single selection menu or Radio?

If it's a single selection, double check whether you have them selecting from

yes
no

or

Yes
No

The If statement IS case sensitive.

If it's a radio, you'll need to use 0 or 1 if I recall right.
Reply With Quote
  #7  
Old 04-27-2005, 02:45 PM
ultranerds ultranerds is offline
 
Join Date: Dec 2004
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Its definatly a Single-Select dropdown, with Yes/No as the values. Seems really weird that it doesn't seem to show up ... yet its obviously being set in their profile, as it gets selected ok when changed (i.e if they edit their profile).

Is there a way to "dump" a list of the values/names of the info held in $bbuserinfo? Maybe a "foreach () "? That may be an easier way, so I can at least see if the value exists there, or whether it needs to be created somehow =)

TIA

Just put this together;

<?php

foreach ($bbuserinfo as $field => $value) {
echo "$field => $value <br>";
}

?>

Theoretically, this should give me all the values held in $bbuserinfo. Does anyone know where abouts I would put this? I guess PHP code isn't directly allowed in the templates?

TIA
Reply With Quote
  #8  
Old 04-27-2005, 03:59 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On a hunch, try a 0 or a 1 instead of Yes or No
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 10:02 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.04570 seconds
  • Memory Usage 2,227KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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