Show "NEW" image next to new listings

7 posts by 5 authors in: Forums > CMS Builder
Last Post: January 20, 2010   (RSS)

I would like to display a small image showing "NEW" next to my most recent posts or those posts added within the last 7 days. It should be done automatically and once 7 days have passed since it was added, the "NEW" image should not be shown.

Note: All my listings should show in the Listings Page but only the new additions will have the "NEW" image next to it.

Thank you.

Re: [WEVOLUTIONS] Show "NEW" image next to new listings

By Kenny - January 17, 2010

Re: [sagentic] Show "NEW" image next to new listings

This is similar to what I want. However I have a date being manually inputted and I have a separate field for "date added". Please help me in getting the code to display a "new" image added to listings within the last 7 days. I do not want to use the created date stamp.

Re: [WEVOLUTIONS] Show "NEW" image next to new listings

By Dave - January 17, 2010

Hi WEVOLUTIONS,

Try the following:
- Replace 'date' with the name of your date field
- Replace 30 with the number of days you want "New" to appear for
- Replace NEW! with the <img> tag for your new image

<?php
$secondsOld = time() - strtotime($record['date']);
$daysOld = intval($secondsOld/60/60/24);
?>
Days old: <?php echo $daysOld ?><br/>

<?php if ($daysOld <= 30): ?> NEW! <?php endif ?>


Hope that helps! Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Show "NEW" image next to new listings

Thank you very much. It works.

Re: [Wolf-E] Show "NEW" image next to new listings

By Donna - January 20, 2010

Hi Wolf,

Listings Manager actually has a built in "new listings" template cell on the search results page. Take a look at this page in the docs for more information about how to set what is considered "new" to Listings Manager:

http://www.interactivetools.com/docs/doc.cgi?/listingsmanager/doc_page7.html

We no longer offer free support for Listings Manager, as it's been discontinued for a few years now, but if you need more help with that, feel free to [url =https://www.interactivetools.com/order/]purchase a support ticket[/url] and I'd be happy to walk you through exactly how to set that up step-by-step. :)
Donna

--
support@interactivetools.com