discuss.answer
-
- 1,154 Posts
You are already way above my technical level, so I might be totally off base, but here is my suggestion:
Create the 'blocker' extended field in the register snippet and fix it to 1, (default blocked), you perhaps do not need to let the user do anything yet. Nor do I think you need any posthook here, maybe I am wrong.
Then, tell your users they can make their profile public when they wish, and then add in the option to the updateregister snippet to change the setting.
Then in your other site codes, every time you want to get a list of public users, you can sort by the blocker field. And I guess when a user tries to read a profile, you would check the value of blocker field to know whether to show the contents, or even show the link to the profile at all.
HTH
PS I realized if your site is big it may slow things down a bit (the extended field data is in a JSON file which is a bit slower to read through the data), so you could consider to repurpose one of the default profile values, like fax number. Otherwise its the same, set it to default blocked on registration (maybe the user doesn't even see the value at registration), allow the user to change it, then sort by that field when you only want public users.
[ed. note: nuan88 last edited this post 8 years ago.]
-
- 97 Posts
Dear HTH,
you're totally right, I was totally wrong. Since I'm also pretty new to xPDO I got a little bit mixed up.