本帖最后由 otherbank 于 2011-12-5 14:13 编辑
搜索用户的修改,可以查询所有用户,并且按照积分从高到低排序
1,查询程序文件 source/include/spacecp/spacecp_search.php96行代码:- $query = DB::query("SELECT s.* $fsql FROM ".implode(',', $fromarr)." WHERE ".implode(' AND ', $wherearr)." LIMIT 0,100");
- while ($value = DB::fetch($query)) {
- $value['isfriend'] = ($value['uid']==$space['uid'] || $space['friends'][$value['uid']])?1:0;
- $list[$value['uid']] = $value;
- }
复制代码 修改为:- $ppp = 20;
- $page = max(1, intval($_G['gp_page']));
- $start = ($page -1)*$ppp;
- $pluginurl = "home.php?".$_SERVER["QUERY_STRING"];
- $count = DB::result_first( "SELECT count(*) FROM ".implode(',', $fromarr)." WHERE ".implode(' AND ', $wherearr));
- $query = DB::query("SELECT s.* $fsql FROM ".implode(',', $fromarr)." WHERE ".implode(' AND ', $wherearr)." ORDER BY s.credits DESC LIMIT $start, $ppp");
- while ($value = DB::fetch($query)) {
- $value['isfriend'] = ($value['uid']==$space['uid'] || $space['friends'][$value['uid']])?1:0;
- $list[$value['uid']] = $value;
- }
- $multi = multi($count, $ppp, $page, $pluginurl);
复制代码 2,语言显示和替换文件source/language/home/lang_template.php的1344行代码- 'search_member_list_message' => '以下是查找到的用户列表(最多显示 100 个),您还可以<a href="home.php?mod=spacecp&ac=search">换个搜索条件试试</a>',
复制代码 修改为:- 'search_member_list_message' => '以下是查找到的所有用户列表(按积分从高到低排序),您还可以<a href="home.php?mod=spacecp&ac=search">换个搜索条件试试</a>',
复制代码 更新下缓存就OK了 |