$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; }
in_array($status, array(1, 2, 3, 4)) or $status = 3; $typeid = isset($typeid) ? $typeid === '' ? -1 : intval($typeid) : -1; $mycatid = isset($mycatid) ? $mycatid === '' ? -1 : intval($mycatid) : -1; $mycat_select = type_select('product-' . $_userid, 0, 'mycatid', $L['type_default'], $mycatid, '', $L['type_my']); $condition = "username='******' AND status={$status}"; if ($keyword) { $condition .= " AND keyword LIKE '%{$keyword}%'"; } if ($catid) { $condition .= $CAT['child'] ? " AND catid IN (" . $CAT['arrchildid'] . ")" : " AND catid={$catid}"; } if ($typeid >= 0) { $condition .= " AND typeid={$typeid}"; } if ($mycatid >= 0) { $condition .= " AND mycatid IN (" . type_child($mycatid, $MTYPE) . ")"; } $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; $lists = $do->get_list($condition, $MOD['order']); foreach ($lists as $k => $v) { $lists[$k]['mycat'] = $v['mycatid'] && isset($MTYPE[$v['mycatid']]) ? set_style($MTYPE[$v['mycatid']]['typename'], $MTYPE[$v['mycatid']]['style']) : $L['type_default']; } break; } if ($_userid) { $nums = array(); for ($i = 1; $i < 5; $i++) { $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='******' AND status={$i}"); $nums[$i] = $r['num']; } $nums[0] = count($MTYPE);