Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] I want to set privacy setting on a specific field for all users

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
11 years 7 months ago - 11 years 7 months ago #222062 by fribse2011
I want to change the privacy field for all users on a specific field.
For the future registrations I'm going to use auto actions, but how do I do the current ones?
I've tried to build a sql query to do it, but I can't get the syntax right, can you guys help me out?
This is what I have so far:
Code:
insert into xxx_comprofiler_privacy (userid,type, xid, rule, params) select id.xxx_users 'field' as type '76' as xid '99' as rule '' as params FROM `xxx_users` WHERE 1

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, sĂĽ kom ned til os.
Last edit: 11 years 7 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 7 months ago #222077 by krileon
Below should work in CB Auto Actions using a Query action.
Code:
INSERT INTO `#__comprofiler_privacy` ( `userid`, `type`, `xid`, `rule` ) VALUES ( '[user_id]', 'field', '76', '99' )

I suggest the below however to become more familiar with SQL usage.

www.w3schools.com/sql/sql_intro.asp


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
11 years 7 months ago #222080 by fribse2011

krileon wrote: Below should work in CB Auto Actions using a Query action.

Code:
INSERT INTO `#__comprofiler_privacy` ( `userid`, `type`, `xid`, `rule` ) VALUES ( '[user_id]', 'field', '76', '99' )


Hi Kyle

That is what I have in the auto action already, except I use an update, and that works like a charm, that's not the problem for me.
The problem is that I need to create a privacy record for all users already on the site, and that was why I tried to build one that would get all the user id's from the users table and create a privacy entry for each of them.

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, sĂĽ kom ned til os.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 7 months ago #222082 by krileon
I see, run the below directly on phpmyadmin and it should do the trick.
Code:
INSERT INTO `jos_comprofiler_privacy` ( `userid`, `type`, `xid`, `rule` ) SELECT `id`, 'field', '76', '99' FROM `jos_users`

Replace jos_ prefix as needed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: fribse2011

Please Log in or Create an account to join the conversation.

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
11 years 7 months ago #222084 by fribse2011

krileon wrote: I see, run the below directly on phpmyadmin and it should do the trick.

Code:
INSERT INTO `jos_comprofiler_privacy` ( `userid`, `type`, `xid`, `rule` ) SELECT `id`, 'field', '76', '99' FROM `jos_users`

Replace jos_ prefix as needed.


Ah, excellent, worked like a charm

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, sĂĽ kom ned til os.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum