New Zenner
- Join Date:
- Jun 2009
- Posts:
- 13
- Plugin Contributions:
- 0
Add a sticker for featured products
Hello,
I have find this code for put a sticker on the news products. This work fine but i want to have the same system for the featured products.
I am 0 in PHP ; this is the code:
<?php $datesql = "select products_date_added from products where products_id = ". (int)$_GET['products_id'] ." "; $date_display = $db->Execute($datesql); $newdate = $date_display->fields['products_date_added']; $newdate2 = $newdate–30; function reformatDate($newdate) { list($day, $month, $year, $hour, $min, $sec) = split( '[: -]', $newdate); return "$day-$month-$year"; } $dateA=$newdate; $theDate=reformatDate($dateA); $thirty_days_ago = mktime()-2592000; if ($theDate >= date('d-m-Y', $thirty_days_ago)) { echo '<div class="new"></div>'; } ?>Can you help me ? Thank you.