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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2010, 02:16 AM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Switches

Hello, can anyone provide information on how to allow someone to adjust settings such as I want to allow uses to be able to go into the usercp and allow them to turn on and off the shout box. How can i do this, i want individual users to be able to set it.
Reply With Quote
  #2  
Old 01-05-2010, 02:39 AM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You setup a profile field to reflect yes/no response/drop down. Then surround your shoutbox code with this:

HTML Code:
<if condition="field[X] == 0">
// Shoutbox code here
</if>
X is the field id from the new profile field you just added. I also assume you are familiar with vBulletin. If you need more direct instructions just let me know.

The == 0 means if they have it set to NO then it will show, otherwise it won't. I can't remember if it should be:

HTML Code:
$field['X'] OR $field[X]
Reply With Quote
  #3  
Old 01-05-2010, 11:51 PM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea more instructions would be nice, also, will this remember the change on the users account or on the computer, because i want there change to allow them to log into any computer as long as its on there users account it will remember the decision, Im more of a html/css guy, which is why i like making custom themes.
Reply With Quote
  #4  
Old 01-06-2010, 04:44 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes if they save the option no matter what computer they login from it will stay whatever they choose until they change it.

Ok follow these instructions:

Go to AdminCP > User Profile Fields > Add New User Profile Field > Single-Selection Menu (from drop down) > click Continue

Now on the next page:
1. Title - Give it an explanatory title in only a few characters such as: Turn On/Off Shoutbox
2. Description - Give a small description to explain what the option is for.
3. Leave "Profile Field Category" alone
4. Options: Enter the follow
Code:
Yes
No
5. Set Default: This I would leave as is.
6. Display Order: Leave this option alone
7. Field Required: Select whether the field is required to be changed when the person registers, updates their profile, etc. Or just leave as No
8. Field Editable by User: Leave this option alone
9. Private Field: Choose whether others can see if they have turned off shoutbox or not
10. Field Searchable on Member List: Set to 'No'
11. Show on Members List: set to 'No'
12. Option Input: Leave this entire area alone
13. Last box, choose what UserCP page to place the field on, probably leave as-is.

Click save and your done with that one part. Remember to take note of the Profile Field ID.

Now I'm not sure what shoutbox you have installed so all I can say is try to find where the code is for $shoutbox and then put this around it:
HTML Code:
<if condition="$field[X] == '0'">
$shoutbox
</if>
Let me know if you need further assistance such as locating the shoutbox code.
Reply With Quote
  #5  
Old 01-06-2010, 06:19 PM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhh thank you very much i will try this when i get home
Reply With Quote
  #6  
Old 01-06-2010, 07:14 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NP, let me know how it goes.
Reply With Quote
  #7  
Old 01-06-2010, 10:48 PM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still havn't gotten it to work. I followed the instructions carefully and nada. Checked each option twice, and entered the folowing code.

HTML Code:
<if condition="$field[15] == '0'">

<!--{%SHOUTBOX%}-->

</if>
Reply With Quote
  #8  
Old 01-06-2010, 10:56 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this then:
HTML Code:
<if condition="$field['15'] == '0'">
$shoutbox
</if>
This line means its commented out so make sure you have the right info.
HTML Code:
<!--{%SHOUTBOX%}-->
Reply With Quote
  #9  
Old 01-06-2010, 11:18 PM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<!--{%SHOUTBOX%}-->

yea i know thats how its supposed to be, thats how inferno shout asks it to be displayed, it works without the /if statement but as soon as i put that around it it messes up. I know html/css like the back of my hand, php makes me dizzy xD anything entered within that if statement does not get displayed. I did check the usercp options and it does say "Yes"
Reply With Quote
  #10  
Old 01-06-2010, 11:20 PM
mandingo's Avatar
mandingo mandingo is offline
 
Join Date: Jun 2008
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Steve M View Post
Try this then:
HTML Code:
<if condition="$field['15'] == '0'">
$shoutbox
</if>
This line means its commented out so make sure you have the right info.
HTML Code:
<!--{%SHOUTBOX%}-->
Just popping in,would this work for vb4?
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:24 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.08134 seconds
  • Memory Usage 2,253KB
  • 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_code
  • (8)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_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