I created a new DATE TYPE field for links (each link is a person), and wanted to show each person's actual age whenever somebody views that link's details. I saw this function for members, but how can this be done for a link?
The easy way would be to require people to register and use {MEMBERAGE}. If you want it just for links you'll have to prompt them to type it in a 1980-01-31 format though, presuming that's what mysql is using. Unless you know PHP, in which case you can write a plugin using the beforeaddition function to assemble the input (of selectors perhaps) into that format... like if ($object->objecttype == 'link') $object->birthdate = $object->birthyear .'-'. $object->birthmonth .'-'. $object->birthday;.
What I do is store the dates as integers and use strtotime to transform user input into unix timestamps.
Comments on age of a link from a DATE link field
Forum Regular
Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 91
Total Comments: 305
Hi Paul,
I created a new DATE TYPE field for links (each link is a person), and wanted to show each person's actual age whenever somebody views that link's details.
I saw this function for members, but how can this be done for a link?
Thank You
David
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
The easy way would be to require people to register and use {MEMBERAGE}. If you want it just for links you'll have to prompt them to type it in a 1980-01-31 format though, presuming that's what mysql is using. Unless you know PHP, in which case you can write a plugin using the beforeaddition function to assemble the input (of selectors perhaps) into that format... like if ($object->objecttype == 'link') $object->birthdate = $object->birthyear .'-'. $object->birthmonth .'-'. $object->birthday;.
What I do is store the dates as integers and use strtotime to transform user input into unix timestamps.
Forum Regular
Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 91
Total Comments: 305
Hi Paul,
Thanks for answer. I will probably get them to become members instead of links.
Thanks
David