function coupons($category = array()) { if (!$GLOBALS['me']) { return false; } return \query\main::while_items(array_merge($category, array('user' => $GLOBALS['me']->ID))); }
function items_custom($category = array()) { return \query\main::while_items($category); }
echo '<div class="bulk_options">'; if ($ab_del) { echo '<button class="btn" name="delete" data-delete-msg="' . $LANG['delete_msg'] . '">' . $LANG['delete_all'] . '</button> '; } if ($ab_edt) { echo $LANG['action'] . ': <select name="action">'; foreach (array('publish' => $LANG['publish'], 'unpublish' => $LANG['unpublish']) as $k => $v) { echo '<option value="' . $k . '">' . $v . '</option>'; } echo '</select> <button class="btn" name="set_action">' . $LANG['set_all'] . '</button>'; } echo '</div>'; } foreach (\query\main::while_items(array_merge(array('orderby' => isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'date desc'), $options)) as $item) { echo '<li> <input type="checkbox" name="id[' . $item->ID . ']" /> <div style="display: table;"> <img src="' . \query\main::store_avatar($item->store_img) . '" alt="" style="width: 80px;" /> <div class="info-div"><h2>' . (!$item->visible ? '<span class="msg-error">' . $LANG['notpublished'] . '</span> ' : '') . ($item->feedID !== 0 ? '<span class="msg-alert" title="' . $LANG['added_through_feed_msg'] . '">' . $LANG['added_through_feed'] . '</span> ' : '') . (!$item->is_expired ? '<span class="msg-success">' . $LANG['active'] . '</span> ' : '<span class="msg-error">' . $LANG['expired'] . '</span> ') . $item->title . ' <span class="fright date">' . date('Y.m.d, ' . (\query\main::get_option('hour_format') == 12 ? 'g:i A' : 'G:i'), strtotime($item->date)) . '</span></h2> <a href="?route=coupons.php&store=' . $item->storeID . '"">' . $item->store_name . '</a></div> </div> <div style="clear:both;"></div> <div class="options">';
header("Content-Transfer-Encoding: binary"); $file = fopen('php://output', 'w'); $head = array(); $head[] = 'Title'; $head[] = 'Link'; $head[] = 'Description'; $head[] = 'Tags'; $head[] = 'Code'; $head[] = 'Start'; $head[] = 'End'; $head[] = 'Store URL'; if ($store_url = isset($_POST['fields']['store_name'])) { $head[] = 'Store name'; } fputcsv($file, array_values($head)); foreach (\query\main::while_items(array('max' => 0, 'categories' => isset($_POST['category']) ? $_POST['category'] : 0, 'date' => $from . ',' . $to)) as $coupon) { $line = array(); $line[] = $coupon->title; $line[] = $coupon->url; $line[] = $coupon->description; $line[] = $coupon->tags; $line[] = $coupon->code; $line[] = $coupon->start_date; $line[] = $coupon->expiration_date; $line[] = $coupon->store_url; if ($store_url) { $line[] = $coupon->store_name; } fputcsv($file, $line); } fclose($file);
// max should be defined if (isset($_GET['cat'])) { $categories['categories'] = $_GET['cat']; } else { if (isset($_GET['store'])) { $categories['store'] = $_GET['store']; } } echo '<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>' . \query\main::get_option('sitename') . ' Coupons</title> <link>' . $GLOBALS['siteURL'] . '</link> <description>List of coupons</description> <language>en-us</language>'; foreach (\query\main::while_items($categories) as $item) { echo ' <item> <title>' . $item->title . '</title> <link>' . $item->link . '</link> <description><![CDATA[' . $item->description . ']]></description> <pubDate>' . date('r', strtotime($item->date)) . '</pubDate> <guid>' . $item->link . '</guid> </item> '; } echo '</channel> </rss>';
function items($category = array()) { if ($GLOBALS['searched_type'] === 'products') { return \query\main::while_products($category, 'category'); } else { return \query\main::while_items($category, 'category'); } }