当前位置: 首页>>代码示例>>PHP>>正文


PHP feed::coupons方法代码示例

本文整理汇总了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
                    }
开发者ID:hzhou9,项目名称:coupon_deal,代码行数:31,代码来源:feed.php

示例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&amp;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'])) {
开发者ID:hzhou9,项目名称:coupon_deal,代码行数:31,代码来源:feed.php


注:本文中的feed::coupons方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。