2011-11-21, 11:14 PM
Requirements: Thank You/Like You Plugin by G33K.
Aim: This tutorial will allow you to sort members by 'Thanks Received' in your memberlist.php page.
Demo: http://www.berlingoforum.co.uk/memberlist.php
Step 1
Access the file: inc/languages/english/memberlist.lang.php
Add this code wherever you like:
Step 2
Now browse to your: ACP >> Templates & Style >> Templates >> Your Theme >> Member List Templates
First, edit your "memberlist" template.
Find:
Change to:
Find:
After this add:
Find:
After this add:
Then, edit your "memberlist_user" template.
Find:
After this add:
Step 3
Access the file: /memberlist.php
Find:
After this add:
Which should leave you with something like:
That should be everything.
Thanks to
Labrocca for his thread here which I used for part of this tutorial.
G33K for his plugin.
Aim: This tutorial will allow you to sort members by 'Thanks Received' in your memberlist.php page.
Demo: http://www.berlingoforum.co.uk/memberlist.php
Step 1
Access the file: inc/languages/english/memberlist.lang.php
Add this code wherever you like:
$l['sort_by_thanks'] = "Sort by: Thanks";
$l['thanks'] = "Thanks Received";
Step 2
Now browse to your: ACP >> Templates & Style >> Templates >> Your Theme >> Member List Templates
First, edit your "memberlist" template.
Find:
colspan="6"
Change to:
colspan="7"
Find:
<option value="postnum"{$sort_selected['postnum']}>{$lang->sort_by_posts}</option>
After this add:
<option value="thanks"{$sort_selected['thanks']}>{$lang->sort_by_thanks}</option>
Find:
<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->lastvisit}</strong></span></td>
After this add:
<td class="tcat" width="10%" align="center"><span class="smalltext"><strong>{$lang->thanks}</strong></span></td>
Then, edit your "memberlist_user" template.
Find:
<td class="{$alt_bg}" align="center">{$user['lastvisit']}</td>
After this add:
<td class="{$alt_bg}" align="center">{$user['tyl_unumrcvtyls']} in {$user['tyl_unumptyls']} posts</td>
Step 3
Access the file: /memberlist.php
Find:
case "regdate":
$sort_field = "u.regdate";
break;
After this add:
case "thanks":
$sort_field = "u.tyl_unumrcvtyls";
break;
Which should leave you with something like:
switch($mybb->input['sort'])
{
case "regdate":
$sort_field = "u.regdate";
break;
case "thanks":
$sort_field = "u.tyl_unumrcvtyls";
break;
case "lastvisit":
$sort_field = "u.lastactive";
break;
case "reputation":
$sort_field = "u.reputation";
break;
case "postnum":
$sort_field = "u.postnum";
break;
case "referrals":
$sort_field = "u.referrals";
break;
default:
$sort_field = "u.username";
$mybb->input['sort'] = 'username';
break;
}
That should be everything.
Thanks to
Labrocca for his thread here which I used for part of this tutorial.
G33K for his plugin.