Add Group::getLogo() and Profile::getPhoto() based on PlImage.
[platal.git] / modules / xnetgrp.php
index 248b4a1..eda32c1 100644 (file)
@@ -129,15 +129,7 @@ class XnetGrpModule extends PLModule
     function handler_logo(&$page)
     {
         global $globals;
-
-        $res = XDB::query("SELECT  logo, logo_mime
-                             FROM  groups
-                            WHERE  id = {?}",
-                          $globals->asso('id'));
-        list($logo, $logo_mime) = $res->fetchOneRow();
-
-        pl_cached_dynamic_content_headers(empty($logo) ? "image/jpeg" : $logo_mime);
-        exit;
+        $globals->asso()->getLogo()->send();
     }
 
     function handler_site(&$page)
@@ -324,7 +316,7 @@ class XnetGrpModule extends PLModule
         } else {
             $uf = $globals->asso()->getMembers(null, $se);
         }
-        $users = $uf->getUsers(NB_PER_PAGE, $ofs * NB_PER_PAGE);
+        $users = $uf->getUsers(new PlLimit(NB_PER_PAGE, $ofs * NB_PER_PAGE));
         $count = $uf->getTotalCount();
 
         $page->assign('pages', floor(($count + NB_PER_PAGE - 1) / NB_PER_PAGE));
@@ -694,7 +686,7 @@ class XnetGrpModule extends PLModule
                 $cond->addChild(new UFC_Promo('=', UserFilter::GRADE_ING, Env::i('promo')));
             }
             $uf = new UserFilter($cond);
-            $users = $uf->getUsers(30);
+            $users = $uf->getUsers(new PlLimit(30));
             if ($uf->getTotalCount() > 30) {
                 $page->assign('too_many', true);
                 $users = array();