]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User_group.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / classes / User_group.php
index 484b2fe0ab5c8fed62d4d7f8b8043f6684ee751e..d152f9d567be0fa2996a7d7a9934c9d7cdc7f96e 100755 (executable)
@@ -74,16 +74,30 @@ class User_group extends Memcached_DataObject
           'WHERE group_member.group_id = %d ' .
           'ORDER BY group_member.created DESC ';
 
-        if (common_config('db','type') == 'pgsql') {
-            $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
-        } else {
-            $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+        if ($limit != null) {
+            if (common_config('db','type') == 'pgsql') {
+                $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+            } else {
+                $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+            }
         }
 
         $members = new Profile();
 
-        $cnt = $members->query(sprintf($qry, $this->id));
-
+        $members->query(sprintf($qry, $this->id));
         return $members;
     }
+
+    function setOriginal($filename)
+    {
+        $imagefile = new ImageFile($this->id, Avatar::path($filename));
+        
+        $orig = clone($this);
+        $this->original_logo = Avatar::url($filename);
+        $this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE));
+        $this->stream_logo = Avatar::url($imagefile->resize(AVATAR_STREAM_SIZE));
+        $this->mini_logo = Avatar::url($imagefile->resize(AVATAR_MINI_SIZE));
+        common_debug(common_log_objstring($this));
+        return $this->update($orig);
+    }
 }