| Author |
Message |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
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: 1294
|
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 |
|
|
 |
trunks
Newbie


Joined: May 21, 2008
Posts: 13
Location: United Kingdom
|
Posted:
Tue Jan 13, 2009 10:21 am |
|
|
|
 |
kguske
Newbie


Joined: Dec 11, 2005
Posts: 28
|
Posted:
Tue Jan 13, 2009 10:40 am |
|
In RN 2.3, a new last visited field was added. The original last visited (user_lastvisit) field was only updated when the user visited the forum. The new field (lastsitevisit) is updated whenever a user visits the site.
As far as the data, this should be compatible with RN and 7.6+. But you might want to use the lastsitevisit field instead of user_lastvisit field for RN 2.3+. |
_________________ nukeSEO.com - PHPNuke SEO search engine optimization and other professional tools for PHP-Nuke |
|
|
 |
trunks
Newbie


Joined: May 21, 2008
Posts: 13
Location: United Kingdom
|
Posted:
Tue Jan 13, 2009 5:19 pm |
|
Thanks, is there any confirmation for this? as an update would not be possible as my site is too heavily modified.  |
_________________ www.PHP-Clans.com & www.ClanPad.com | Complete Clan Solutions |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Tue Jan 13, 2009 5:52 pm |
|
trunks, not sure what you are asking. This is just a "hack" that was put out there almost four years ago to demonstrate the process.
I really have no intentions upon updating it as it was just that: to show how it can be done. The same files are in use today, so one just needs to figure out the right code to use now. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
trunks
Newbie


Joined: May 21, 2008
Posts: 13
Location: United Kingdom
|
Posted:
Tue Jan 13, 2009 5:56 pm |
|
|
|
 |
|
|