Преглед изворни кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV пре 7 година
родитељ
комит
f647037552

+ 4 - 2
modules/base/groups/classes/BxBaseModGroupsDb.php

@@ -92,9 +92,11 @@ class BxBaseModGroupsDb extends BxBaseModProfileDb
         return $this->getOne($sQuery) ? true : false;
     }
 
-    public function getAdmins ($iGroupProfileId)
+    public function getAdmins ($iGroupProfileId, $iStart = 0, $iLimit = 0)
     {
-        $sQuery = $this->prepare("SELECT `fan_id` FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ?", $iGroupProfileId);
+		$sQuery = $this->prepare("SELECT `fan_id` FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ?", $iGroupProfileId);
+		if ($iLimit > 0)
+            $sQuery = $this->prepare("SELECT `fan_id` FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ? LIMIT ?, ?", $iGroupProfileId, $iStart, $iLimit);
         return $this->getColumn($sQuery);
     }
 }

+ 4 - 4
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -347,14 +347,14 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         if(!$oGroupProfile)
             return false;
 
-        $aProfiles = $this->_oDb->getAdmins($oGroupProfile->id());
-        if(empty($aProfiles) || !is_array($aProfiles))
-            return false;
-
         $iStart = (int)bx_get('start');
         $iLimit = !empty($CNF['PARAM_NUM_CONNECTIONS_QUICK']) ? getParam($CNF['PARAM_NUM_CONNECTIONS_QUICK']) : 4;
         if(!$iLimit)
             $iLimit = 4;
+        
+        $aProfiles = $this->_oDb->getAdmins($oGroupProfile->id(), $iStart,  $iLimit+1);
+        if(empty($aProfiles) || !is_array($aProfiles))
+            return false;
 
         return $this->_serviceBrowseQuick($aProfiles, $iStart, $iLimit);
     }