[geeklog-cvs] geeklog: added pgsql compatible query

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jan 30 03:39:59 EST 2010


changeset 7677:7986a35165e5
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7986a35165e5
user: stan
date: Tue Jan 26 19:40:48 2010 -0500
description:
added pgsql compatible query

diffstat:

 plugins/staticpages/functions.inc |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 109f4bc9d010 -r 7986a35165e5 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Tue Jan 26 19:40:19 2010 -0500
+++ b/plugins/staticpages/functions.inc	Tue Jan 26 19:40:48 2010 -0500
@@ -1502,13 +1502,20 @@
     if ($_SP_CONF['includephp'] == 0) {
         $extra_sql .=' AND sp_php = 0';
     }
-    
-    $sql = "SELECT sp_id, sp_title 
+    $sql = array();
+    $sql['mysql'] = "SELECT sp_id, sp_title 
         FROM {$_TABLES['staticpage']} 
         WHERE sp_content IS NOT NULL AND (draft_flag = 0) AND (sp_date >= (DATE_SUB(NOW(), INTERVAL {$_SP_CONF['newstaticpagesinterval']} SECOND))) 
         {$extra_sql} 
         " . COM_getPermSQL('AND') . " 
         ORDER BY sp_date DESC LIMIT 15";
+        
+    $sql['pgsql'] = "SELECT sp_id, sp_title 
+        FROM {$_TABLES['staticpage']} 
+        WHERE sp_content IS NOT NULL AND (draft_flag = 0) AND (sp_date >= (NOW() - INTERVAL '{$_SP_CONF['newstaticpagesinterval']} SECONDS')) 
+        {$extra_sql} 
+        " . COM_getPermSQL('AND') . " 
+        ORDER BY sp_date DESC LIMIT 15";
 
     $result = DB_query($sql);
     $nrows = DB_numRows($result);



More information about the geeklog-cvs mailing list