Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2005, 09:52 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make a simple 'option'

Hey all.

Say I make a really simply template change that I want to be optional.

( the case in question, I want users to be able to choose to have the forum catergory icons on or off )

Currently I've done this in a rather messy way, having one skin set with the forum catergory icons, each skin set with a child skin with the mod to remove those icons.

Now surely I should be able to stick a yes/no choice in somewhere, say on the user optionsm say in the visible post elements section of the usercp:

/forum/profile.php?do=editoptions
Quote:
You have the option to show or hide various elements of messages, which may be of use to users on slow internet connections, or who want to remove extraneous clutter from posts.
Show Signatures
Show Avatars
Show Images (including attached images and images in [IMG] code)
Show forum catergory icons
How can I make a choice there effect my code? I know it's simple but I'm still new at this kind of coding...
Reply With Quote
  #2  
Old 03-18-2005, 04:53 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In your template, use a conditional:
HTML Code:
<if condition="$bbuserinfo['fieldn']">
    <!-- code if "Show forum category icons" is checked -->
</if>
Change the "n" in "fieldn" to match the ID of the new field. Also note your typo for category in case you made it for the actual field as well.
Reply With Quote
  #3  
Old 03-19-2005, 08:58 AM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ ^
okay, that makes sense, thanks.

But how do I then add the necessary line of code to allow user selection of that choice?
Reply With Quote
  #4  
Old 03-19-2005, 09:28 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It does it automaticly when adding a new field
Reply With Quote
  #5  
Old 03-19-2005, 11:57 AM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I'm still not following. I do understand you stick the if statement around the code in question.

Where do the options for user selection then become avalible?
Reply With Quote
  #6  
Old 03-23-2005, 06:13 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for bumping this up, but this seems such an easy thing to do... yet I'm lost
Reply With Quote
  #7  
Old 03-25-2005, 05:23 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Really sorry for bumping my thread yet again, but I wrapped a conditional around my statement and did -not- find an option suddenly appear? What on earth am I doing wrong?
Reply With Quote
  #8  
Old 03-25-2005, 05:47 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You must add a profile field (via the admin cp) so the user can have the option to select. That's the fieldn that filburt referred to.
Reply With Quote
  #9  
Old 03-25-2005, 11:04 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oooh, I will give it a go...
Reply With Quote
  #10  
Old 07-09-2005, 12:03 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this valid code then?

Code:
<if condition="$bbuserinfo['field15']">
    <!-- code if "Show forum category icons" is checked -->
</if>

<if condition!="$bbuserinfo['field15']">
    <!-- code if "Show forum category icons" isn't checked -->
</if>
:/

Cause I'm getting a parse error
Reply With Quote
Reply

Thread Tools
Display Modes

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:54 PM.


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.04292 seconds
  • Memory Usage 2,248KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete