Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 01-03-2013, 10:35 PM
licensinglinks licensinglinks is offline
 
Join Date: Sep 2011
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default New user profile field ("yes/no" radio buttons). How to make everyone a "yes"?

I have created 3 new user profile field. They are simple yes/no radio buttons.

Can anyone please explain how I can force all members to become "yes"?
Reply With Quote
  #2  
Old 01-03-2013, 11:15 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could do this db query:
Code:
UPDATE userfield SET fieldX='yes'

Where X is the actual number of the field you want to set.

Obviously this is a bit dangerous since it can't be undone - make sure you get the field id right, and that the part in quotes is one of your choices (capitalize it if necessary).
Reply With Quote
  #3  
Old 01-04-2013, 01:11 PM
licensinglinks licensinglinks is offline
 
Join Date: Sep 2011
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Seems to work OK but, when I look at my own UCP settings the "yes/no" radio buttons are both blank. Is that normal?
Reply With Quote
  #4  
Old 01-04-2013, 03:23 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should show what you have selected. You created a "single selection radio button" field and entered "Yes" and "No" for the choices, right? You have to make sure that the text in the query exactly matches one of the choices (or maybe I'm wrong about how you created your field?).
Reply With Quote
  #5  
Old 01-04-2013, 04:45 PM
licensinglinks licensinglinks is offline
 
Join Date: Sep 2011
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
It should show what you have selected. You created a "single selection radio button" field and entered "Yes" and "No" for the choices, right? You have to make sure that the text in the query exactly matches one of the choices (or maybe I'm wrong about how you created your field?).
What I mean is that the database change has worked perfectly. I have made everyone "yes". If I go into ACP > users > search for users and search for people who are "yes" then everyone comes up in the list.

However, if you then click on one of the users you see this:



Therefore the database is basically correct, but the radio buttons graphically are blank. It is the same situation in UCP > settings > general settings. The radio buttons are blank.

Not a big problem for me, but it would be nice if there was a solution, or at the very least could you just confirm that is expected and is not a problem.
Reply With Quote
  #6  
Old 01-04-2013, 04:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"yes" is not the same as "Yes". You need to do the query to set it to exactly what you want - Yes or yes.
Reply With Quote
  #7  
Old 01-04-2013, 04:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, that's what I thought you meant. And I think when you view your profile it should reflect what the database says. But when you mentioned the database you said "yes", and what I see for the choice in the picture is "Yes". Maybe you just did that when writing the post, but I was saying you should make sure the capitalization matches your choices (so maybe you have to run the query again with 'Yes' instead of 'yes'?).
Reply With Quote
  #8  
Old 01-04-2013, 05:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If he's already run the query, then what he would actually need to run now is something like:
Code:
UPDATE userfield SET fieldX='Yes' where fieldX='yes'
As always, you should never run a query on a live site without first doing a backup!!!
Reply With Quote
  #9  
Old 01-04-2013, 05:04 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I missed that you sneaked one in there, I was replying to his post. And you're right Lynne, good point. But the result would be the same either way unless someone has selected 'No' in the mean time.
Reply With Quote
  #10  
Old 01-04-2013, 08:04 PM
licensinglinks licensinglinks is offline
 
Join Date: Sep 2011
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
If he's already run the query, then what he would actually need to run now is something like:
Code:
UPDATE userfield SET fieldX='Yes' where fieldX='yes'
As always, you should never run a query on a live site without first doing a backup!!!
This worked perfectly thanks! Yes I got the case wrong when I ran the query.

Thanks all for the help with this.
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 04:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05093 seconds
  • Memory Usage 2,244KB
  • 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
  • (3)bbcode_code
  • (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