Просмотр исходного кода

Ticket #3742 - Forum: DB error and warning on the forum from the channel

AntonLV 4 лет назад
Родитель
Сommit
c7d6d35fbf

+ 10 - 0
modules/base/groups/classes/BxBaseModGroupsConfig.php

@@ -56,6 +56,16 @@ class BxBaseModGroupsConfig extends BxBaseModProfileConfig
     	return $this->_aCurrency;
     }
 
+    public function isFans()
+    {
+        return true;
+    }
+
+    public function isAdmins()
+    {
+        return $this->isFans() && !empty($this->CNF['TABLE_ADMINS']);
+    }
+
     public function isPaidJoin()
     {
         return isset($this->CNF['PARAM_PAID_JOIN_ENABLED']) && $this->CNF['PARAM_PAID_JOIN_ENABLED'] === true;

+ 3 - 0
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -226,6 +226,9 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
      */
     public function serviceGetAdminsByAction($iGroupProfileId, $mixedAction)
     {
+        if(!$this->_oConfig->isAdmins())
+            return [];
+
         $aGroupContentInfo = $this->_oDb->getContentInfoByProfileId($iGroupProfileId);
         if(empty($aGroupContentInfo) || !is_array($aGroupContentInfo))
             return [];

+ 4 - 0
modules/boonex/channels/classes/BxCnlConfig.php

@@ -178,6 +178,10 @@ class BxCnlConfig extends BxBaseModGroupsConfig
         );
     }
 
+    public function isFans()
+    {
+        return false;
+    }
 }
 
 /** @} */