MyBB Community Forums

Full Version: [TUT] Adding Reputation as a Sort Option in Memberlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This should take you 5 minutes to execute. No core files are edited.

Open inc/languages/english/memberlist.lang.php

Add this code somewhere in the middle. Doesn't matter where really.

$l['sort_by_reputation'] = "Sort by: Reputation";
$l['reputation'] = "Reputation";

Now for template edits.

Edit "memberlist" template.

Find
colspan="5"

Change to
colspan="6"

Find
<option value="postnum"{$sort_selected['postnum']}>{$lang->sort_by_posts}</option>

Afterwards Add
<option value="reputation"{$sort_selected['reputation']}>{$lang->sort_by_reputation}</option>

Find
<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->lastvisit}</strong></span></td>

Afterwards Add
<td class="tcat" width="10%" align="center"><span class="smalltext"><strong>{$lang->reputation}</strong></span></td>

Edit "memberlist_user" template

Find
<td class="{$alt_bg}" align="center">{$user['lastvisit']}</td>

Afterwards add
<td class="{$alt_bg}" align="center">{$user['reputation']}</td>

That's it.

Now keep in mind this is for default mybb templates so if this doesn't work and you have some whacky custom template I can't help you. Also on upgrades if the language files are overwritten you may need to redo your changes so watch for that after an upgrade. This also assumes you have reputation enabled for the site. If it's disabled then I don't suggest you bother with this. It's only going to show all zero's.
Thank you Labrocca.
Wow =D I love this! ^_^ Thanks Labrocca!
Thanks Labrocca.

You could also add it to:

Board Settings > Member List > Default Sort Field
Awesome, very nice! Thanks.
It works for 1.6.x as well.

Change colspan="7" to colspan="8" and other settings are the same Wink
There's no colspan="5" or colspan="7"
(2011-04-17, 06:30 PM)MarkW7 Wrote: [ -> ]There's no colspan="5" or colspan="7"

On memberlist template, find;
<td class="thead" colspan="6">
and Change it to;
<td class="thead" colspan="7">
That's an awesome TUT Omni. <3
Very nice tut!
Thanks a lot
Pages: 1 2