Example #1
0
    }
    $condition[] = "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))";
    $count = Table::Count('team', $condition);
    list($pagesize, $offset, $pagestring) = pagestring($count, $size);
    $teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $pagesize, 'offset' => $offset));
    $disable_multi = true;
    /***********************加入的代码:开始*********************************/
    $cates = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC'));
    $alls = array();
    $anow = time();
    foreach ($cates as $key => $value) {
        $alls[$key]['name'] = $value[name];
        $alls[$key]['ename'] = $value[ename];
        $alls[$key]['gid'] = $value[id];
        $alls[$key]['number'] = Table::Count('team', array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"));
        $alls[$key]['teams'] = DB::LimitQuery('team', array('condition' => array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $value[show_number]));
        $alls[$key]['recom'] = DB::GetQueryResult("SELECT *,t.id AS tid,p.title AS ptitle, t.title AS ttitle, p.image AS pimage FROM `team` AS t LEFT JOIN `partner` as p ON t.partner_id=p.id WHERE t.group_id={$value['id']} AND t.team_type='normal' AND t.begin_time<'" . $anow . "' AND t.end_time>'" . $anow . "' AND t.is_recom='Y' AND p.display='Y'", false);
    }
    /***********************加入的代码:结束*********************************/
    die(require_once dirname(__FILE__) . '/multi.php');
} else {
    $team = $teams = index_get_team($city['id'], $group_id);
    if ($team && $team['id']) {
        $_GET['id'] = abs(intval($team['id']));
        die(require_once dirname(__FILE__) . '/team.php');
    } elseif ($teams) {
        $disable_multi = true;
        die(require_once dirname(__FILE__) . '/multi.php');
    }
}
include template('subscribe');
Example #2
0
if ($ename != 'none') {
    $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'ename' => $ename), 'one' => true));
}
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = "{$INI['system']['sitename']} 今日团购";
$rss->description = "{$INI['system']['sitename']} 每天团购一次";
$rss->link = "{$INI['system']['wwwprefix']}";
$rss->syndicationURL = $INI['system']['wwwprefix'] . '/' . $PHP_SELF;
$image = new FeedImage();
$image->title = $INI['system']['sitename'];
$image->url = "{$INI['system']['imgprefix']}/static/css/i/logo.gif";
$image->link = "{$INI['system']['sitename']}";
$image->description = "Feed provided by zuitu.com";
$rss->image = $image;
$team = $teams = index_get_team($city['id']);
if ($team['id']) {
    $teams = array();
    $teams[] = $team;
}
foreach ($teams as $team) {
    $item = new FeedItem();
    $item->title = $team['title'];
    $item->link = $INI['system']['wwwprefix'] . '/team.php?id=' . $team['id'];
    $item->description = $team['summary'] . "<br /><img src='" . team_image($team['image']) . "'/>" . $team['systemreview'];
    $item->date = $team['create_time'];
    $item->source = $INI['system']['wwwprefix'];
    $item->author = $city['name'];
    $rss->addItem($item);
}
$rss->outputFeed("ATOM2.0");