]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
only get tags for this profile list type
authorEvan Prodromou <evan@prodromou.name>
Mon, 24 Nov 2008 03:15:49 +0000 (22:15 -0500)
committerEvan Prodromou <evan@prodromou.name>
Mon, 24 Nov 2008 03:15:49 +0000 (22:15 -0500)
darcs-hash:20081124031549-84dde-c537cb25f301ac3368440d4d5f583ea3d713ac2c.gz

classes/Profile.php
lib/gallery.php

index 5f762df80a298f7dc470e66c37a2719bb41ff4d6..794dc1de93c8857e2f23c92f30930342fb7890c2 100644 (file)
@@ -145,20 +145,4 @@ class Profile extends Memcached_DataObject
                }
                return NULL;
        }
-       
-       # Get list of tags we tagged other users with
-       
-       function getAllTags() {
-               $profile_tag = new Notice_tag();
-               $profile_tag->query('SELECT DISTINCT(tag) ' .
-                                                       'FROM profile_tag ' .
-                                                       'WHERE tagger = ' . $this->id . ' ' .
-                                                       'AND tagger != tagged');
-               $tags = array();
-               while ($profile_tag->fetch()) {
-                       $tags[] = $profile_tag->tag;
-               }
-               $profile_tag->free();
-               return $tags;
-       }
 }
index fd13ad1459b01636598918609a7892c315ff8a65..bf04eaa34b5e3ef2f22a91601468e0ca4926a295 100644 (file)
@@ -81,7 +81,8 @@ class GalleryAction extends Action {
 
        function show_tags_dropdown($profile) {
                $tag = $this->trimmed('tag');
-               $tags = $profile->getAllTags();
+               list($lst, $usr) = $this->fields();
+               $tags = $this->get_all_tags($profile, $lst, $usr);
                $content = array();
                foreach ($tags as $t) {
                        $content[$t] = $t;
@@ -241,4 +242,22 @@ class GalleryAction extends Action {
                
                common_element_end('p');
        }
+       
+       # Get list of tags we tagged other users with
+
+       function get_all_tags($profile, $lst, $usr) {
+               $profile_tag = new Notice_tag();
+               $profile_tag->query('SELECT DISTINCT(tag) ' .
+                                                       'FROM profile_tag, subscription ' .
+                                                       'WHERE tagger = ' . $profile->id . ' ' .
+                                                       'AND ' . $usr . ' = ' . $profile->id . ' ' .
+                                                       'AND ' . $lst . ' = tagged ' .
+                                                       'AND tagger != tagged');
+               $tags = array();
+               while ($profile_tag->fetch()) {
+                       $tags[] = $profile_tag->tag;
+               }
+               $profile_tag->free();
+               return $tags;
+       }
 }
\ No newline at end of file