diff options
author | Eric Helgeson <erichelgeson@gmail.com> | 2009-07-21 09:20:47 -0500 |
---|---|---|
committer | Eric Helgeson <erichelgeson@gmail.com> | 2009-07-21 09:20:47 -0500 |
commit | db19d61e68fcf8398579c2c4968e73db7f7ed93b (patch) | |
tree | ca64284fb8544823de4a120bca8d45b424fb65b8 /classes/Notice.php | |
parent | c32e494c0c480e30317b0f0a8dcae7103c4ff89e (diff) | |
parent | fbb0df9f5436e956c43ace372f625f08628c000f (diff) |
Merge commit 'origin/0.8.x' into 0.9.x
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 08125cf7b..101fadb67 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -873,8 +873,11 @@ 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); + } if ($cnt >= MAX_BOXCARS) { $inbox = new Notice_inbox(); $inbox->query($qry); @@ -896,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)); |