diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-09 21:48:56 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-09 21:48:56 -0700 |
commit | ed627bb4bd6424325478412055d295b185f9f662 (patch) | |
tree | feb95836538735a5059519293143403079249648 /classes | |
parent | adfb79a9bbdfb43f35c0f022c1de6118b10ce115 (diff) | |
parent | 207750e75774c823328889cb4102aad6a0b12281 (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 12 |
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); |