From 28d61e15170c5ac56cbf17bb5366c358b63603ec Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 28 Mar 2017 07:21:08 +0000 Subject: [PATCH] fts : the results are now sorted by date if a date/datetime/time field is available git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3463 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- fts.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fts.php b/fts.php index 6d08154..784fc57 100644 --- a/fts.php +++ b/fts.php @@ -103,6 +103,16 @@ class fts $dbl->whereAddParenthesisClose (); $i++; } + // Look for the order by date if provided + foreach ($dbl->fields () as $field=>$params) + { + if ($params[0] == "date" || $params[0] == "datetime" || + $params[0] == "time") + { + $dbl->orderAdd ($field, "DESC"); + break; + } + } return $dbl->execute (); }