Jump to the post that solved this thread.
Solved: 4 Years, 11 Months, 1 Week ago Search_Results_threads cannot search by Rating
#1
Solved: 4 Years, 11 Months, 1 Week ago
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?
Hey man, what's up?
Reply
#2
Solved: 4 Years, 11 Months, 1 Week ago
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
Reply
#3
Solved: 4 Years, 11 Months, 1 Week ago
(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.
Hey man, what's up?
Reply
#4
Solved: 4 Years, 11 Months, 1 Week ago
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]
Reply
#5
Solved: 4 Years, 11 Months, 1 Week ago
(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!
Hey man, what's up?
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)