PDA

View Full Version : Different content after 60 days


seppo
10-30-2006, 12:48 PM
I'm trying to change the article plugin so that the article is not expiring, but instead some different content is displayed after 60 days.
I've been experimenting with this code:

if('" . time() . "' > ($article['datecreated']) +(3600*24*60))
{
echo ' some baaa content ';
}
else
{
echo ' different buuu content';
}

Obviously there's something wrong with my code, as I always get the same content, no matter how old the article is.

Any help appreciated.

spib
10-30-2006, 01:23 PM
Your parenthesis were in the wrong place. You want to add 1 year to datcreated and then compare the result to time(). Also the apostrophes around time() are not needed

if(time() > ($article['datecreated'] + (3600*24*60)))
{
echo ' some baaa content ';
}
else
{
echo ' different buuu content';
}

seppo
10-30-2006, 02:13 PM
It works, great:)
Thanks spib!

william
10-30-2006, 09:13 PM
Hmm this brings to mind a nice update when the next round of official plugins gets updated....to have this ability to expire and give alternate displays.

Great thought!