Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Feb 15, 2005 12:47 am Reply with quote

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
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Feb 22, 2005 6:47 am Reply with quote

Same as the above!

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
trunks
Newbie
Newbie



Joined: May 21, 2008
Posts: 13
Location: United Kingdom

PostPosted: Tue Jan 13, 2009 10:21 am Reply with quote

Is this compatible with RN and 7.6+?

_________________
www.PHP-Clans.com & www.ClanPad.com | Complete Clan Solutions 
View user's profile Send private message Visit poster's website MSN Messenger
kguske
Community Giant



Joined: Dec 11, 2005
Posts: 32

PostPosted: Tue Jan 13, 2009 10:40 am Reply with quote

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 
View user's profile Send private message
trunks
Newbie
Newbie



Joined: May 21, 2008
Posts: 13
Location: United Kingdom

PostPosted: Tue Jan 13, 2009 5:19 pm Reply with quote

Thanks, is there any confirmation for this? as an update would not be possible as my site is too heavily modified. Sad

_________________
www.PHP-Clans.com & www.ClanPad.com | Complete Clan Solutions 
View user's profile Send private message Visit poster's website MSN Messenger
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jan 13, 2009 5:52 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
trunks
Newbie
Newbie



Joined: May 21, 2008
Posts: 13
Location: United Kingdom

PostPosted: Tue Jan 13, 2009 5:56 pm Reply with quote

That clears up my question perfectly, sorry if i wasn't so clear.

-Trunks

_________________
www.PHP-Clans.com & www.ClanPad.com | Complete Clan Solutions 
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch