montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 952
|
Posted:
Tue Feb 15, 2005 12:47 am |
|
Hack: Add Last Visited Sort to Member List
PHP-Nuke Version: 7.5
Patchset: 2.8
Theme: fisubsilversh [if appropriate]
Mods: Approve Membership Module 6.0
Files to Modify:
- modules/Members_List/index.php
After having added the Last Visited field to the Members List I wanted a way to bring the most recently visited member to the top of the list with a Descending sort.
Updates to Make to: modules/Members_List/index.php
| Code: |
####Find####
$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']);
$mode_types = array('joined', 'username', 'location', 'posts', 'email', 'website', 'topten');
####Replace With####
$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten'], $lang['Sort_Last_Visit']);
$mode_types = array('joined', 'username', 'location', 'posts', 'email', 'website', 'topten', 'lastvisit');
####Find####
case 'topten':
$order_by = "user_posts $sort_order LIMIT 10";
break;
####Add After####
case 'lastvisit':
$order_by = "user_lastvisit $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break;
|
Updates to Make to: modules/Forums/language/lang_english/lang_main.php
| Code: |
####Find####
//
// Memberslist
//
####Add at the bottom of this sections' list of defines####
$lang['Sort_Last_Visit'] = 'Last Visit Date';
|
That about does it! Works like a champ and you can now sort ascending or descending on this added field.
Enjoy,
montego |
| |
|
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 952
|
Posted:
Tue Feb 22, 2005 6:47 am |
|
Same as the above! |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|