Exemplo n.º 1
0
 public static function plugins($categories = array())
 {
     return admin_query::have_plugins($categories, array('only_count' => ''));
 }
Exemplo n.º 2
0
        if ($p['results']) {
            echo '<form action="?route=plugins.php&amp;action=list" method="POST">

<ul class="elements-list">

<li class="head"><input type="checkbox" checkall /> ' . $LANG['name'] . '</li>';
            echo '<div class="bulk_options">';
            echo $LANG['action'] . ': ';
            echo '<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 (admin_query::while_plugins(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="' . (empty($item->image) ? '../' . DEFAULT_IMAGES_LOC . '/plugin_ico.png' : '../' . $item->image) . '" alt="" style="width: 70px;" />
  <div class="info-div"><h2>' . ($item->visible !== 1 ? '<span class="msg-error">' . $LANG['notpublished'] . '</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>
  v ' . sprintf('%0.2f', $item->version) . '
  </div>

  </div>

  <div style="clear:both;"></div>
Exemplo n.º 3
0
             }
         } catch (Exception $e) {
         }
     }
     /*
     IMPORT COUPONS
     */
     try {
         $coupons = $feed->coupons($options = array('store' => implode(',', array_values($ids)), 'view' => !isset($_GET['import_expired']) || $_GET['import_expired'] !== 'yes' ? 'active' : '', 'date' => \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 (!admin_query::coupon_imported($coupon->ID) && ($store = admin_query::store_imported($coupon->Store_ID)) && actions::add_item(array('feedID' => $coupon->ID, 'store' => $store->ID, 'category' => $store->catID, 'popular' => 0, 'exclusive' => 0, 'name' => $coupon->Title, 'link' => $coupon->URL, 'code' => $coupon->Code, 'description' => $coupon->Description, 'tags' => $coupon->Tags, 'cashback' => 0, 'start' => $coupon->Start_Date, 'end' => $coupon->End_Date, 'publish' => 1, 'meta_title' => '', 'meta_desc' => ''))) {
                         $csuc++;
                     } else {
                         $cerr++;
                     }
                 }
                 usleep(500000);
                 // let's put a break after every page, 500 000 microseconds. that means a half of a second
             }
         }
         actions::set_option(array('lfeed_check' => time()));
         // update time for last feed check
     } catch (Exception $e) {
     }
 }
 // you can use $csuc, $cusuc, $cerr, $cuerr variables to create logs or something ...
Exemplo n.º 4
0
                                foreach ($cat['subcats'] as $subcat) {
                                    echo '<option value="' . $subcat->ID . '">' . $subcat->name . '</option>';
                                }
                            }
                            echo '</optgroup>';
                        }
                        echo '</select>

    <input type="checkbox" name="coupons" value="yes" checked> ' . $LANG['feed_icouponstoo'] . '

    <button class="btn">' . $LANG['import_all'] . '</button>';
                        echo '</div>';
                    }
                    foreach ($stores['List'] as $item) {
                        echo '<li>
      <input type="checkbox" name="id[' . $item->ID . ']" value=""' . ($imported = admin_query::store_imported($item->ID) ? ' disabled' : '') . ' />

      <div style="display: table;">

      <img src="' . \query\main::store_avatar($item->Image) . '" alt="" style="width: 80px;" />
      <div class="info-div"><h2>' . ($imported ? '<span class="msg-alert" title="' . $LANG['added_through_feed_msg'] . '">' . $LANG['added_through_feed'] . '</span> ' : '') . $item->Name . '</h2>
      ' . (empty($item->Coupons) ? $LANG['no_coupons_store'] : '<a href="?route=feed.php&amp;action=coupons&amp;store=' . $item->ID . '">' . sprintf($LANG['nr_coupons_store'], $item->Coupons) . '</a>') . '</div>

      </div>

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

      <div class="options">';
                        if (!$imported && $feed_im) {
                            echo '<a href="javasript:void(0)" onclick="$(this).parents(\'li\').children(\'input\').click(); return false;">' . $LANG['checkun'] . '</a>';
                            echo '<a href="?route=feed.php&amp;action=preview_store&amp;id=' . $item->ID . '">' . $LANG['preview_import'] . '</a>';
Exemplo n.º 5
0
    die;
}
$from = isset($_POST['date']['from']) ? strtotime($_POST['date']['from']) : strtotime('2000-01-01');
$to = isset($_POST['date']['to']) ? strtotime($_POST['date']['to']) : strtotime('tomorrow');
// disable caching
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
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=subscribers_" . date('dMy', $from) . "-" . date('dMy', $to) . ".csv");
header("Content-Transfer-Encoding: binary");
$file = fopen('php://output', 'w');
$head = array();
if ($name = isset($_POST['fields']['name'])) {
    $head[] = 'Name';
}
$head[] = 'Email';
fputcsv($file, array_values($head));
foreach (admin_query::while_subscribers(array('max' => 0, 'show' => isset($_POST['view']) ? urldecode($_POST['view']) : '', 'date' => "" . $from . ',' . $to . "")) as $subscriber) {
    $line = array();
    if ($name) {
        $line[] = $subscriber->user_name;
    }
    $line[] = $subscriber->email;
    fputcsv($file, $line);
}
fclose($file);
Exemplo n.º 6
0
<?php

$json = array();
foreach (admin_query::while_chat_messages(array('max' => 5, 'orderby' => 'date DESC')) as $item) {
    $json[] = array('id' => $item->ID, 'avatar' => \query\main::user_avatar($item->user_avatar), 'name' => $item->user_name, 'text' => \site\utils::bbcodes($item->text), 'date' => $item->date, 'gfdate' => date('Y.m.d, ' . (\query\main::get_option('hour_format') == 12 ? 'g:i A' : 'G:i'), strtotime($item->date)));
}
echo json_encode($json);
Exemplo n.º 7
0
</div>

</section>

<?php 
}
echo '<section class="el-row">

<h2>' . $LANG['news_title'] . ' <a href="#" class="updown" data-set="news">' . (isset($_SESSION['ses_set']['news']) && ($show_news = $_SESSION['ses_set']['news']) ? 'S' : 'R') . '</a></h2>

<div class="el-row-body"' . (!empty($show_news) ? ' style="display: none;"' : '') . '>

<ul class="elements-list">';
if ($news = admin_query::news() > 0) {
    foreach (admin_query::while_news(array('max' => 7, 'orderby' => 'date DESC')) as $item) {
        echo '<li><a href="' . $item->url . '" target="_blank">' . $item->title . '</a></li>';
    }
} else {
    echo '<li>' . $LANG['no_news_yet'] . '</li>';
}
echo '</ul>';
if ($news > 0) {
    echo '<div class="links">
  <a href="?route=news.php">' . $LANG['news_list'] . '</a>
</div>';
}
echo '</div>

</section>
Exemplo n.º 8
0
 public static function delete_plugin_image($id)
 {
     global $db;
     if (!$GLOBALS['me']->is_admin) {
         return false;
     }
     $id = (array) $id;
     $stmt = $db->stmt_init();
     foreach ($id as $ID) {
         if (admin_query::plugin_exists($ID)) {
             $plugin = admin_query::plugin_infos($ID);
             $stmt->prepare("UPDATE " . DB_TABLE_PREFIX . "plugins SET image = '' WHERE id = ?");
             $stmt->bind_param("i", $ID);
             $stmt->execute();
             if (!empty($plugin->image)) {
                 @unlink(DIR . '/' . $plugin->image);
             }
         }
     }
     @$stmt->close();
     return true;
 }