summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-05-15 23:17:57 +0000
committerZach Copley <zach@controlyourself.ca>2009-05-15 23:17:57 +0000
commit811cef10083f8b7824b2fd8140f940bf13b54c8d (patch)
tree3d403c3c7e08a79a3a87c5bafacfb3f08fcd4211 /classes/Notice.php
parent3f44f94c3c3f0c3d46f5025854431f0d2825bb6c (diff)
parent6c4e26fe61a3c1cada4775a42a929eb884150b2d (diff)
Merge branch '0.8.x' into fbconnect
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 382d160ab..30508070e 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -124,8 +124,6 @@ class Notice extends Memcached_DataObject
$profile = Profile::staticGet($profile_id);
- $final = common_shorten_links($content);
-
if (!$profile) {
common_log(LOG_ERR, 'Problem saving notice. Unknown user.');
return _('Problem saving notice. Unknown user.');
@@ -167,8 +165,8 @@ class Notice extends Memcached_DataObject
$notice->reply_to = $reply_to;
$notice->created = common_sql_now();
- $notice->content = $final;
- $notice->rendered = common_render_content($final, $notice);
+ $notice->content = $content;
+ $notice->rendered = common_render_content($content, $notice);
$notice->source = $source;
$notice->uri = $uri;
@@ -279,6 +277,16 @@ class Notice extends Memcached_DataObject
return true;
}
+ function hasAttachments() {
+ $post = clone($this);
+ $query = "select count(file_id) as n_attachments from file join file_to_post on (file_id = file.id) join notice on (post_id = notice.id) where post_id = " . $post->escape($this->id);
+ $post->query($query);
+ $post->fetch();
+ $n_attachments = intval($post->n_attachments);
+ $post->free();
+ return $n_attachments;
+ }
+
function blowCaches($blowLast=false)
{
$this->blowSubsCache($blowLast);