Commit 3fede0f4 authored by Erika "Masala" Nilsson's avatar Erika "Masala" Nilsson

frontend members list sorts by "membership activeness", then surname

parent 5896009d
......@@ -344,7 +344,7 @@ if(!class_exists('Members'))
* Get all rows from db table as an array of objects. Includes expired members etc.
* @param $orderby one of mid, firstname, surname, membersince, paiduntil, privileges or uid to order the query by.
*/
public function getAll($orderby = 'mid'){
public function getAll($orderby = 'mid', $inactiveLast = false){
global $wpdb;
switch($orderby){
case 'mid':
......@@ -361,6 +361,10 @@ if(!class_exists('Members'))
default:
$orderby = 'mid ASC';
}
if($inactiveLast === true)
$orderby = "paiduntil >= NOW() DESC, " . $orderby;
return $this->stripslashes_deep( $wpdb->get_results("SELECT * FROM $this->table ORDER BY $orderby;") );
}
......
......@@ -48,7 +48,7 @@
<?php if(has_post_thumbnail()): ?><p><?php the_post_thumbnail('post_featured'); ?></p><?php endif; ?>
<?php
the_content();
$members = $Members->getAll();
$members = $Members->getAll('surname', true);
if(!empty($members)):
?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment