vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   make existing users display age by default (https://vborg.vbsupport.ru/showthread.php?t=300214)

michelle86 07-17-2013 05:03 PM

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.

michelle86 09-11-2013 03:46 AM

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.

tbworld 09-11-2013 04:12 AM

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.

michelle86 09-11-2013 04:20 AM

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.

michelle86 12-30-2013 02:18 PM

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?

kh99 12-30-2013 04:17 PM

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.

michelle86 12-30-2013 04:47 PM

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?

kh99 12-30-2013 05:14 PM

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.

michelle86 12-30-2013 07:55 PM

Thank you!

ForceHSS 12-30-2013 09:48 PM

Maybe members are hiding their age after they see it being showen after you run that query

michelle86 12-30-2013 10:45 PM

Quote:

Originally Posted by ForceHSS (Post 2471422)
Maybe members are hiding their age after they see it being showen after you run that query

No, members on my forum can't change this setting, only I can. And besides, I only find out that ages go missing because the members it happens to message me and ask for me to make it display again.

ForceHSS 12-30-2013 11:18 PM

Quote:

Originally Posted by michelle86 (Post 2471425)
No, members on my forum can't change this setting, only I can. And besides, I only find out that ages go missing because the members it happens to message me and ask for me to make it display again.

Did you stop them from doing that with a plugin?

michelle86 12-30-2013 11:35 PM

I have agelock installed on my forum. It makes it so members can't edit their birth dates or change their DOB privacy setting.

ozzy47 12-30-2013 11:45 PM

I have no clue why it would be doing that, but why not just write a cron job to run daily, to update the DB if any users DOB is hidden?

michelle86 12-30-2013 11:54 PM

Quote:

Originally Posted by ozzy47 (Post 2471443)
I have no clue why it would be doing that, but why not just write a cron job to run daily, to update the DB if any users DOB is hidden?

Yeah, I have not been able to figure out why the ages keep disappearing for random members. As far as the updating, I already created a plugin to do this as suggested by kh99 above.

ozzy47 12-30-2013 11:56 PM

Ahh ok good, then I would not worry to much about it, that will do it for you. :)


All times are GMT. The time now is 07:51 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.04237 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete