summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorCiaranG <ciaran@ciarang.com>2009-07-19 08:05:53 +0100
committerCiaranG <ciaran@ciarang.com>2009-07-19 08:05:53 +0100
commit1139f7cad59aa562eb1a7f7691c00392206e73fd (patch)
treeb97dacb336af0638e8b1583af283269d5645a4c7 /classes
parentc74943e5985c7a096db3c1fc8f34a6e97c8c1efa (diff)
parent788dd66dbe75db5d09c0cd5b33bb3347233cbd15 (diff)
Merge commit 'br3nda/0.8.x-pgfixes' into 0.8.x
Diffstat (limited to 'classes')
-rw-r--r--classes/Fave.php2
-rw-r--r--classes/Notice.php10
-rw-r--r--classes/User_group.php7
3 files changed, 13 insertions, 6 deletions
diff --git a/classes/Fave.php b/classes/Fave.php
index c3ec62dcf..4b28d06b4 100644
--- a/classes/Fave.php
+++ b/classes/Fave.php
@@ -79,7 +79,7 @@ class Fave extends Memcached_DataObject
$qry .= 'ORDER BY modified DESC ';
if (!is_null($offset)) {
- $qry .= "LIMIT $offset, $limit";
+ $qry .= "LIMIT $limit OFFSET $offset";
}
$fav->query($qry);
diff --git a/classes/Notice.php b/classes/Notice.php
index 0359c310d..101fadb67 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -873,7 +873,7 @@ class Notice extends Memcached_DataObject
if ($cnt > 0) {
$qry .= ', ';
}
- $qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") ';
+ $qry .= '('.$id.', '.$this->id.', '.$source.", '".$this->created. "') ";
$cnt++;
if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) {
Notice_inbox::gc($id);
@@ -899,10 +899,14 @@ class Notice extends Memcached_DataObject
{
$user = new User();
+ if(common_config('db','quote_identifiers'))
+ $user_table = '"user"';
+ else $user_table = 'user';
+
$qry =
'SELECT id ' .
- 'FROM user JOIN subscription '.
- 'ON user.id = subscription.subscriber ' .
+ 'FROM '. $user_table .' JOIN subscription '.
+ 'ON '. $user_table .'.id = subscription.subscriber ' .
'WHERE subscription.subscribed = %d ';
$user->query(sprintf($qry, $this->profile_id));
diff --git a/classes/User_group.php b/classes/User_group.php
index 27b444705..b1ab1c2d3 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -275,11 +275,14 @@ class User_group extends Memcached_DataObject
// XXX: cache this
$user = new User();
+ if(common_config('db','quote_identifiers'))
+ $user_table = '"user"';
+ else $user_table = 'user';
$qry =
'SELECT id ' .
- 'FROM user JOIN group_member '.
- 'ON user.id = group_member.profile_id ' .
+ 'FROM '. $user_table .' JOIN group_member '.
+ 'ON '. $user_table .'.id = group_member.profile_id ' .
'WHERE group_member.group_id = %d ';
$user->query(sprintf($qry, $this->id));