1. Footsteps
  2. Presales Question
  3. Friday, October 09 2015, 12:22 AM
Hi this plugin looks great so far.

A particular feature my client wants is to have a module list profiles that have upcoming birthdays - say in the next 5 days.

I'm guessing. The date field could be used to capture the DOB. But do you offer or know of a model that would display the list. If not would, you consider taking on this as a bespoke project?
admin Accepted Answer
Admin
Hi,
Yes you can use date field to set Date of Birth, our date field type have 3 type of views on profile (date,age,years ago). For example on this site we use Age display type, so in edit/profile registration you can set DOB and in profile view you will see the age value.

To create a module to show upcoming birthdays you can use the parameter Custom SQL Where (in free version you not have a module but you can see this parameter in Users List menu item).

In SQL custom parameter you can set a filter to choose users with value of DOB field between today and 5 future days, you can use syntax like this (this is a SQL syntax):
dob_alias_field > CURDATE() AND dob_alias_field <  ( CURDATE() + INTERVAL 5 DAY )

we not have tested this SQL where parameter but but it should work :p
  1. more than a month ago
  2. Presales Question
  3. # 1
Branddds Accepted Answer
Pro
Hi,

I've tried to use the above code but it doesn't work.

What have i done:

1. Add new Easy Profile list Module.
2. Added the SQL Syntax:
dob_geburtstag_field > CURDATE() AND dob_geburtstag_field <  ( CURDATE() + INTERVAL 5 DAY )

3. "geburtstag" is my field name
4. Nothing happens.

Wenn I save the module without Syntax, all birthdays show up. But the "Order Type" ascending or decending is working either.

See screen for more info.
  1. more than a month ago
  2. Presales Question
  3. # 2
admin Accepted Answer
Admin
we not have tested this SQL where parameter but but it should work

This SQL will not work because DOB is not in the present year.

try with something like this:
DATE_ADD(dob_geburtstag_field, INTERVAL YEAR(CURDATE())-YEAR(dob_geburtstag_field) + IF(DAYOFYEAR(CURDATE()) > DAYOFYEAR(dob_geburtstag_field),1,0) YEAR) BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 5 DAY)
References
  1. http://stackoverflow.com/questions/18747853/mysql-select-upcoming-birthdays
  1. more than a month ago
  2. Presales Question
  3. # 3
Branddds Accepted Answer
Pro
Thanks!

dob_geburtstag_field doesn't exists. I thought "dob" and "field" is something easyprofile is putting to the field. The exact name is just "geburtstag".

This code works:

DATE_ADD(geburtstag, INTERVAL YEAR(CURDATE())-YEAR(geburtstag) + IF(DAYOFYEAR(CURDATE()) > DAYOFYEAR(geburtstag),1,0) YEAR) BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 5 DAY)


One other question: Wenn no birthday is found within the next 5 day's, the module disappears, leaving a blank spot in the design. Is there a sollution for this?
  1. more than a month ago
  2. Presales Question
  3. # 4
admin Accepted Answer
Admin
Hi, each module always enable the position in template, so for example if you have this module in some column then the column is always available.

if you have only a blank space, maybe you can manage this with CSS but this depends of your template.

CSS Example (protostar template)
.moduletable:empty{ display:none; }
  1. more than a month ago
  2. Presales Question
  3. # 5
  • 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.