$adddate = timetodate($addtime, 3); $fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless']; $todate = $totime ? timetodate($totime, 3) : $L['timeless']; $votes = array(); $j = 0; for ($i = 1; $i < 11; $i++) { $s = 's' . $i; if (${$s}) { $votes[$i]['title'] = ${$s}; $v = 'v' . $i; $votes[$i]['votes'] = ${$v}; $votes[$i]['percent'] = $item['votes'] ? dround(${$v} * 100 / $item['votes'], 2, true) . '%' : '0%'; $votes[$i]['number'] = ++$j; } } $db->query("UPDATE {$DT_PRE}vote SET hits=hits+1 WHERE itemid={$itemid}"); $head_title = $head_keywords = $head_description = $title . $DT['seo_delimiter'] . $L['vote_title']; $template = $item['template'] ? $item['template'] : 'vote'; include template($template, $module); } else { $head_title = $head_keywords = $head_description = $L['vote_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('vote', $module); }
if ($keyword) { $condition .= " AND (ip LIKE '%{$keyword}%' OR username LIKE '%{$keyword}%')"; } $lists = $do->get_list_record($condition); include tpl('vote_record', $module); break; default: $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '投票次数降序', '投票次数升序', '浏览次数降序', '浏览次数升序', '开始时间降序', '开始时间升序', '到期时间降序', '到期时间升序'); $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'votes DESC', 'votes ASC', 'hits DESC', 'hits ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC'); isset($order) && isset($dorder[$order]) or $order = 0; isset($typeid) or $typeid = 0; $type_select = type_select('vote', 1, 'typeid', '请选择分类', $typeid); $order_select = dselect($sorder, 'order', '', $order); $condition = '1'; if ($_areaids) { $condition .= " AND areaid IN (" . $_areaids . ")"; } //CITY if ($keyword) { $condition .= " AND title LIKE '%{$keyword}%'"; } if ($typeid) { $condition .= " AND typeid={$typeid}"; } if ($areaid) { $condition .= $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}"; } $lists = $do->get_list($condition, $dorder[$order]); include tpl('vote', $module); break; }