Procházet zdrojové kódy

Ticket #367 - Module itself.

AntonLV před 10 roky
rodič
revize
69e0fa803b

+ 8 - 1
modules/boonex/forum/classes/BxForumGrid.php

@@ -114,9 +114,16 @@ class BxForumGrid extends BxTemplGrid
     	$sWhereClause .= " AND `" . $this->_oModule->_oConfig->CNF['FIELD_STATUS_ADMIN'] . "`='active'";
 
     	//--- Check privacy
+    	$iAuthorId = 0;
+    	if(!empty($this->_aParams['author'])) {
+    		$oProfileAuthor = BxDolProfile::getInstance((int)$this->_aParams['author']);
+    		if($oProfileAuthor)
+    			$iAuthorId = $oProfileAuthor->id();
+    	}
+
 		$sPrivacy = $this->_oModule->_oConfig->CNF['OBJECT_PRIVACY_VIEW'];
 		$oPrivacy = BxDolPrivacy::getObjectInstance($sPrivacy);
-		$aCondition = $oPrivacy ? $oPrivacy->getContentPublicAsSQLPart() : array();
+		$aCondition = $oPrivacy ? $oPrivacy->getContentPublicAsSQLPart($iAuthorId) : array();
 		if(isset($aCondition['join']))
 			$sJoinClause .= $aCondition['join'];
 		if(isset($aCondition['where']))

+ 1 - 1
modules/boonex/forum/classes/BxForumModule.php

@@ -112,7 +112,7 @@ class BxForumModule extends BxBaseModTextModule
         if(!$iProfileId)
             return '';
 
-        return $this->_serviceBrowseTable(array('type' => 'author', 'where' => array('fld' => 'author', 'val' => $iProfileId, 'opr' => '=')), false);
+        return $this->_serviceBrowseTable(array('type' => 'author', 'author' => $iProfileId, 'where' => array('fld' => 'author', 'val' => $iProfileId, 'opr' => '=')), false);
     }
 
     public function serviceBrowseCategory($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true)