WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

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

Version: 4.1.5
printPrint


age of a link from a DATE link field
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 293
Posted 10/19/07 - 11:24 PM:
quote post
#1
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 10/20/07 - 03:44 PM:
quote post
#2
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.

Edited by Paul on 10/20/07 - 03:47 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 293
Posted 10/20/07 - 11:56 PM:
quote post
#3
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


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.