From e120cb1a5300f2e38820aa05ec9ac21073a934e0 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Wed, 10 Jun 2009 14:17:46 -0400 Subject: Uploaded content now displays in overlay (and removed var_dump crap) --- classes/Notice.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index 0b1017e12..530c6daa7 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -279,13 +279,11 @@ class Notice extends Memcached_DataObject 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"'; + $query = 'select file.url as up, file.id as i 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); + $ret = array($post->up, $post->i); $post->free(); -// die(); return $ret; } -- cgit v1.2.3-54-g00ecf From 4699fa7936be41e05a950b357c6b46949ad7c74d Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Wed, 10 Jun 2009 15:24:25 -0400 Subject: Now correctly identifiying notices with uploaded content. --- classes/Notice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index e4dade780..eb51bbd8f 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -274,7 +274,11 @@ class Notice extends Memcached_DataObject $query = 'select file.url as up, file.id as i 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 = array($post->up, $post->i); + if (empty($post->up) || empty($post->i)) { + $ret = false; + } else { + $ret = array($post->up, $post->i); + } $post->free(); return $ret; } -- cgit v1.2.3-54-g00ecf