]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Uploaded content now displays in overlay (and removed var_dump crap)
authorRobin Millette <millette@controlyourself.ca>
Wed, 10 Jun 2009 18:17:46 +0000 (14:17 -0400)
committerRobin Millette <millette@controlyourself.ca>
Wed, 10 Jun 2009 18:17:46 +0000 (14:17 -0400)
classes/Notice.php
lib/noticeform.php
lib/noticelist.php

index 0b1017e126d95e0da7dd79c102a19e2474ed333c..530c6daa7d45eaf68e78084f93e9082ec5444901 100644 (file)
@@ -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;
     }
 
index 5d7cf194ee069d102ea701e4650c5bd95684b1a9..3212f382ad56e1a33d53263d3c8783df52e34456 100644 (file)
@@ -148,6 +148,7 @@ class NoticeForm extends Form
         $this->out->element('dd', array('id' => 'notice_text-count'),
                             '140');
         $this->out->elementEnd('dl');
+        $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
         $this->out->element('label', array('for' => 'notice_data-attach'), _('Attach'));
         $this->out->element('input', array('id' => 'notice_data-attach',
                                            'type' => 'file',
@@ -157,7 +158,6 @@ class NoticeForm extends Form
             $this->out->hidden('notice_return-to', $this->action, 'returnto');
         }
         $this->out->hidden('notice_in-reply-to', $this->action, 'inreplyto');
-        $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
     }
 
     /**
index 9ace341d8018b632103583bf88641ed1896ed806..fadc238a4db17685668b16e68631d3959045a61a 100644 (file)
@@ -366,7 +366,7 @@ class NoticeListItem extends Widget
         }
         $uploaded = $this->notice->getUploadedAttachment();
         if ($uploaded) {
-            $this->out->element('a', array('href' => $uploaded, 'class' => 'attachment'), $uploaded);
+            $this->out->element('a', array('href' => $uploaded[0], 'class' => 'attachment', 'id' => 'attachment-' . $uploaded[1]), $uploaded[0]);
         }
         $this->out->elementEnd('p');
     }