summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-09 21:48:56 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-09 21:48:56 -0700
commited627bb4bd6424325478412055d295b185f9f662 (patch)
treefeb95836538735a5059519293143403079249648 /classes/Notice.php
parentadfb79a9bbdfb43f35c0f022c1de6118b10ce115 (diff)
parent207750e75774c823328889cb4102aad6a0b12281 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index ca67306df..895b5d2c7 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -269,6 +269,18 @@ class Notice extends Memcached_DataObject
return true;
}
+ function getUploadedAttachment() {
+ $post = clone $this;
+ $query = 'select file.url as uploaded from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"';
+ $post->query($query);
+ $post->fetch();
+ $ret = $post->uploaded;
+// var_dump($post);
+ $post->free();
+// die();
+ return $ret;
+ }
+
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($post->id);