本文整理汇总了PHP中feed::coupons方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::coupons方法的具体用法?PHP feed::coupons怎么用?PHP feed::coupons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::coupons方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feed
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++;
} else {
$cuerr++;
}
}
usleep(500000);
// let's put a break after every page, 500 000 microseconds. that means a half of a second
}
示例2: feed
echo '<a href="#" class="btn" onclick="window.history.go(-2)">' . $LANG['back'] . '</a>';
}
}
}
break;
/** LIST OF FEED COUPONS */
/** LIST OF FEED COUPONS */
case 'coupons':
if (!ab_to(array('feed' => 'view'))) {
die;
}
include 'includes/feed.php';
try {
$feed = new feed(\query\main::get_option('feedserver_ID'), \query\main::get_option('feedserver_secret'));
try {
$coupons = $feed->coupons(array('page' => isset($_GET['page']) ? $_GET['page'] : 1, 'per_page' => 10, 'orderby' => isset($_GET['orderby']) ? $_GET['orderby'] : 'date desc', 'store' => isset($_GET['store']) ? $_GET['store'] : '', 'category' => isset($_GET['category']) ? $_GET['category'] : '', 'search' => isset($_GET['search']) ? $_GET['search'] : ''));
echo '<div class="title">
<h2>' . $LANG['coupons_title'] . '</h2>
<div style="float:right; margin: 0 2px 0 0;">';
if (ab_to(array('feed' => 'import'))) {
echo '<a href="?route=feed.php&action=import" class="btn">' . $LANG['feed_icoupons'] . '</a>';
}
echo '</div>';
if (!empty($LANG['feed_coupons_subtitle'])) {
echo '<span>' . $LANG['feed_coupons_subtitle'] . '</span>';
}
echo '</div>';
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'pages_csrf')) {
if (isset($_POST['delete'])) {