Webmastersite.net
Register Log In

age of a link from a DATE link field
how can this be done?

Comments on age of a link from a DATE link field

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Oct 20, 2007 - 12:24 AM:

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
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 20, 2007 - 4:44 PM:

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.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Oct 21, 2007 - 12:56 AM:

Hi Paul,

Thanks for answer. I will probably get them to become members instead of links. smiling face

Thanks
David
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.