Support

  1. devdan
  2. Support
  3. Sunday, July 20 2014, 03:43 AM
Hello,

Ok I have tried a few ways to achieve this but not finding a solid solution,

I want to be able to display age "30 years old" in person profile preferable using date field but having issues because I have to do so many exceptions to achieve what I'm after..

I need it to NOT be able to allow registration for 13 years and younger..
14 - 18 yo are to be placed into teen user group
18 + are to be place into adult user group
This is important because I do not wish both user groups not to be able to view each others profiles in different user groups then I can play with access levels to achieve this.
Also not sure if possible but user is 17yo and comes of age of 18 to able to automatically switch user to adult? hence why I'd like to use date/age field if possible or another dob type field. If not possible at least I know when user becomes of age I can manually change usergroup.

I can do a selection field with age but prefer not to as it doesn't update as user gets older and wouldn't be ideal.

Now I've tried doing this but with date field but options such as date range - only past date and offsets doesn't seem to make any effect on the calendar (does this feature work yet?) because it doesn't stop user from saying he is born in 2017.. I might be doing it wrong thou but did notice its the same on your registration on this site.

Thanks again look forward to your feedback.
Accepted Answer
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was weekend for us.

Is this how its meant to be displayed?

the problem is for example: if you choose 1 year of offset the 2013 is partially allowed. So the level of check is on days not on years.
I know you can do more. In future we will improve this.

The date rendered on form is always Y-m-d. because this is required by a javascript.
For registration and last visit date you can change the type with Joomla language override, the constant is DATE_FORMAT_LC4 (see screenshot)
Attachments (1)
  1. more than a month ago
  2. Support
  3. # Permalink
admin Accepted Answer
Admin
Hi,
Also not sure if possible but user is 17yo and comes of age of 18 to able to automatically switch user to adult? hence why I'd like to use date/age field if possible or another dob type field. If not possible at least I know when user becomes of age I can manually change usergroup.
No Sorry, you can do this with another extension.
I think for example "Admin Tools" allow you to schedule query.

Now I've tried doing this but with date field but options such as date range - only past date and offsets doesn't seem to make any effect on the calendar (does this feature work yet?) because it doesn't stop user from saying he is born in 2017.. I might be doing it wrong thou but did notice its the same on your registration on this site.
Have you tried to set in date field this parameter:
- Date Range: Only Past date
- Offset Year: -14

Some Tips to check year and add to teen or adults usergroup:

You can write a plugin to change group from date field, so you can follow these steps:
- Go to https://www.easy-profile.com/docs/44-triggers.html
- Download, install and enable the skeleton plugin (downloadable at end of page)
- Go to /plugins/jsn/skeleton/skeleton-php
- Remove the samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- write a function like this
triggerFieldDate_of_birthUpdate($user,&$data,$changed,$isNew){
$timestamp = strtotime('-18 years');
$testDate = date('Y-m-d', $timestamp);
if($data['date_of_birth']>$testDate){
$usergroup=<insert id of teen group>
JsnHelper::addUserToGroup($user,$usergroup);
$usergroup=<insert id of adult group>
JsnHelper::removeUserFromGroup($user,$usergroup);
}
else{
$usergroup=<insert id of adult group>
JsnHelper::addUserToGroup($user,$usergroup);
$usergroup=<insert id of teen group>
JsnHelper::removeUserFromGroup($user,$usergroup);
}
}

With this code on every update or registration the system assign correct usergroup.

NOTE: We have not tested this
  1. more than a month ago
  2. Support
  3. # 1
devdan Accepted Answer
Thanks for your response I'll have a play around with the triggers little later

Have you tried to set in date field this parameter:
- Date Range: Only Past date
- Offset Year: -14


Just tried it again and yeah still not working its like the parameters are totally ignored...

added site details for to have a look at when your not busy and i'll leave age field published...
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Just tried it again and yeah still not working its like the parameters are totally ignored...

Yes this is a bug...you cannot select a day, but when you choose the Year and month the script write something like YYYY-MM-01.

I will find a fix and I will came back with solution...please a little patience.

Anyway thanks for your report. :)
  1. more than a month ago
  2. Support
  3. # 3
Angelos_Skembris Accepted Answer
I am interested in a pretty similar functionality as Dan Dan, i.e. assigning user groups according to age, and, if possible, change user groups as they grow older. Not sure if this is currently possible, because the comparison value is fixed - I can compare according to a fixed date but I want to find out the age from the date of birth and then assign groups according to that age (which is dynamically determined as time goes by).


I do have a question on this: When comparing date of birth values, is the comparison value a string or a timestamp?

Thanks!

Edit: Never mind, I tried it and it's a timestamp.
  1. more than a month ago
  2. Support
  3. # 4
Angelos_Skembris Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 5
admin Accepted Answer
Admin
Hi,
try to use this format for date conditions YYYY-MM-DD (SQL format)
  1. more than a month ago
  2. Support
  3. # 6
devdan Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 7
admin Accepted Answer
Admin
Hi,
Try to replace /components/com_jsn/assets/js/bootstrap-datepicker.js with file attached to this post.
Attachments (1)
  1. more than a month ago
  2. Support
  3. # 8
devdan Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 9
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.