Jump to content

Поиск пользователей по рейтингу


Recommended Posts


Открываем search.php находим

//Если критерий поиск "по людям"
$sql_query = "SELECT SQL_CALC_FOUND_ROWS user_id, user_search_pref, user_photo, user_birthday, user_country_city_name, user_last_visit FROM `".PREFIX."_users` WHERE user_search_pref LIKE '%{$query}%' {$sql_sort} ORDER by `user_reg_date` DESC LIMIT {$limit_page}, {$gcount}";

Вписываем user_rate,

А ORDER by `user_reg_date` меняем на ORDER by `user_rate`

Далее находим

//Если критерий поиск "по людям"
if($type == 1){
$tpl->load_template('search/result_people.tpl');
foreach($sql_ as $row){
$tpl->set('{user-id}', $row['user_id']);
$tpl->set('{name}', $row['user_search_pref']);

Ниже вставляем

$tpl->set('{rating}', $row['user_rate']);

Далее в шаблоне

result_people.tpl

в нужное место вставляем {rating}

Так получится вывод рейтинга в поиске с сортировкой от наибольшего

 

  • Downvote 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...