$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '投票总数降序', '投票总数升序', '浏览次数降序', '浏览次数升序', '选项总数降序', '选项总数升序', '开始时间降序', '开始时间升序', '到期时间降序', '到期时间升序'); $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'polls DESC', 'polls ASC', 'hits DESC', 'hits ASC', 'items DESC', 'items ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC'); isset($fields) && isset($dfields[$fields]) or $fields = 0; isset($order) && isset($dorder[$order]) or $order = 0; isset($typeid) or $typeid = 0; $level = isset($level) ? intval($level) : 0; $fields_select = dselect($sfields, 'fields', '', $fields); $type_select = type_select('poll', 1, 'typeid', '请选择分类', $typeid); $order_select = dselect($sorder, 'order', '', $order); $level_select = level_select('level', '级别', $level); $condition = '1'; if ($_areaids) { $condition .= " AND areaid IN (" . $_areaids . ")"; } //CITY if ($keyword) { $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'"; } if ($typeid) { $condition .= " AND typeid IN (" . type_child($typeid, $TYPE) . ")"; } if ($level) { $condition .= " AND level={$level}"; } if ($areaid) { $condition .= $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}"; } $lists = $do->get_list($condition, $dorder[$order]); include tpl('poll', $module); break; }
$adddate = timetodate($addtime, 3); $fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless']; $todate = $totime ? timetodate($totime, 3) : $L['timeless']; if ($item['seo_title']) { $seo_title = $item['seo_title']; } else { $head_title = $title . $DT['seo_delimiter'] . $L['poll_title']; } if ($item['seo_keywords']) { $head_keywords = $item['seo_keywords']; } if ($item['seo_description']) { $head_description = $item['seo_description']; } $template = $item['template'] ? $item['template'] : 'poll'; include template($template, $module); } else { $head_title = $head_keywords = $head_description = $L['poll_title']; $condition = '1'; if ($typeid) { $condition .= " AND typeid={$typeid}"; } if ($cityid) { $condition .= $AREA[$cityid]['child'] ? " AND areaid IN (" . $AREA[$cityid]['arrchildid'] . ")" : " AND areaid={$cityid}"; } $lists = $do->get_list($condition, 'addtime DESC'); include template('poll', $module); } } } }