By Andy on Tuesday, 21 January 2020
Posted in Technical Issues
Likes 0
Views 531
Votes 0
With the Steps (Fitbit) App - can you tell me where in the database tables is the user's privacy choice held?

That's when on their step page, they can toggle a setting to make their steps public or private.

I want to do a SQL query to exclude those that have a private setting - but I can't see where that value gets stored.

Thanks!
Hey there,

For "Fitbit / Steps privacy", if you are referring to this setting in the screenshot https://take.ms/7EHxB, and you want to list down users with a SELECT query, then you can run the following SQL command to see if the user has Fitbit / Steps privacy enabled or not by given user id:

SELECT * FROM `jos_social_users` where `params` like '%"fitbit_access":1%' and `user_id` = 470;


fitbit_access:1 - privacy enabled
fitbit_access:0 - privacy disabled

Take note that if the users have not sign into FitBit before, you will not see 'fitbit_access' in the `params` column of the users.

Also, remember to change to your table prefix and to the user ID that you want before you run the SQL command.
·
Tuesday, 21 January 2020 18:05
·
0 Likes
·
0 Votes
·
0 Comments
·
They are stored as a JSON string in the column `social_params` in the table #__social_users. Do take note that this is a JSON string and you cannot run an update by query.

You need to write a php script to iterate through each record and update it.
·
Tuesday, 21 January 2020 09:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Just before I dive into JSON research, when you say I can't update it by query, can I still "query" it by query?

That's all I'm trying to do... so for a given User ID that I have - I want to run a SQL query to see if they have their Fitbit / Steps privacy on or not?
·
Tuesday, 21 January 2020 11:29
·
0 Likes
·
0 Votes
·
0 Comments
·
There is no way for you to run a single query that updates every record. You can still query for each user with php. The column that stores the json data would be very dynamic. Here's an example of the json string on that column,


{"socialgoals":{"updateavatar":{"value":true,"label":"COM_EASYSOCIAL_GOALS_UPDATE_AVATAR","description":"COM_EASYSOCIAL_GOALS_UPDATE_AVATAR_DESC","permalink":"\/profile\/edit"},"completeprofile":{"value":false,"label":"COM_EASYSOCIAL_GOALS_COMPLETE_PROFILE","description":"COM_EASYSOCIAL_GOALS_COMPLETE_PROFILE_DESC","permalink":"\/profile\/edit"},"poststatus":{"value":true,"label":"COM_EASYSOCIAL_GOALS_POST_STATUS","description":"COM_EASYSOCIAL_GOALS_POST_STATUS_DESC","permalink":"\/"},"addfriend":{"value":true,"label":"COM_EASYSOCIAL_GOALS_ADD_FRIEND","description":"COM_EASYSOCIAL_GOALS_ADD_FRIEND_DESC","permalink":"\/users"},"postcomment":{"value":true,"label":"COM_EASYSOCIAL_GOALS_POST_COMMENT","description":"COM_EASYSOCIAL_GOALS_POST_COMMENT_DESC","permalink":"\/"},"joincluster":{"value":true,"label":"COM_EASYSOCIAL_GOALS_JOIN_CLUSTER","description":"COM_EASYSOCIAL_GOALS_JOIN_CLUSTER_DESC","permalink":"\/groups"},"percentagecomplete":83,"initialized":true},"showwelcome":0}


Different user has different value for this column, so you need to write a php script to iterate through each record on the site.
·
Tuesday, 21 January 2020 17:43
·
0 Likes
·
0 Votes
·
0 Comments
·
THANK YOU - This is exactly what I needed.
·
Tuesday, 21 January 2020 21:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Andy, glad that your issue is resolved now.
·
Tuesday, 21 January 2020 21:30
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post