MyBB Community Forums

Full Version: Search_Results_threads cannot search by Rating
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey gang, I'm just wondering how to sort search_results_thread by rating?

{$sorturl}&sortby=rating&order=asc

this does not seem to work, any suggestions?
basically thread rating is not included in the default search system of MyBB.
it needs to be queried from the database & added to the search results.

most probably thread rating will be removed from a future version of MyBB.
perhaps its better to not add thread rating to the search system.

however, see this related post
(2020-02-12, 06:39 AM).m. Wrote: [ -> ]basically thread rating is not included in the default search system of MyBB.
it needs to be queried from the database & added to the search results.

most probably thread rating will be removed from a future version of MyBB.
perhaps its better to not add thread rating to the search system.

however, see this related post

Hi m. thanks for the feedback. Please don't remove the rating system because it can be used in so many different ways, and the rating system can be built upon, and add rich quality to sites that use rating systems. The basic function needs to be in place, taking away the rating system would be like cutting off a hand. Yes, you have two arms and another hand but, I'm not sure where I am going with this. But i hope you get what I mean.

Again, thanks for the reply and solution, I'm gonna have a custom plugin made.
To simply achieve a sort by rating, you can edit the search.php file and just add another case statement. Have a look into search.php in line 74. Add this case:
switch($sortby)
{
...
	case "rating":
		$sortfield = "t.totalratings";
		break;
...

Once done, you can use {$sorturl}&sortby=rating

[ExiTuS]
(2020-02-12, 11:15 AM)[ExiTuS] Wrote: [ -> ]To simply achieve a sort by rating, you can edit the search.php file and just add another case statement. Have a look into search.php in line 74. Add this case:
switch($sortby)
{
...
 case "rating":
 $sortfield = "t.totalratings";
 break;
...

Once done, you can use {$sorturl}&sortby=rating

[ExiTuS]

You the man! Thanks so much, I appreciate the answer, worked perfect!