]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only show photo uploads for logged in users
authorMax Shinn <trombonechamp@gmail.com>
Mon, 27 Dec 2010 23:12:25 +0000 (17:12 -0600)
committerMax Shinn <trombonechamp@gmail.com>
Mon, 27 Dec 2010 23:12:25 +0000 (17:12 -0600)
plugins/GNUsocialPhotos/actions/photo.php
plugins/GNUsocialPhotos/lib/photonav.php

index 4f194b163476a83eebf52f40da324796e2f51bba..663d75a7345c48f8d1b4da3582085764acd40b68 100644 (file)
@@ -92,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->photo->notice_id} div { display: none } #notice-{$this->photoid} ol li div { display: inline }");
+        $this->element('style', array(), "#notice-{$this->photo->notice_id} div { display: none } #notice-{$this->photo->notice_id} ol li div { display: inline }");
         $this->conversation->show();
     }
 }
index 217392907ee58ee10d228ab9231dbf92aab6baf1..180f0ad20f34c1f0718f3e8be94ee5076944785e 100644 (file)
@@ -21,6 +21,7 @@
  *
  * @package   GNU Social
  * @author    Ian Denhardt <ian@zenhack.net>
+ * @author    Max Shinn <trombonechamp@gmail.com>
  * @copyright 2010 Free Software Foundation, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  */
@@ -50,9 +51,12 @@ class GNUsocialPhotoNav extends Widget {
 
         $this->out->menuItem(common_local_url('photos', array('nickname' => $this->nickname)),
             _('Photos'));
-        
-        $this->out->menuItem(common_local_url('photoupload', array()),
-            _('Upload Photos'));
+
+        $user = common_current_user();
+        if (!empty($user)) {
+            $this->out->menuItem(common_local_url('photoupload', array()),
+                _('Upload Photos'));
+        }
 
         $this->out->elementEnd('ul');
     }