Thread Rating:
  • 6 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TUT] Adding Reputation as a Sort Option in Memberlist
#1
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.

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

Now for template edits.

Edit "memberlist" template.

Find
Code:
colspan="5"

Change to
Code:
colspan="6"

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

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

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

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

Edit "memberlist_user" template

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

Afterwards add
Code:
<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.
Reply
#2
Thank you Labrocca.
I'm not here much. Check out my Blog, or Twitter
Reply
#3
Wow =D I love this! ^_^ Thanks Labrocca!
Code:
.ninja {
  color: black;
  visibility: hidden;
  animation-duration: 0.00001s;
}
Reply
#4
Thanks Labrocca.

You could also add it to:

Board Settings > Member List > Default Sort Field
No longer involved in the MyBB project.
Reply
#5
Awesome, very nice! Thanks.
Reply
#6
This user has been denied support. This user has been denied support.
It works for 1.6.x as well.

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

On `memberlist` template, find;
PHP Code:
<td class="thead" colspan="6"
and Change it to;
PHP Code:
<td class="thead" colspan="7"
Reply
#9
That's an awesome TUT Omni. <3
[Image: Kewlz.jpg]

^^ Click to check my rank. Big Grin
Reply
#10
very nice dear ^_^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)