function products_custom($category = array()) { return \query\main::while_products($category); }
function products($category = array()) { if (!$GLOBALS['me']) { return false; } return \query\main::while_products(array_merge($category, array('user' => $GLOBALS['me']->ID))); }
} 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') . ' Products</title> <link>' . $GLOBALS['siteURL'] . '</link> <description>List of products</description> <language>en-us</language>'; foreach (\query\main::while_products($categories) as $item) { echo ' <item> <title>' . $item->title . '</title> <image> <link>' . $item->link . '</link> <title>' . $item->title . '</title> <url>' . \query\main::product_avatar($item->image) . '</url> </image> <link>' . $item->link . '</link> <description><![CDATA[' . $item->description . ']]></description> <pubDate>' . date('r', strtotime($item->date)) . '</pubDate> <guid>' . $item->link . '</guid> </item> '; }
$head[] = 'Title'; $head[] = 'Link'; $head[] = 'Description'; $head[] = 'Tags'; $head[] = 'Image'; $head[] = 'Price'; $head[] = 'Old Price'; $head[] = 'Currency'; $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_products(array('max' => 0, 'categories' => isset($_POST['category']) ? $_POST['category'] : 0, 'date' => $from . ',' . $to)) as $product) { $line = array(); $line[] = $product->title; $line[] = $product->url; $line[] = $product->description; $line[] = $product->tags; $line[] = filter_var($product->image, FILTER_VALIDATE_URL) ? $product->image : $GLOBALS['siteURL'] . $product->image; $line[] = $product->price; $line[] = $product->old_price; $line[] = $product->currency; $line[] = $product->start_date; $line[] = $product->expiration_date; $line[] = $product->store_url; if ($store_url) { $line[] = $product->store_name; }
function items($category = array()) { if ($GLOBALS['searched_type'] === 'products') { return \query\main::while_products($category, 'category'); } else { return \query\main::while_items($category, '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_products(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::product_avatar($item->image) . '" alt="" style="height: 50px; width: 50px;" /> <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=products.php&store=' . $item->storeID . '"">' . $item->store_name . '</a></div> </div> <div style="clear:both;"></div> <div class="options">';