PDA

View Full Version : Allow users to see all their reputation in UserCP


The Keeper
10-30-2004, 10:00 PM
This is a remarkably simple hack that takes minutes to install and allows users the option of seeing more than the default 5 repuation entries in their User CP.

First, edit the USERCP template.

Find:
$vbphrase[latest_reputation_received]

Immediately after it, add:
<!-- User Rep Options -->

<form name="rep" action="usercp.php" method="post">

<select name="repcount"
onchange="this.form.submit()"
style="font-size:x-small">

<option>Show how many comments...</option>
<option value="5">5</option>
<option value="10">10</option>

<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="40">40</option>
</select>

</form>

Then save.

Open usercp.php

Find:

// ############################### start reputation ###############################

Add below:

$repcount=$_POST['repcount'];
if ($repcount=="")
{
$repcount=5;
}

At the bottom of the query a few lines down, find:
ORDER BY reputation.dateline DESC

And replace the line below that with:
LIMIT 0, $repcount

HiDeo
10-31-2004, 12:13 PM
Nice idea, thanks for the hack !

The Keeper
10-31-2004, 12:26 PM
Here's a pic of how it looks in the UserCP

It was only knocked up in minutes, but if someone wants to convert it to use phrases and use a bit more error checking/security on the $repcount variable, feel free.

Paul M
10-31-2004, 01:48 PM
You can change it from 5 to whatever you like in the reputaion options in the ACP - we use 100 :)

The Keeper
10-31-2004, 03:40 PM
Yeah, but that's a static figure all users have to have. This way allows any user to quickly change it themselves without having to ask an admin to change the figure for the whole board. ;)

Phalynx
10-31-2004, 04:47 PM
Nice one, thanks for sharing.

Amaranth
05-12-2006, 08:35 AM
This looks promising, but following your instructions gives me this error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/2/g/guildwarsnorge/www/forum/usercp.php on line 125

I'm running vB v3.5.3, what modifications would I need to make to get this to work?

711
04-01-2007, 08:17 PM
Would this work in 3.6.x?

If not, is there a port of this mod somewhere?

testebr
04-03-2007, 05:38 PM
Can anyone upgrade this to work in 3.6.x?

lhforums
12-21-2007, 09:12 PM
Has anyone done this in 3.6.x yet? This looks like exactly what my users are requesting.