]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Part of request #2928950: Add config option to allow sorting by bookmark creation...
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 16 Jan 2010 10:20:45 +0000 (10:20 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 16 Jan 2010 10:20:45 +0000 (10:20 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@594 b3834d28-1941-0410-a4f8-b48e95affb8f

data/config.default.php
doc/ChangeLog
src/SemanticScuttle/Service/Bookmark.php

index 8dd61a5bdfe36a5fe0355a27b7207a4fec8553ef..c3c3b583ccd69ef99afccea650847a12a9103647 100644 (file)
@@ -378,6 +378,16 @@ $defaultRecentDays = 14;
  */
 $defaultOrderBy = 'date_desc';
 
+/**
+ * Database field to use when sorting by date.
+ * Options here are 'bModified' to sort after
+ * modification date, and 'bDatetime' to sort
+ * after creation date
+ *
+ * @var string
+ */
+$dateOrderField = 'bModified';
+
 /**
  * Number of entries that are shown in
  * the RSS feed by default.
index 7b5803066cc04d0444967a01129b8b940df4a548..4b1c30b29c1b0a5320e0acc4b9e7d44a7edb9c9c 100644 (file)
@@ -7,6 +7,8 @@ ChangeLog for SemantiScuttle
 - Implement part of request #2928950:
   - User adjustable entry count: rss.php?count=20
   - Fix HTTP content type header for RSS
+  - Add config option to allow sorting by bookmark creation date
+    instead of modification date
 
 0.95.1 - 2009-11-16
 -------------------
index d0aba0ba2903714d077c28ed9c4276fb848576f3..cb53cb1ea7a89a0fe115c04c05d376b0e1666c7b 100644 (file)
@@ -693,7 +693,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         switch($sortOrder) {
         case 'date_asc':
-            $query_5 .= ' ORDER BY B.bModified ASC ';
+            $query_5 .= ' ORDER BY B.' . $GLOBALS['dateOrderField'] . ' ASC ';
             break;
         case 'title_desc':
             $query_5 .= ' ORDER BY B.bTitle DESC ';
@@ -714,7 +714,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
             $query_5 .= ' ORDER BY B.bAddress ASC ';
             break;
         default:
-            $query_5 .= ' ORDER BY B.bModified DESC ';
+            $query_5 .= ' ORDER BY B.' . $GLOBALS['dateOrderField'] . ' DESC ';
         }
 
         // Handle the parts of the query that depend on any tags that are present.