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

#1689 When profile status isn't 'active' then hide any profile content: files, glossary, ads

Alex Trofimov 4 лет назад
Родитель
Сommit
e8ae9f0a4e

+ 2 - 2
modules/boonex/ads/classes/BxAdsDb.php

@@ -222,8 +222,8 @@ class BxAdsDb extends BxBaseModTextDb
                 break;
 
             case 'collect_stats':
-                $sSelectClause = "`tc`.`id`, COUNT(`te`.`id`) AS `count`";
-                $sJoinClause = $this->prepareAsString(" LEFT JOIN `" . $CNF['TABLE_ENTRIES'] . "` AS `te` ON `tc`.`id`=`te`.`category` AND `te`.`status`='active' AND `te`.`status_admin`='active' AND (`te`.`allow_view_to`=? OR `te`.`allow_view_to`<0)", BX_DOL_PG_ALL);
+                $sCountClause = "(SELECT `te`.`id` FROM `" . $CNF['TABLE_ENTRIES'] . "` AS `te` INNER JOIN `sys_profiles` AS `p` ON(`p`.`id` = `te`.`{$CNF['FIELD_AUTHOR']}` AND `p`.`status` = 'active') WHERE `tc`.`id`=`te`.`category` AND `te`.`status`='active' AND `te`.`status_admin`='active' AND (`te`.`allow_view_to`=" . BX_DOL_PG_ALL . " OR `te`.`allow_view_to`<0))";
+                $sSelectClause = "`tc`.`id`, COUNT($sCountClause) AS `count`";
                 $sGroupClause = "`tc`.`id`";
                 break;
         }

+ 1 - 0
modules/boonex/files/classes/BxFilesSearchResult.php

@@ -176,6 +176,7 @@ class BxFilesSearchResult extends BxBaseModTextSearchResult
 
         $this->processReplaceableMarkers($oProfileAuthor);
         $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+        $this->addCustomConditions($CNF, $oProfileAuthor, $sMode, $aParams);
 
         if ($this->bFileManagerMode) {
             $this->addContainerClass('bx-files-with-toolbar');

+ 1 - 0
modules/boonex/glossary/classes/BxGlsrSearchResult.php

@@ -129,6 +129,7 @@ class BxGlsrSearchResult extends BxBaseModTextSearchResult
         $this->processReplaceableMarkers($oProfileAuthor);
 
         $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+        $this->addCustomConditions($CNF, $oProfileAuthor, $sMode, $aParams);
     }
 
     function getAlterOrder()