From 81639ff61574c38769c3693bec6054b1b27bfefc Mon Sep 17 00:00:00 2001
From: Matthew Exon <git.mexon@spamgourmet.com>
Date: Sat, 11 Jan 2025 19:38:29 +0100
Subject: [PATCH] Ratioed: fix sorting by columns

---
 ratioed/templates/ratioed.tpl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ratioed/templates/ratioed.tpl b/ratioed/templates/ratioed.tpl
index 5d92bff2..d634993e 100644
--- a/ratioed/templates/ratioed.tpl
+++ b/ratioed/templates/ratioed.tpl
@@ -22,9 +22,9 @@
 					</th>
 					<th></th>
 					{{foreach $th_users as $k=>$th}}
-						{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
+						{{if $k < 2 || $order_users == $th.1 || ($k==4 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.5.1])) }}
 						<th class="th-{{$k}}">
-							<a href="{{$baseurl}}/moderation/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
+							<a href="{{$baseurl}}/ratioed?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
 								{{if $order_users == $th.1}}
 									{{if $order_direction_users == "+"}}
 									&#8595;
@@ -66,11 +66,7 @@
 					<td>{{$u.login_date}}</td>
 				{{/if}}
 
-				{{if $order_users == $th_users.4.1}}
-					<td>{{$u.lastitem_date}}</td>
-				{{/if}}
-
-				{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+				{{if $order_users == $th_users.5.1}}
 					<td>
 						<i class="fa
 							{{if $u.page_flags_raw==0}}fa-user{{/if}}		{{* PAGE_NORMAL *}}
@@ -94,6 +90,10 @@
 					</td>
 				{{/if}}
 
+				{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.5.1]) }}
+					<td>{{$u.lastitem_date}}</td>
+				{{/if}}
+
 					<td class="text-right">
 						<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
 					</td>