Пример #1
0
function stores($category = array())
{
    if (!$GLOBALS['me']) {
        return false;
    }
    return \query\main::while_stores(array_merge($category, array('user' => $GLOBALS['me']->ID)));
}
Пример #2
0
                    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 $LANG['category'] . ':
    <select name="category">';
                    foreach (\query\main::while_categories(array('max' => 0)) as $cat) {
                        echo '<option value="' . $cat->ID . '">' . $cat->name . '</option>';
                    }
                    echo '</select>
    <button class="btn" name="change_cat">' . $LANG['move_all'] . '</button>';
                }
                echo '</div>';
            }
            foreach (\query\main::while_stores(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->image) . '" 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->name . '
  <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>
  ' . (empty($item->coupons) ? $LANG['no_coupons_store'] : '<a href="?route=coupons.php&amp;store=' . $item->ID . '">' . sprintf($LANG['nr_coupons_store'], $item->coupons) . '</a>') . '</div>

  </div>

  <div style="clear:both;"></div>

  <div class="options">';
Пример #3
0
function stores_custom($category = array())
{
    return \query\main::while_stores($category);
}
Пример #4
0
<?php

if (!isset($_GET['secret']) || $_GET['secret'] !== \query\main::get_option('cron_secret')) {
    die('Unauthorized');
}
include ADMINDIR . '/includes/feed.php';
include ADMINDIR . '/includes/admin.php';
include ADMINDIR . '/includes/query.php';
try {
    $feed = new feed(\query\main::get_option('feedserver_ID'), \query\main::get_option('feedserver_secret'));
    $ids = array();
    foreach (\query\main::while_stores(array('max' => 0, 'show' => 'feed')) as $store) {
        $ids[] = $store->feedID;
    }
    $csuc = $cusuc = $cerr = $cuerr = 0;
    if (!empty($ids)) {
        $last_check = \query\main::get_option('lfeed_check');
        /*
        UPDATE COUPONS
        */
        if ((int) \query\main::get_option('feed_moddt') !== 0) {
            try {
                $coupons = $feed->coupons($options = array('store' => implode(',', array_values($ids)), 'update' => \site\utils::timeconvert(date('Y-m-d, H:i:s', $last_check), $feed->timezone)));
                if (!empty($coupons['Count'])) {
                    for ($cp = 1; $cp <= ceil($coupons['Count'] / 10); $cp++) {
                        if ($cp != 1) {
                            $coupons = $feed->coupons(array_merge(array('page' => $cp), $options));
                        }
                        foreach ($coupons['List'] as $coupon) {
                            if (($couponi = admin_query::coupon_imported($coupon->ID)) && actions::edit_item2($couponi->ID, array('name' => $coupon->Title, 'link' => $coupon->URL, 'code' => $coupon->Code, 'description' => $coupon->Description, 'tags' => $coupon->Tags, 'start' => $coupon->Start_Date, 'end' => $coupon->End_Date))) {
                                $cusuc++;
Пример #5
0
<?php

$answer = array();
foreach (\query\main::while_stores(array('max' => 50, 'orderby' => 'name', 'show' => isset($_GET['show']) ? $_GET['show'] : '', 'search' => isset($_POST['search']) ? urldecode($_POST['search']) : '')) as $item) {
    $answer[$item->ID] = array('catID' => $item->catID, 'name' => $item->name);
}
echo json_encode($answer);
Пример #6
0
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// force download
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
// disposition / encoding on response body
header("Content-Disposition: attachment; filename=stores_" . date('dMy', $from) . "-" . date('dMy', $to) . ".csv");
header("Content-Transfer-Encoding: binary");
$file = fopen('php://output', 'w');
$head = array();
$head[] = 'Name';
$head[] = 'Link';
$head[] = 'Description';
$head[] = 'Tags';
$head[] = 'Image';
fputcsv($file, array_values($head));
foreach (\query\main::while_stores(array('max' => 0, 'categories' => isset($_POST['category']) ? $_POST['category'] : 0, 'date' => $from . ',' . $to)) as $store) {
    $line = array();
    $line[] = $store->name;
    $line[] = $store->url;
    $line[] = $store->description;
    $line[] = $store->tags;
    if (empty($store->image)) {
        $line[] = '';
    } else {
        $line[] = filter_var($store->image, FILTER_VALIDATE_URL) ? $store->image : $GLOBALS['siteURL'] . $store->image;
    }
    fputcsv($file, $line);
}
fclose($file);
Пример #7
0
function items($category = array())
{
    return \query\main::while_stores($category);
}