Average Thread Ratings on Profile
#11
(2020-04-12, 09:20 AM)Eldenroot Wrote: Nice! I would like to see a new feature - display your rating for every thread where you vote. Now you can see only the overall rating, not yours... Maybe also add a list of users who voted Smile

I have to agree, this would be a really nice addition Smile
Reply
#12
Never thought of this one. It's a good suggestion. I need feedback on this one...

How should your rating (and a list of ratings) be displayed? Obviously won't be doing this on the thread list (unless I do it on hover), but I could do it on the thread display.

I have a very busy next few weeks coming up, so I probably won't be able to add anything until May. However this is a good suggestion, will look into putting it in. Smile
Reply
#13
You can highlight your stars in rating for thread... for example change color or whatever. Or display it on mouse hover at least (but I prefer the first option).
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#14
I'm incredibly busy at the moment, so I might not have a lot of time to do something extravagent with it. However, I agree that it's a very useful feature and I've long been wondering why it's not in core.

I'll add something for it for the final release. It will probably just be a hover feature or something similar on the first version, but I may extend upon it in future releases.

Thanks for the feedback all, and to Omar G. for contributions! Smile
Reply
#15
(2020-04-12, 09:20 AM)Eldenroot Wrote: Nice! I would like to see a new feature - display your rating for every thread where you vote. Now you can see only the overall rating, not yours... Maybe also add a list of users who voted Smile

I would do this by editing a few core lines. Open forumdisplay.php, find:
		$query = $db->simple_select("threadratings", "tid, uid", "tid IN ({$imp}) AND uid = '{$mybb->user['uid']}'");

		while($rating = $db->fetch_array($query))
		{
			$threadcache[$rating['tid']]['rated'] = 1;

Change to:
		$query = $db->simple_select("threadratings", "tid, uid, rating", "tid IN ({$imp}) AND uid = '{$mybb->user['uid']}'");

		while($rating = $db->fetch_array($query))
		{
			$threadcache[$rating['tid']]['rated'] = $rating['rating'];

Then find:
				if(!isset($thread['rated']) || empty($thread['rated']))
				{
					$not_rated = ' star_rating_notrated';
				}

Change to:
				$rating_votes_average = $lang->rating_votes_average;
				if(!isset($thread['rated']) || empty($thread['rated']))
				{
					$not_rated = ' star_rating_notrated';
				}
				else
				{
					$rating_votes_average = 'Your rating: '.$thread['rated'].'. '.$lang->rating_votes_average;
				}

Similar changes will be required for other files.

If you want to achieve something similar with a plugin you will need to hook to forumdisplay_before_thread to modify the query on the fly (using control_object() by Yumi), I think you should be able to process the query value without interfering the normal workflow but if not $threadcache is in the global scope anyways.

Then hook to forumdisplay_thread to modify ($lang->rating_votes_average) or add something.
Reply
#16
Thank you! This could be really useful for Darth-Apple Smile because I would like to avoid modifying core files...

Anyway can you share the output, how does it look? Is it only on mouse hover or is possible to use it as a new addition in frontend GUI?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#17
@Omar G. Thank you very much, will look into this.

@Eldenroot: Thank you for the feedback! I have a screenshot on the first post. Currently it only displays on profiles.

Adding some of the requested features might be a little time consuming for me, and I need to get through exams first. I'm gonna wrap up the current features and get it stable on Github this weekend, but the MyBB mod site upload is going to wait a few weeks until I can address remaining features. In the meantime, anyone who needs this can go on GitHub and use it there. Smile
Reply
#18
This has been released! Many thanks to @Sawedoff, @tc4me, @Omar G, @Eldenroot, among many others for contributions, feedback, and for testing of this plugin. Smile

Many of you have suggested some great new ideas for features. I've gone ahead and released the current stable version to make it available to the MyBB community, and future releases will expand upon some of the other features requested. As always, all ideas and suggestions are welcome!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)