MyBB Community Forums

Full Version: Add "Your Given Ratings" as Sort Option on Reputation Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This small tutorial is supposed to add "Show: Your Given Ratings" as another "sort option" on Reputation Pages.

Open ./reputation.php and find;
		case "negative":
			$s_url = "&show=negative";
			$conditions = 'AND r.reputation<0';
			$show_selected['negative'] = 'selected="selected"';
			break;
and ADD the following code just AFTER the second line;
		case "your_given":
			$s_url = "&show=your_given";
			$conditions = 'AND r.adduid = '.$mybb->user['uid'];
			$show_selected['your_given'] = 'selected="selected"';
			break;

Now open ./inc/languages/english/reputation.lang.php and find;
$l['show_negative'] = "Show: Negative Ratings";
and ADD the following code just AFTER that line;
$l['show_your_given'] = "Show: Your Given Ratings";

Now go to: AdminCP > templates > Your theme's templates > Reputation Templates > reputation > and find;
<option value="negative" {$show_selected['negative']}>{$lang->show_negative}</option>
and ADD the following code just AFTER that line;
<option value="your_given" {$show_selected['your_given']}>{$lang->show_your_given}</option>

If every thing goes fine then you'll see another sort option when you visit: http://yourdomain.com/reputation.php?uid=X

http://i.imgur.com/S9x7C.png
http://i.imgur.com/fX7lj.png
Is there a way to modify it so that only certain gid's can view given rep?
Yes, its possible but have to modify the core file. I'll update the first post with this.
Was looking forward to this post, just hoping to see update soon Smile
Nice tutorial. Thanks but I think this will only useful for sites that allow multi reps.
Doesnt work for me :/ When I select "Your GIven Ratings", it just says

This user currently does not have any reputation ratings with the specified criteria below.

Even tho I gave a lot of reps to other people^^
Awesome tutorial. I am actually about to test this. Smile