Age in code field

4 years 10 months ago #312405 by Huutsch
Age in code field was created by Huutsch
Hi,

I've added a field to the user profile where a code field displays the age in years.

For this field I can release the privicy properties, but they are not displayed during registration or editing the profile.
I guess because a code field is read-only.
So a user can only leave his date of birth open, but then no one can see his age.

Even worse, however, I find that I can not share the search for this field.

I suspect that I am not the only one with the desire to show the age over the privacy settings to certain users and others not.
Likewise with the desire to be able to search for the user lists also for an age range.
Is there any other way I can make a user's age useful for privacy settings and searching?

Please Log in to join the conversation.

4 years 10 months ago #312408 by krileon
Replied by krileon on topic Age in code field
Why are you displaying age in a code field? The date field themselves have a display option for displaying as age. Code fields can not be searched. They're generated content that isn't stored. Date fields can be searched. As for privacy controls simply use CB Privacy and enable privacy controls for your date field.

Is there any other way I can make a user's age useful for privacy settings and searching?

Yes, use a Date field.


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 to join the conversation.

4 years 10 months ago #312412 by Huutsch
Replied by Huutsch on topic Age in code field
Thanks,

Why I displaying age in a code field?
Because I found only this method in your documentation (www.joomlapolis.com/documentation/18534-calculating-years-months-days-from-birthday-field-using-cb-code-field)
And if I could have searched for it in the user lists, that would have been enough for me.
For the privacy setting, I could use the birth date setting.

In this context, I feel the behavior of the user lists as faulty.
If I limit the age in the user list, no profile should be displayed in the result, where for me the age may not be displayed.
The privacy settings can be bypassed with clever restrictions in the user lists, only by the fact that a profile appears in the result or not.

Another question:
Do you have a similarly simple solution for calculating and searching for distances between users?

Please Log in to join the conversation.

4 years 10 months ago #312415 by krileon
Replied by krileon on topic Age in code field
CB Privacy can not be bypassed. If you search a users field whom you don't have permission to see they will be removed from the search results. CB Moderators and the users own self are of course exempt from privacy controls.

That tutorial is just a usecase example for CB Code Field. For Date fields simply edit it and under Parameters > Display set "Profile View Display" and "Userlist Search Display" to "Age". You will not be able to search a Code field as it has no storage.

Do you have a similarly simple solution for calculating and searching for distances between users?

No, we don't have radius searching at this time.


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 to join the conversation.

4 years 10 months ago #312607 by Huutsch
Replied by Huutsch on topic Age in code field

CB Privacy can not be bypassed. If you search a users field whom you don't have permission to see they will be removed from the search results. CB Moderators and the users own self are of course exempt from privacy controls.


I've done some tests and it's true, except for looking for age.
I have set the date of birth to private and searched for it with another user.
My test user was shown in the result list.

The search for age is also not intuitive at the point.
If I have a user who displays in his profile as age 30 and I look for it with the filter: age is from 30 to 30, then I get an empty result.
Except the user has exactly today his 30th birthday.
Mathematically, this behavior is correct, but I do not believe that many people think so in the context of age.

Please Log in to join the conversation.

4 years 10 months ago #312611 by krileon
Replied by krileon on topic Age in code field

I've done some tests and it's true, except for looking for age.
I have set the date of birth to private and searched for it with another user.
My test user was shown in the result list.

Will take a look to see if a bug could be prevent this from working correctly.

forge.joomlapolis.com/issues/7570

The search for age is also not intuitive at the point.
If I have a user who displays in his profile as age 30 and I look for it with the filter: age is from 30 to 30, then I get an empty result.
Except the user has exactly today his 30th birthday.
Mathematically, this behavior is correct, but I do not believe that many people think so in the context of age.

Selecting min and max of 30 should work fine. Have added a bug ticket to take a look. The query may not be using >= and <= as it should.

forge.joomlapolis.com/issues/7569


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.226 seconds