]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GNUsocialPhotos/actions/photo.php
Usability with photos tab
[quix0rs-gnu-social.git] / plugins / GNUsocialPhotos / actions / photo.php
index 3c2014eb8cce8787bcf5c406b04df315ed0bc8f8..64d3e16a17b4f4a7b21c1c29b008a310a824960f 100644 (file)
@@ -44,18 +44,13 @@ class PhotoAction extends Action
         parent::prepare($args);
 
         $args = $this->returnToArgs();
-        $username = $args[1]['nickname'];
                $this->photoid = $args[1]['photoid'];
-        if (common_valid_profile_tag($username) == 0) {
-            $this->user = null;
-        } else {
-            $this->user = Profile::staticGet('nickname', $username);
-        }
                $this->photo = GNUsocialPhoto::staticGet('notice_id', $this->photoid);
-               
                $this->notice = Notice::staticGet('id', $this->photoid);
-        $notices = Notice::conversationStream((int)$this->photoid-1, null, null); //Why do I have to do -1?
 
+        $this->user = Profile::staticGet('id', $this->notice->profile_id);
+               
+        $notices = Notice::conversationStream((int)$this->photoid-1, null, null); //Why do I have to do -1?
         $this->conversation = new ConversationTree($notices, $this);
         return true;
 
@@ -97,7 +92,7 @@ class PhotoAction extends Action
         $this->elementEnd('a');
                $this->element('p', array(), $this->photo->photo_description);
                //This is a hack to hide the top-level comment
-               //$this->element('style', array(), "#notice-{$this->photoid} div { display: none } #notice-{$this->photoid} ol li div { display: inline }");
+               $this->element('style', array(), "#notice-{$this->photoid} div { display: none } #notice-{$this->photoid} ol li div { display: inline }");
                $this->conversation->show();
     }
 }