summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-15 15:04:58 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-15 15:04:58 -0400
commitfecb8c706dadb790c3a8c219275b4ba88e00b8ea (patch)
tree674650bcdc21627aedb97250426a554c85eca096 /classes/File.php
parent2e394ef47ce2f069e331c24586cda13bc34413aa (diff)
Attachments and their list now provide "ajax" view. Also added a few sidebars relating tags and attachments.
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/File.php b/classes/File.php
index 2ddc5deb8..e5913115b 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -54,6 +54,17 @@ class File extends Memcached_DataObject
return 'http://www.facebook.com/login.php' === $url;
}
+ function getAttachments($post_id) {
+ $query = "select file.* from file join file_to_post on (file_id = file.id) join notice on (post_id = notice.id) where post_id = " . $this->escape($post_id);
+ $this->query($query);
+ $att = array();
+ while ($this->fetch()) {
+ $att[] = clone($this);
+ }
+ $this->free();
+ return $att;
+ }
+
function saveNew($redir_data, $given_url) {
$x = new File;
$x->url = $given_url;