<img src="' . user_avatar($review->user_avatar) . '" alt="" style="width: 60px; height: 60px;" /> <span class="rating"><span style="width:' . $review->stars * 16 . 'px;"></span></span> </div> <div class="right"> <div class="title">' . $review->user_name . '</div> <div class="time">Added ' . date('m/d/Y', $wdate = strtotime($review->date)) . ', ' . timeago($wdate, 'seconds') . ' ago</div> <div class="description">' . $review->text . '</div> </div> </div> </article>'; } } if (searched_type() === 'products') { echo '<ul class="category" style="margin: 10px 0 5px 0;"> <li><a href="' . get_remove(array('type')) . '">Coupons</a></li>'; if (theme_has_products()) { echo '<li class="active">Products</li>'; } echo '</ul>'; echo '<div class="text-tit">Products for ' . $item->name . ':</div>'; $pagination = have_products_custom(array('store' => $item->ID)); if ($pagination['results']) { foreach (products_custom(array('store' => $item->ID, 'orderby' => 'active desc')) as $item) { echo '<article class="array_item product"> <div class="table"> <div class="left">
<?php /* SHOWING COUPONS OR PRODUCTS */ function searched_type() { if (isset($_GET['type']) && strtolower($_GET['type']) === 'products') { return 'products'; } return 'coupons'; } /* PUT THE OBJECT INTO A GLOBAL VARIABLE */ $GLOBALS['searched_type'] = searched_type(); $GLOBALS['item'] = \query\main::category_infos(); $GLOBALS['exists'] = \query\main::category_exists(); /* CHECK IF CATEGORY EXISTS */ function exists() { return $GLOBALS['exists']; } /* INFORMATIONS ABOUT CATEGORY */ function the_item() { return $GLOBALS['item'];