]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of git://gitorious.org/laconica/br3nda into review/master
authorCiaranG <ciaran@ciarang.com>
Wed, 8 Apr 2009 21:11:58 +0000 (22:11 +0100)
committerCiaranG <ciaran@ciarang.com>
Wed, 8 Apr 2009 21:11:58 +0000 (22:11 +0100)
actions/featured.php
classes/Notice.php
lib/featureduserssection.php
lib/util.php

index f3bade6a5ee1e07d6192a9349851ea26569561f1..86fd3f374aa37e221e691f83aaf0c78cc8195f9b 100644 (file)
@@ -107,6 +107,7 @@ class FeaturedAction extends Action
 
         $featured_nicks = common_config('nickname', 'featured');
 
+
         if (count($featured_nicks) > 0) {
 
             $quoted = array();
@@ -118,7 +119,7 @@ class FeaturedAction extends Action
             $user = new User;
             $user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted)));
             $user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1);
-            $user->orderBy('user.nickname ASC');
+            $user->orderBy(common_database_tablename('user') .'.nickname ASC');
 
             $user->find();
 
@@ -145,4 +146,4 @@ class FeaturedAction extends Action
                               $this->page, 'featured');
         }
     }
-}
\ No newline at end of file
+}
index 44a6aeb986914b4ab6c6c8ccc8987d2a67443329..5fa0d79a1639ddb03eba10832391500d6902f5f7 100644 (file)
@@ -67,6 +67,8 @@ class Notice extends Memcached_DataObject
         $this->blowSubsCache(true);
 
         $this->query('BEGIN');
+        //Null any notices that are replies to this notice
+        $this->query(sprintf("UPDATE notice set reply_to = null WHERE reply_to = %d", $this->id));
         $related = array('Reply',
                          'Fave',
                          'Notice_tag',
index aed94b1a555e845b36c7fd23513fd90b0a9756cc..4b9238d471c5775d4f3c8b4bd2c47b2166400724 100644 (file)
@@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection
             $quoted[] = "'$nick'";
         }
 
+        $table = "user";
+        if(common_config('db','quote_identifiers')) {
+          $table = '"' . $table . '"';
+        }
+
         $qry = 'SELECT profile.* ' .
-          'FROM profile JOIN user on profile.id = user.id ' .
-          'WHERE user.nickname in (' . implode(',', $quoted) . ') ' .
+            'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' .
+          'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' .
           'ORDER BY profile.created DESC ';
 
         $limit = PROFILES_PER_SECTION + 1;
index b17a44bd8538255fd348ed17433e24268ecd4bac..675ff51f016dd0a53b87b5cc9c227b5e5a5f9d97 100644 (file)
@@ -1321,3 +1321,16 @@ function common_compatible_license($from, $to)
     // XXX: better compatibility check needed here!
     return ($from == $to);
 }
+
+/**
+ * returns a quoted table name, if required according to config
+ */
+function common_database_tablename($tablename)
+{
+  
+  if(common_config('db','quote_identifiers')) {
+      $tablename = '"'. $tablename .'"';
+  }
+  //table prefixes could be added here later
+  return $tablename;
+}
\ No newline at end of file