search by 1 day, 3 days, week

By Dave - February 10, 2014

Hi reddirt, 

You can find some docs on creating search forms here: http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

And some sample code here: http://www.interactivetools.com/forum/forum-posts.php?postNum=2232534#post2232534

I think you're going to want something like this: 

<a href="?createdDate_min=<?php echo mysql_datetime(strtotime("-1 day")); ?>">1 day old</a>
<a href="?createdDate_min=<?php echo mysql_datetime(strtotime("-3 days")); ?>">3 days old</a>
<a href="?createdDate_min=<?php echo mysql_datetime(strtotime("-1 week")); ?>">1 week old</a>

just replace "createdDate" with the name of your listings date field (if it's a different name).  It's a little tricky because we need to use a little bit of PHP code to generate the date as of (1 day, 3 days, 1 week) ago that is the oldest date you want to show.

Hope that helps!  Let me know how it goes.

Dave Edis - Senior Developer
interactivetools.com