sting
Involved


Joined: Sep 23, 2003
Posts: 456
Location: Somewhere out there...
|
Posted:
Tue Jan 31, 2006 10:46 am |
|
This is a tweak to the Memberlist module that I want to throw out there for consideration on future RavenNuke releases - since there is only one or two themes that go out with RN, it shouldn't be too tough to implement but it does touch the core code somewhat, and I know the basic feeling about that is that we want to do it as little as possible.
That being said - for those users who utilize the points tweak, this is a nice way of easily viewing a users's points in a module that is standard with nuke.
Would appreciate your thoughts on the subject.
-Begin Post-
Posted to premium members at Only registered users can see links on this board! Get registered or login! over the weekend:
Someone asked this as a question at NukeCops. For now this is what I have (and it works but I have an issue with one part of the code and want to fix it at some point to reflect a variable instead of a constant ( reference $lang['Points']) below.
The trouble with this is that it is THEME DEPENDENT. Theme templates for the memberlist have to be edited individually to allow for this to work.
To add points to the Member List:
in the Memberlist module's index.php
Find
Code:
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm,
user_avatar, user_avatar_type, user_allowavatar
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY $order_by";
|
Change to
Code:
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm,
user_avatar, user_avatar_type, user_allowavatar, points
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY $order_by";
|
Find
Code:
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
|
After and on a new line insert
Code:
$points = ($row['points']);
|
Find
After on a new line insert
Code:
'POINTS' => $points,
|
Find
Code:
$template->assign_vars(array(
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
'L_EMAIL' => $lang['Email'],
'L_WEBSITE' => $lang['Website'],
'L_FROM' => $lang['Location'],
'L_ORDER' => $lang['Order'],
'L_PRIVATE_MESSAGE' => $lang['Private_Message'],
'L_SORT' => $lang['Sort'],
'L_SUBMIT' => $lang['Sort'],
'L_AIM' => $lang['AIM'],
'L_YIM' => $lang['YIM'],
'L_MSNM' => $lang['MSNM'],
'L_ICQ' => $lang['ICQ'],
'L_JOINED' => $lang['Joined'],
'L_POSTS' => $lang['Posts'],
'L_PM' => $lang['Private_Message'],
|
And Change to
Code:
$template->assign_vars(array(
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
'L_EMAIL' => $lang['Email'],
'L_WEBSITE' => $lang['Website'],
'L_FROM' => $lang['Location'],
'L_ORDER' => $lang['Order'],
'L_PRIVATE_MESSAGE' => $lang['Private_Message'],
'L_SORT' => $lang['Sort'],
'L_SUBMIT' => $lang['Sort'],
'L_AIM' => $lang['AIM'],
'L_YIM' => $lang['YIM'],
'L_MSNM' => $lang['MSNM'],
'L_ICQ' => $lang['ICQ'],
'L_JOINED' => $lang['Joined'],
'L_POSTS' => $lang['Posts'],
'L_POINTS' =>"Points",
'L_PM' => $lang['Private_Message'],
|
Still working on finding the "Points" area where $lang['Points'] is supposed to go, but setting it to "Points" hardwires it for now. . .
In your theme template (memberlist.tpl or memberlistbody.tpl)
Find
Code:
<th class="thTop" nowrap="nowrap">{L_POSTS}</th>
|
After and on a new line type
Code:
<th class="thTop" nowrap="nowrap">{L_POINTS}</th>
|
Find
Code:
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POSTS}</span></td>
|
AFter and on a new line insert
Code:
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POINTS}</span></td>
|
Find
Code:
<td class="catbottom" colspan="8" height="28"> ;;</td>
|
and change to
Code:
<td class="catbottom" colspan="9" height="28"> ;;</td>
|
Note: colspan is the key here - if your theme has 7, make it 8 (just add 1 for the new column that was added)
It works, and its not too problematic to change the files.
-sting |
|
|
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Tue Feb 07, 2006 11:09 pm |
|
I'm not big on adding phpBB mods that require theme mods since it defeats one of the goals for compatibility with Nuke addons (modules, blocks, themes, etc.). That said, there are a few phpBB mods that don't require theme mods and some that good enough to make theme consideration secondary.
In this case, I've not been a big fan of the whole karma / points stuff, mainly because I don't need / use it on any of the sites I support... |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|