diff --git a/contrib/event_log/main.php b/contrib/event_log/main.php index cd989b0b..67930df9 100644 --- a/contrib/event_log/main.php +++ b/contrib/event_log/main.php @@ -33,11 +33,17 @@ class EventLog extends Extension { if(isset($_GET['sort']) && in_array($_GET['sort'], array("name", "date", "ip", "event"))) { $sort = $_GET['sort']; } + + $order = "DESC"; + if(isset($_GET['order']) && in_array($_GET['order'], array("ASC", "DESC"))) { + $order = $_GET['order']; + } + $events = $database->db->GetAll(" SELECT event_log.*,users.name FROM event_log JOIN users ON event_log.owner_id = users.id WHERE date > date_sub(now(), interval 1 day) - ORDER BY $sort DESC + ORDER BY $sort $order "); $this->theme->display_page($event->page, $events); } diff --git a/contrib/event_log/theme.php b/contrib/event_log/theme.php index c1f5fe8b..d3d4cdbf 100644 --- a/contrib/event_log/theme.php +++ b/contrib/event_log/theme.php @@ -23,13 +23,25 @@ class EventLogTheme extends Themelet { - - + + - - + + "; foreach($events as $event) {
UserIPUser + + + - + IP + + + - + Entry
DateEventDate + + + - + Event + + + - +