[geeklog-cvs] geeklog: Prefer SQL keywords in uppercase

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Mar 1 03:10:57 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b1a61ff147cb
changeset: 6808:b1a61ff147cb
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Feb 28 22:58:46 2009 +0100
description:
Prefer SQL keywords in uppercase

diffstat:

4 files changed, 8 insertions(+), 8 deletions(-)
plugins/calendar/functions.inc    |    2 +-
plugins/polls/functions.inc       |    6 +++---
plugins/staticpages/functions.inc |    4 ++--
public_html/lib-common.php        |    4 ++--

diffs (84 lines):

diff -r 542d249e5af4 -r b1a61ff147cb plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc	Sat Feb 28 22:43:04 2009 +0100
+++ b/plugins/calendar/functions.inc	Sat Feb 28 22:58:46 2009 +0100
@@ -1295,7 +1295,7 @@
     $display = '';
 
     // Top Ten Events
-    $result = DB_query("SELECT eid,title,hits from {$_TABLES['events']} WHERE (hits > 0)" . COM_getPermSQL ('AND') . " ORDER BY hits DESC LIMIT 10");
+    $result = DB_query("SELECT eid,title,hits FROM {$_TABLES['events']} WHERE (hits > 0)" . COM_getPermSQL ('AND') . " ORDER BY hits DESC LIMIT 10");
     $nrows  = DB_numRows($result);
     if ($nrows > 0) {
         $header_arr = array(
diff -r 542d249e5af4 -r b1a61ff147cb plugins/polls/functions.inc
--- a/plugins/polls/functions.inc	Sat Feb 28 22:43:04 2009 +0100
+++ b/plugins/polls/functions.inc	Sat Feb 28 22:58:46 2009 +0100
@@ -220,7 +220,7 @@
 
     $retval = '';
 
-    $result = DB_query ("SELECT pid,topic,voters from {$_TABLES['polltopics']} WHERE (voters > 0)" . COM_getPermSQL ('AND') . " ORDER BY voters DESC LIMIT 10");
+    $result = DB_query ("SELECT pid,topic,voters FROM {$_TABLES['polltopics']} WHERE (voters > 0)" . COM_getPermSQL ('AND') . " ORDER BY voters DESC LIMIT 10");
     $nrows  = DB_numRows ($result);
 
     if ($nrows > 0) {
@@ -638,7 +638,7 @@
 
     $retval = '';
 
-    DB_query("DELETE FROM {$_TABLES['pollvoters']} WHERE date < unix_timestamp() - {$_PO_CONF['polladdresstime']}");
+    DB_query("DELETE FROM {$_TABLES['pollvoters']} WHERE date < UNIX_TIMESTAMP() - {$_PO_CONF['polladdresstime']}");
 
     if(!empty($pid)) {
         if(!isset($_COOKIE["poll-".$pid]) && !POLLS_ipAlreadyVoted($pid) && ($Q['is_open'] == 1)) {
@@ -647,7 +647,7 @@
             $retval .= POLLS_pollResults($pid, $size);
         }
     } else {
-        $result = DB_query("SELECT pid,topic,is_open from {$_TABLES['polltopics']} WHERE display = 1 ORDER BY date DESC");
+        $result = DB_query("SELECT pid,topic,is_open FROM {$_TABLES['polltopics']} WHERE display = 1 ORDER BY date DESC");
         $nrows = DB_numRows($result );
 
         $title = DB_getItem($_TABLES['blocks'], 'title', "name='poll_block'");
diff -r 542d249e5af4 -r b1a61ff147cb plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Sat Feb 28 22:43:04 2009 +0100
+++ b/plugins/staticpages/functions.inc	Sat Feb 28 22:58:46 2009 +0100
@@ -10,7 +10,7 @@
 // | API method and 2) implements all the common code needed by the Static     |
 // | Pages' PHP files.                                                         |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2008 by the following authors:                         |
+// | Copyright (C) 2000-2009 by the following authors:                         |
 // |                                                                           |
 // | Authors: Tony Bibbs       - tony AT tonybibbs DOT com                     |
 // |          Tom Willett      - twillett AT users DOT sourceforge DOT net     |
@@ -644,7 +644,7 @@
     global $_CONF, $_TABLES, $LANG_STATIC;
 
     if (SEC_hasRights ('staticpages.edit,staticpages.delete', 'OR')) {
-        $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']}" . COM_getPermSQL ('WHERE', 0, 3));
+        $result = DB_query ("SELECT COUNT(*) AS cnt FROM {$_TABLES['staticpage']}" . COM_getPermSQL ('WHERE', 0, 3));
         $A = DB_fetchArray ($result);
         $total_pages = $A['cnt'];
         return array ($LANG_STATIC['staticpages'], $_CONF['site_admin_url'] . '/plugins/staticpages/index.php', $total_pages);
diff -r 542d249e5af4 -r b1a61ff147cb public_html/lib-common.php
--- a/public_html/lib-common.php	Sat Feb 28 22:43:04 2009 +0100
+++ b/public_html/lib-common.php	Sat Feb 28 22:58:46 2009 +0100
@@ -1842,7 +1842,7 @@
 
     $curdate = date( "Y-m-d H:i:s", time() );
 
-    if( DB_getItem( $_TABLES['stories'], 'count(*)', "featured = 1 AND draft_flag = 0 AND date <= '$curdate'" ) > 1 )
+    if( DB_getItem( $_TABLES['stories'], 'COUNT(*)', "featured = 1 AND draft_flag = 0 AND date <= '$curdate'" ) > 1 )
     {
         // OK, we have two featured stories, fix that
 
@@ -2495,7 +2495,7 @@
             }
             else
             {
-                $nresult = DB_query( "SELECT COUNT(*) AS count from {$_TABLES['stories']} WHERE" . $topicsql . COM_getPermSql( 'AND' ));
+                $nresult = DB_query( "SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE" . $topicsql . COM_getPermSql( 'AND' ));
                 $N = DB_fetchArray( $nresult );
                 $numstories = $N['count'];
             }



More information about the geeklog-cvs mailing list