Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2013, 06:03 PM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default make existing users display age by default

I want all my users to have their age displayed on the forum. So I've gone ahead and already removed "hide age and date of birth" as a privacy option by editing the modifyprofile_birthday template.

New users have to select 1 of the 3 remaining options that will display their age at registration. Great!

But now, all the previously registered users who had selected "hide age and DOB" at registration still have their ages hidden. How do I unhide all their ages and change their privacy setting to "display only age" (without editing each individual profile)? Is there any way to do this?

--------------- Added [DATE]1374088727[/DATE] at [TIME]1374088727[/TIME] ---------------

Nevermind, figured it out!

Go to Maintenance > Execute SQL Query

UPDATE user SET showbirthday=1

Everyone's age is now displayed on the forum.
Reply With Quote
  #2  
Old 09-11-2013, 04:46 AM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, so even though the "hide age" option is gone from the registration page... members are still having their ages go back into hiding. There ages will be displayed in their profiles and postbit and then it will randomly disappear (for just a few random members) and gone until I execute the SQL query to have everyone's ages show again.

What am I missing? How do I make everyone's ages show and stay that way? I don't know what is happening that people's accounts are being reset to hide their age.
Reply With Quote
  #3  
Old 09-11-2013, 05:12 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See if you cannot start narrowing down the problem a bit. Is it localized to certain user-groups maybe? Is the bit being reset in the database when this happens?

I am trying to decide if it is a permissions problem or a caching problem when you run the query?

In this kind of situation, I try to log the users actions in this section of the code, gathering data so I can narrow the problem down.

Sincerely, good luck and post if you find anymore clues -- so we can help.
Reply With Quote
  #4  
Old 09-11-2013, 05:20 AM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your reply!

It seems to be happening to all user groups. The users that are affected seem very random. It also doesn't seem to matter if they originally chose to display their age at registration or hide it. I've had members tell me that they were sure they chose to display their age when they registered. I don't know why their age would suddenly become hidden. It doesn't seem to be a cache problem.
Reply With Quote
  #5  
Old 12-30-2013, 03:18 PM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I am still having this problem. Ages disappear from postbits and profiles for random members across all usergroups. Even those that did not choose "hide age" at registration. I even tried removing the "hide age" option from the registration page but still this issue persists.

I have been regularly doing the manual sql query I mentioned in my first post which makes everyone's ages display temporarily. Since I cannot figure out the root of the disappearing age problem, I would like to somehow make this sql query a scheduled task so it happens automatically once per week.

Does anyone know how to schedule sql queries?
Reply With Quote
  #6  
Old 12-30-2013, 05:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...can't think why this would happen. Can you make it happen by editing something else in your profile?

As for scheduling a query, if you do it in php you can create a plugin using one of the cron_script_cleanup hooks (either daily or hourly, depending how often you want to run it). In case you're not in to php, the code for what you posted above would be:
PHP Code:
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."user SET showbirthday=1"); 

but I would suggest this instead:
PHP Code:
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."user SET showbirthday=1
   WHERE showbirthday = 0"
); 

that way if someone has chosen 2 or 3 it won't change back to 1.
Reply With Quote
  #7  
Old 12-30-2013, 05:47 PM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your help!

Do I just paste in the code in cleanup.php?

And how do I make it run daily, weekly, etc?
Reply With Quote
  #8  
Old 12-30-2013, 06:14 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could edit the file and paste it in, but I was thinking about creating a plugin. You go to Plugins & Products > Add New Plugin, paste that code in the big box, select the hook location (either cron_script_cleanup_daily or cron_script_cleanup_hourly), enter a title (something so that you'll remember what it is in the future), check "Yes" to make it active. The other fields you can leave as default. Then press "Save" when you're done.
Reply With Quote
Благодарность от:
michelle86
  #9  
Old 12-30-2013, 08:55 PM
michelle86 michelle86 is offline
 
Join Date: Jan 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!
Reply With Quote
  #10  
Old 12-30-2013, 10:48 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe members are hiding their age after they see it being showen after you run that query
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 02:26 PM.


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.04689 seconds
  • Memory Usage 2,254KB
  • 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
  • (2)bbcode_php
  • (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
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete