x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Memberlist Sorting

Changes are made at your own risk and are not guaranteed to work. Always make backups of the database and files prior to implementing hacks. Make a special backup of the file and/or template you are modifying so that you can roll back quickly.

Hacks are dangerous and can cause your site to stop working. They make later updates to ExpressionEngine more difficult; you should track your hacks for post-update re-implementation. 

Most hacks are unnecessary, please review the Development Documentation for information on expanding ExpressionEngine via Modules, Extensions, and Plugins.

Hacks are never officially supported.

Question:

In the public memberlist, how can I add an option to sort by last visit?

Answer:

Modify the file called mod.member_memberlist.php:

Around line 919, add the following code:

//------------------------------------ 
// Add sort by last visit date 
//------------------------------------ 
 
$selected = ($order_by == 'last_visit') ? " selected='selected' " ''
$menu .= "<option value='last_visit'".$selected.">".$LANG->line('last_visit')."</option>\n"

//------------------------------------- 
// End added code 
//------------------------------------- 

Thanks to Sue in this thread

Category:Members Category:Templates Category:Hacks

Category:EE1

Categories: