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

#4485 - Visibility for anonimus comments

roman.lesnikov@gmail.com 3 лет назад
Родитель
Сommit
f27588d539
1 измененных файлов с 2 добавлено и 7 удалено
  1. 2 7
      template/scripts/BxBaseCmts.php

+ 2 - 7
template/scripts/BxBaseCmts.php

@@ -449,7 +449,6 @@ class BxBaseCmts extends BxDolCmts
             }
         }
 
-        $oProfileAuthor = BxDolProfile::getInstance($aCmt['cmt_author_id']);
         if($this->_isShowContent($aCmt)) {
             $sContent = $this->_getContent($aCmt, $aBp, $aDp);
         }
@@ -983,13 +982,9 @@ class BxBaseCmts extends BxDolCmts
         return self::$_sTmplContentCounter;
     }
 
-
-    /**
-     * private functions
-     */
-    private function _isShowContent($aCmt)
+    protected function _isShowContent($aCmt)
     {
-        $oProfileAuthor = BxDolProfile::getInstance($aCmt['cmt_author_id']);
+        $oProfileAuthor = BxDolProfile::getInstance(abs($aCmt['cmt_author_id']));
         return (int)$aCmt['cmt_author_id'] == 0 || ($oProfileAuthor && $oProfileAuthor->isActive()) || isAdmin() || BxDolAcl::getInstance()->isMemberLevelInSet([MEMBERSHIP_ID_MODERATOR, MEMBERSHIP_ID_ADMINISTRATOR]);
     }