Преглед на файлове

#1661 - List/Cloud of hashtags within a group/event/space/etc

RomanL преди 4 години
родител
ревизия
6e0f74cdee
променени са 36 файла, в които са добавени 181 реда и са изтрити 118 реда
  1. 2 2
      inc/classes/BxDolCategory.php
  2. 10 6
      inc/classes/BxDolCategoryQuery.php
  3. 2 0
      inc/classes/BxDolForm.php
  4. 3 8
      inc/classes/BxDolMetatags.php
  5. 16 6
      inc/classes/BxDolMetatagsQuery.php
  6. 18 0
      inc/utils.inc.php
  7. 2 0
      install/sql/system.sql
  8. 19 2
      modules/base/general/classes/BxBaseModGeneralModule.php
  9. 2 2
      modules/boonex/ads/install/sql/enable.sql
  10. 4 4
      modules/boonex/albums/install/sql/enable.sql
  11. 2 2
      modules/boonex/channels/install/sql/enable.sql
  12. 2 2
      modules/boonex/classes/install/sql/enable.sql
  13. 4 4
      modules/boonex/courses/install/sql/enable.sql
  14. 4 4
      modules/boonex/events/install/sql/enable.sql
  15. 4 4
      modules/boonex/files/install/sql/enable.sql
  16. 4 4
      modules/boonex/forum/install/sql/enable.sql
  17. 4 4
      modules/boonex/glossary/install/sql/enable.sql
  18. 4 4
      modules/boonex/groups/install/sql/enable.sql
  19. 4 4
      modules/boonex/market/install/sql/enable.sql
  20. 4 4
      modules/boonex/organizations/install/sql/enable.sql
  21. 2 2
      modules/boonex/persons/install/sql/enable.sql
  22. 5 5
      modules/boonex/photos/install/sql/enable.sql
  23. 4 4
      modules/boonex/polls/install/sql/enable.sql
  24. 4 4
      modules/boonex/posts/install/sql/enable.sql
  25. 4 4
      modules/boonex/reviews/install/sql/enable.sql
  26. 4 4
      modules/boonex/shopify/install/sql/enable.sql
  27. 4 4
      modules/boonex/snipcart/install/sql/enable.sql
  28. 4 4
      modules/boonex/spaces/install/sql/enable.sql
  29. 4 4
      modules/boonex/stream/install/sql/enable.sql
  30. 2 2
      modules/boonex/tasks/install/sql/enable.sql
  31. 2 2
      modules/boonex/timeline/install/sql/enable.sql
  32. 4 4
      modules/boonex/videos/install/sql/enable.sql
  33. 14 5
      template/scripts/BxBaseCategory.php
  34. 2 2
      template/scripts/BxBaseMetatags.php
  35. 1 1
      template/scripts/BxBaseServiceCategory.php
  36. 7 1
      template/scripts/BxBaseServiceMetatags.php

+ 2 - 2
inc/classes/BxDolCategory.php

@@ -113,9 +113,9 @@ class BxDolCategory extends BxDolFactory implements iBxDolFactoryObject
      * @param $sCategoryValue category value
      * @return number
      */
-    public function getItemsNum($sCategoryValue)
+    public function getItemsNum($sCategoryValue, $aParams = [])
     {
-        return BxDolCategoryQuery::getItemsNumInCategory ($this->_aObject, $sCategoryValue);
+        return BxDolCategoryQuery::getItemsNumInCategory ($this->_aObject, $sCategoryValue, true, $aParams);
     }
 }
 

+ 10 - 6
inc/classes/BxDolCategoryQuery.php

@@ -43,18 +43,22 @@ class BxDolCategoryQuery extends BxDolDb
         return $aObject;
     }
 
-    static public function getItemsNumInCategory ($aObject, $sCategoryValue, $bPublicOnly = true)
+    static public function getItemsNumInCategory ($aObject, $sCategoryValue, $bPublicOnly = true, $aParams = [])
     {
         $oDb = BxDolDb::getInstance();
         $sWhere = '';
-        // TODO: in the future add 'module' field to categories object
-        if ($bPublicOnly && ($oModule = BxDolModule::getInstance($aObject['search_object'])) && isset($oModule->_oConfig->CNF)) {
+        if ($bPublicOnly && ($oModule = BxDolModule::getInstance($aObject['module'])) && isset($oModule->_oConfig->CNF)) {
             $CNF = &$oModule->_oConfig->CNF;
 
             if(isset($CNF['FIELD_ALLOW_VIEW_TO'])) {
-                bx_import('BxDolPrivacy');
-                $a = isLogged() ? array(BX_DOL_PG_ALL, BX_DOL_PG_MEMBERS) : array(BX_DOL_PG_ALL);
-                $sWhere .= ' AND `' . $aObject['table'] . '`.`' . $CNF['FIELD_ALLOW_VIEW_TO'] . '` IN(' . $oDb->implode_escape($a) . ') ';
+                if (isset($aParams['context_id'])){
+                    $sWhere .= ' AND `' . $aObject['table'] . '`.`' . $CNF['FIELD_ALLOW_VIEW_TO'] . '` IN(' . -$aParams['context_id'] . ') ';
+                }
+                else{
+                    bx_import('BxDolPrivacy');
+                    $a = isLogged() ? array(BX_DOL_PG_ALL, BX_DOL_PG_MEMBERS) : array(BX_DOL_PG_ALL);
+                    $sWhere .= ' AND `' . $aObject['table'] . '`.`' . $CNF['FIELD_ALLOW_VIEW_TO'] . '` IN(' . $oDb->implode_escape($a) . ') ';
+                }
             }
 
             if(isset($CNF['FIELD_STATUS']))

+ 2 - 0
inc/classes/BxDolForm.php

@@ -1039,6 +1039,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
     {
         // TODO: remove
     }
+    
     public static function getCsrfToken()
     {
         if (getParam('sys_security_form_token_enable') != 'on')
@@ -1049,6 +1050,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
 
         return $oKeys->getNewKey (false, (int)getParam('sys_security_form_token_lifetime'));
     }
+    
     public static function isCsrfTokenValid($s)
     {
         if (getParam('sys_security_form_token_enable') != 'on')

+ 3 - 8
inc/classes/BxDolMetatags.php

@@ -323,12 +323,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
     public function keywordsAddOne($iId, $s, $bDeletePreviousKeywords = true)
     {
         if ($iRet = $this->_oQuery->keywordsAdd($iId, array($s), $bDeletePreviousKeywords)) {
-            /*
-             * TODO: Module name should be passed in Extras, because for now 'object' is used as module name.
-             * So, module field should be added in sys_objects_metatags table.
-             * This should be changed in Ticket #1596
-             */
-            bx_alert($this->_sObject, 'keyword_added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId));
+            bx_alert($this->_aObject['module'], 'keyword_added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId));
             bx_alert('meta_keyword', 'added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId, 'object' => $this->_sObject));
         }
         return $iRet;
@@ -547,9 +542,9 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
         return call_user_func_array(array($this->_oQuery, 'keywordsGetSQLParts'), func_get_args());
     }
 
-    public function keywordsPopularList($iLimit)
+    public function keywordsPopularList($iLimit, $mContextId = false)
     {
-        return $this->_oQuery->keywordsPopularList($iLimit);
+        return $this->_oQuery->keywordsPopularList($iLimit, $mContextId);
     }
 
 

+ 16 - 6
inc/classes/BxDolMetatagsQuery.php

@@ -95,14 +95,24 @@ class BxDolMetatagsQuery extends BxDolDb
         );
     }
 
-    public function keywordsPopularList($iLimit)
-    {
-        $sQuery = $this->prepare("SELECT `keyword`, COUNT(*) as `count` FROM `{$this->_aObject['table_keywords']}` GROUP BY `keyword` ORDER BY `count` DESC LIMIT ?", $iLimit);
-        return $this->getPairs($sQuery, 'keyword', 'count');
+    public function keywordsPopularList($iLimit, $mContextId = false)
+    {   
+        if ($mContextId){
+            $oModule = BxDolModule::getInstance($this->_aObject['module']);
+            $CNF = $oModule->_oConfig->CNF;
+            if (isset($CNF['TABLE_ENTRIES']) && isset($CNF['FIELD_ID']) && isset($CNF['FIELD_ALLOW_VIEW_TO'])){
+                $sQuery = $this->prepare("SELECT `keyword`, COUNT(*) as `count` FROM `{$this->_aObject['table_keywords']}` INNER JOIN `{$CNF['TABLE_ENTRIES']}` ON `{$this->_aObject['table_keywords']}`.`object_id` = `{$CNF['TABLE_ENTRIES']}`.`{$CNF['FIELD_ID']}` AND `{$CNF['TABLE_ENTRIES']}`.`{$CNF['FIELD_ALLOW_VIEW_TO']}` = ? GROUP BY `keyword` ORDER BY `count` DESC LIMIT ?", -$mContextId,  $iLimit);
+                return $this->getPairs($sQuery, 'keyword', 'count');
+            }
+            else
+                return [];
+        }
+        else{
+            $sQuery = $this->prepare("SELECT `keyword`, COUNT(*) as `count` FROM `{$this->_aObject['table_keywords']}` GROUP BY `keyword` ORDER BY `count` DESC LIMIT ?", $iLimit);
+            return $this->getPairs($sQuery, 'keyword', 'count');
+        }
     }    
 
-
-
     public function locationsAdd($mixedContentId, $fLat, $fLng, $sCountryCode, $sState, $sCity, $sZip, $sStreet, $sStreetNumber)
     {
         $this->locationsDelete($mixedContentId);

+ 18 - 0
inc/utils.inc.php

@@ -1316,6 +1316,24 @@ function bx_get_base_url($sPageLink)
     return array($sPageLink, $aPageParams);
 }
 
+function bx_get_page_info()
+{
+    $a = bx_get_base_url_inline();
+    $oPage = BxDolPage::getObjectInstanceByURI($a[1]['i']);
+    $oServ = bx_instance('BxTemplServices');
+    if ($oServ->serviceIsModuleContext($oPage->getModule())){
+        $oProfile = BxDolProfile::getInstanceByContentAndType($a[1]['id'], $oPage->getModule());
+        return ['context_module' => $oPage->getModule(), 'context_id' => isset($a[1]['id']) ? $a[1]['id'] : '', 'profile_context_id' => $oProfile->id()];
+    }
+    
+    if (isset($a[1]['profile_id'])){
+        $oProfile = BxDolProfile::getInstance($a[1]['profile_id']);
+        if($oProfile  && $oServ->serviceIsModuleContext($oProfile->getModule())){
+            return ['context_module' => $oProfile->getModule(), 'context_id' => $oProfile->getContentId(), 'profile_context_id' => $a[1]['profile_id']];
+        }
+    }
+}
+
 function bx_get_location_bounds_latlng($fLatitude, $fLongitude, $iRadiusInKm)
 {
     $fEquatorLatInKm = 111.321;

+ 2 - 0
install/sql/system.sql

@@ -5389,6 +5389,7 @@ CREATE TABLE `sys_labels` (
 CREATE TABLE `sys_objects_metatags` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `object` varchar(64) NOT NULL,
+  `module` varchar(32) NOT NULL,
   `table_keywords` varchar(255) NOT NULL,
   `table_locations` varchar(255) NOT NULL,
   `table_mentions` varchar(255) NOT NULL,
@@ -5406,6 +5407,7 @@ INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations
 CREATE TABLE `sys_objects_category` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `object` varchar(64) NOT NULL,
+  `module` varchar(32) NOT NULL,
   `search_object` varchar(64) NOT NULL,
   `form_object` varchar(64) NOT NULL,
   `list_name` varchar(255) NOT NULL,

+ 19 - 2
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -2234,15 +2234,32 @@ class BxBaseModGeneralModule extends BxDolModule
      */
     public function serviceCategoriesMultiList($bDisplayEmptyCats = true)
     {
+        $aContextInfo = bx_get_page_info();
+        $mProfileContextId = false;
+        if (isset($aContextInfo['context_module']) && isset($aContextInfo['profile_context_id'])){
+            $mProfileContextId = $aContextInfo['profile_context_id'];
+        }
+        
 		$oCategories = BxDolCategories::getInstance();
-        $aCats = $oCategories->getData(array('type' => 'by_module_with_num', 'module' => $this->getName()));
+        if ($mProfileContextId)
+            $aCats = $oCategories->getData([
+                'type' => 'by_module&context_with_num', 
+                'module' => $this->getName(), 
+                'context_id' => $mProfileContextId
+            ]);
+        else{
+            $aCats = $oCategories->getData([
+                'type' => 'by_module_with_num', 
+                'module' => $this->getName()
+            ]);
+        }
         $aVars = array('bx_repeat:cats' => array());
         foreach ($aCats as $oCat) {
             $sValue = $oCat['value'];
             $iNum = $oCat['num'];
             
             $aVars['bx_repeat:cats'][] = array(
-                'url' => $oCategories->getUrl($this->getName(), $sValue),
+                'url' => $oCategories->getUrl($this->getName(), $sValue, $mProfileContextId ? '&context_id=' . $mProfileContextId : ''),
                 'name' => _t($sValue),
                 'value' => $sValue,
                 'num' => $iNum,

+ 2 - 2
modules/boonex/ads/install/sql/enable.sql

@@ -473,8 +473,8 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_ads', 'bx_ads_meta_keywords', 'bx_ads_meta_locations', 'bx_ads_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_ads', 'bx_ads', 'bx_ads_meta_keywords', 'bx_ads_meta_locations', 'bx_ads_meta_mentions', '', '');
 
 
 -- STATS

+ 4 - 4
modules/boonex/albums/install/sql/enable.sql

@@ -484,10 +484,10 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `GlobalSearch`
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_albums', 'bx_albums_meta_keywords', 'bx_albums_meta_locations', 'bx_albums_meta_mentions', '', ''),
-('bx_albums_media', 'bx_albums_meta_keywords_media', '', '', '', ''),
-('bx_albums_media_camera', 'bx_albums_meta_keywords_media_camera', '', '', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_albums', 'bx_albums', 'bx_albums_meta_keywords', 'bx_albums_meta_locations', 'bx_albums_meta_mentions', '', ''),
+('bx_albums_media', 'bx_albums', 'bx_albums_meta_keywords_media', '', '', '', ''),
+('bx_albums_media_camera', 'bx_albums', 'bx_albums_meta_keywords_media_camera', '', '', '', '');
 
 
 -- STATS

+ 2 - 2
modules/boonex/channels/install/sql/enable.sql

@@ -340,8 +340,8 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_channels', 'bx_cnl_meta_keywords', '', 'bx_cnl_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_channels', 'bx_albums', 'bx_cnl_meta_keywords', '', 'bx_cnl_meta_mentions', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 2 - 2
modules/boonex/classes/install/sql/enable.sql

@@ -317,8 +317,8 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_classes_cmts', '_bx_classes_cmts', @iSearchOrder + 2, 'BxClssCmtsSearchResult', 'modules/boonex/classes/classes/BxClssCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_classes', 'bx_classes_meta_keywords', 'bx_classes_meta_locations', 'bx_classes_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_classes', 'bx_classes', 'bx_classes_meta_keywords', 'bx_classes_meta_locations', 'bx_classes_meta_mentions', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/courses/install/sql/enable.sql

@@ -498,12 +498,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_courses', 'bx_courses_meta_keywords', 'bx_courses_meta_locations', 'bx_courses_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_courses', 'bx_courses', 'bx_courses_meta_keywords', 'bx_courses_meta_locations', 'bx_courses_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_courses_cats', 'bx_courses', 'bx_course', 'bx_courses_cats', 'bx_courses_data', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_courses_data`.`id` AND `sys_profiles`.`type` = ''bx_courses'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_courses_cats', 'bx_courses',  'bx_courses', 'bx_course', 'bx_courses_cats', 'bx_courses_data', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_courses_data`.`id` AND `sys_profiles`.`type` = ''bx_courses'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 4 - 4
modules/boonex/events/install/sql/enable.sql

@@ -551,12 +551,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileDeleteInvites);
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_events', 'bx_events_meta_keywords', 'bx_events_meta_locations', 'bx_events_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_events', 'bx_events', 'bx_events_meta_keywords', 'bx_events_meta_locations', 'bx_events_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_events_cats', 'bx_events', 'bx_event', 'bx_events_cats', 'bx_events_data', 'event_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_events_data`.`id` AND `sys_profiles`.`type` = ''bx_events'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_cats', 'bx_events', 'bx_events', 'bx_event', 'bx_events_cats', 'bx_events_data', 'event_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_events_data`.`id` AND `sys_profiles`.`type` = ''bx_events'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 4 - 4
modules/boonex/files/install/sql/enable.sql

@@ -439,12 +439,12 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_files_cmts', '_bx_files_cmts', @iSearchOrder + 2, 'BxFilesCmtsSearchResult', 'modules/boonex/files/classes/BxFilesCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_files', 'bx_files_meta_keywords', '', 'bx_files_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_files', 'bx_files', 'bx_files_meta_keywords', '', 'bx_files_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_files_cats', 'bx_files', 'bx_files', 'bx_files_cats', 'bx_files_main', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_files_main`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_cats', 'bx_files', 'bx_files', 'bx_files', 'bx_files_cats', 'bx_files_main', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_files_main`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/forum/install/sql/enable.sql

@@ -593,13 +593,13 @@ INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-(@sName, 'bx_forum_meta_keywords', '', 'bx_forum_meta_mentions', 'BxForumMetatags', 'modules/boonex/forum/classes/BxForumMetatags.php');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+(@sName, @sName, 'bx_forum_meta_keywords', '', 'bx_forum_meta_mentions', 'BxForumMetatags', 'modules/boonex/forum/classes/BxForumMetatags.php');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_forum_cats', @sName, @sName, 'bx_forum_cats', 'bx_forum_discussions', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_forum_discussions`.`author`))', 'AND `sys_profiles`.`status` = ''active''', 'BxForumCategory', 'modules/boonex/forum/classes/BxForumCategory.php');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_forum_cats', @sName, @sName, @sName, 'bx_forum_cats', 'bx_forum_discussions', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_forum_discussions`.`author`))', 'AND `sys_profiles`.`status` = ''active''', 'BxForumCategory', 'modules/boonex/forum/classes/BxForumCategory.php');
 
 
 -- STATS

+ 4 - 4
modules/boonex/glossary/install/sql/enable.sql

@@ -420,12 +420,12 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_glossary_cmts', '_bx_glossary_cmts', @iSearchOrder + 2, 'BxGlsrCmtsSearchResult', 'modules/boonex/glossary/classes/BxGlsrCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_glossary', 'bx_glossary_meta_keywords', '', 'bx_glossary_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_glossary', 'bx_glossary', 'bx_glossary_meta_keywords', '', 'bx_glossary_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_glossary_cats', 'bx_glossary', 'bx_glossary', 'bx_glossary_cats', 'bx_glossary_terms', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_glossary_terms`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_glossary_cats', 'bx_glossary', 'bx_glossary', 'bx_glossary', 'bx_glossary_cats', 'bx_glossary_terms', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_glossary_terms`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/groups/install/sql/enable.sql

@@ -513,12 +513,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_groups', 'bx_groups_meta_keywords', 'bx_groups_meta_locations', 'bx_groups_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_groups', 'bx_groups', 'bx_groups_meta_keywords', 'bx_groups_meta_locations', 'bx_groups_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_groups_cats', 'bx_groups', 'bx_group', 'bx_groups_cats', 'bx_groups_data', 'group_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_groups_data`.`id` AND `sys_profiles`.`type` = ''bx_groups'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_groups_cats', 'bx_groups', 'bx_groups', 'bx_group', 'bx_groups_cats', 'bx_groups_data', 'group_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_groups_data`.`id` AND `sys_profiles`.`type` = ''bx_groups'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 4 - 4
modules/boonex/market/install/sql/enable.sql

@@ -557,12 +557,12 @@ INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class
 ('bx_market_subentries', 'bx_market_subproducts', 'one-way', '', '');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_market', 'bx_market_meta_keywords', 'bx_market_meta_locations', 'bx_market_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_market', 'bx_market', 'bx_market_meta_keywords', 'bx_market_meta_locations', 'bx_market_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_market_cats', 'bx_market', 'bx_market', 'bx_market_cats', 'bx_market_products', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_market_products`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_market_cats', 'bx_market', 'bx_market', 'bx_market', 'bx_market_cats', 'bx_market_products', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_market_products`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/organizations/install/sql/enable.sql

@@ -565,13 +565,13 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_organizations', 'bx_organizations_meta_keywords', 'bx_organizations_meta_locations', 'bx_organizations_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_organizations', 'bx_organizations', 'bx_organizations_meta_keywords', 'bx_organizations_meta_locations', 'bx_organizations_meta_mentions', '', '');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_organizations_cats', 'bx_organizations', 'bx_organization', 'bx_organizations_cats', 'bx_organizations_data', 'org_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_organizations_data`.`id` AND `sys_profiles`.`type` = ''bx_organizations'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_organizations_cats', 'bx_organizations', 'bx_organizations', 'bx_organization', 'bx_organizations_cats', 'bx_organizations_data', 'org_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_organizations_data`.`id` AND `sys_profiles`.`type` = ''bx_organizations'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 
 -- SEARCH

+ 2 - 2
modules/boonex/persons/install/sql/enable.sql

@@ -468,8 +468,8 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileDeleteAny);
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_persons', 'bx_persons_meta_keywords', 'bx_persons_meta_locations', 'bx_persons_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_persons', 'bx_persons', 'bx_persons_meta_keywords', 'bx_persons_meta_locations', 'bx_persons_meta_mentions', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 5 - 5
modules/boonex/photos/install/sql/enable.sql

@@ -402,14 +402,14 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_photos', 'bx_photos_meta_keywords', 'bx_photos_meta_locations', 'bx_photos_meta_mentions', '', ''),
-('bx_photos_camera', 'bx_photos_meta_keywords_camera', '', '', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_photos', 'bx_photos', 'bx_photos_meta_keywords', 'bx_photos_meta_locations', 'bx_photos_meta_mentions', '', ''),
+('bx_photos_camera', 'bx_photos', 'bx_photos_meta_keywords_camera', '', '', '', '');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_photos_cats', 'bx_photos', 'bx_photos', 'bx_photos_cats', 'bx_photos_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_photos_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_photos_cats', 'bx_photos', 'bx_photos', 'bx_photos', 'bx_photos_cats', 'bx_photos_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_photos_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 
 -- STATS

+ 4 - 4
modules/boonex/polls/install/sql/enable.sql

@@ -412,12 +412,12 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_polls_cmts', '_bx_polls_cmts', @iSearchOrder + 2, 'BxPollsCmtsSearchResult', 'modules/boonex/polls/classes/BxPollsCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_polls', 'bx_polls_meta_keywords', 'bx_polls_meta_locations', 'bx_polls_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_polls', 'bx_polls', 'bx_polls_meta_keywords', 'bx_polls_meta_locations', 'bx_polls_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_polls_cats', 'bx_polls', 'bx_polls', 'bx_polls_cats', 'bx_polls_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_polls_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_polls_cats', 'bx_polls', 'bx_polls', 'bx_polls', 'bx_polls_cats', 'bx_polls_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_polls_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/posts/install/sql/enable.sql

@@ -447,12 +447,12 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_posts_cmts', '_bx_posts_cmts', @iSearchOrder + 2, 'BxPostsCmtsSearchResult', 'modules/boonex/posts/classes/BxPostsCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_posts', 'bx_posts_meta_keywords', 'bx_posts_meta_locations', 'bx_posts_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts', 'bx_posts', 'bx_posts_meta_keywords', 'bx_posts_meta_locations', 'bx_posts_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_posts_cats', 'bx_posts', 'bx_posts', 'bx_posts_cats', 'bx_posts_posts', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_posts_posts`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts_cats', 'bx_posts', 'bx_posts', 'bx_posts', 'bx_posts_cats', 'bx_posts_posts', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_posts_posts`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/reviews/install/sql/enable.sql

@@ -453,12 +453,12 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 ('bx_reviews_cmts', '_bx_reviews_cmts', @iSearchOrder + 3, 'BxReviewsCmtsSearchResult', 'modules/boonex/reviews/classes/BxReviewsCmtsSearchResult.php');
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_reviews', 'bx_reviews_meta_keywords', 'bx_reviews_meta_locations', 'bx_reviews_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_reviews', 'bx_reviews', 'bx_reviews_meta_keywords', 'bx_reviews_meta_locations', 'bx_reviews_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_reviews_cats', 'bx_reviews', 'bx_reviews', 'bx_reviews_cats', 'bx_reviews_reviews', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_reviews_reviews`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_reviews_cats', 'bx_reviews' , 'bx_reviews', 'bx_reviews', 'bx_reviews_cats', 'bx_reviews_reviews', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_reviews_reviews`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 4 - 4
modules/boonex/shopify/install/sql/enable.sql

@@ -374,13 +374,13 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_shopify', 'bx_shopify_meta_keywords', 'bx_shopify_meta_locations', 'bx_shopify_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify', 'bx_shopify', 'bx_shopify_meta_keywords', 'bx_shopify_meta_locations', 'bx_shopify_meta_mentions', '', '');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_shopify_cats', 'bx_shopify', 'bx_shopify', 'bx_shopify_cats', 'bx_shopify_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_shopify_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify_cats', 'bx_shopify', 'bx_shopify' , 'bx_shopify', 'bx_shopify_cats', 'bx_shopify_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_shopify_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 
 -- STATS

+ 4 - 4
modules/boonex/snipcart/install/sql/enable.sql

@@ -377,13 +377,13 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_snipcart', 'bx_snipcart_meta_keywords', 'bx_snipcart_meta_locations', 'bx_snipcart_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_snipcart', 'bx_snipcart', 'bx_snipcart_meta_keywords', 'bx_snipcart_meta_locations', 'bx_snipcart_meta_mentions', '', '');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_snipcart_cats', 'bx_snipcart', 'bx_snipcart', 'bx_snipcart_cats', 'bx_snipcart_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_snipcart_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_snipcart_cats', 'bx_snipcart', 'bx_snipcart', 'bx_snipcart', 'bx_snipcart_cats', 'bx_snipcart_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_snipcart_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 
 -- STATS

+ 4 - 4
modules/boonex/spaces/install/sql/enable.sql

@@ -500,12 +500,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionProfileDeleteInvites);
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_spaces', 'bx_spaces_meta_keywords', 'bx_spaces_meta_locations', 'bx_spaces_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces', 'bx_spaces', 'bx_spaces_meta_keywords', 'bx_spaces_meta_locations', 'bx_spaces_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_spaces_cats', 'bx_spaces', 'bx_space', 'bx_spaces_cats', 'bx_spaces_data', 'space_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_spaces_data`.`id` AND `sys_profiles`.`type` = ''bx_spaces'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_cats', 'bx_spaces', 'bx_spaces', 'bx_space', 'bx_spaces_cats', 'bx_spaces_data', 'space_cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`content_id` = `bx_spaces_data`.`id` AND `sys_profiles`.`type` = ''bx_spaces'')', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- SEARCH
 SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);

+ 4 - 4
modules/boonex/stream/install/sql/enable.sql

@@ -312,12 +312,12 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionEntryDeleteAny);
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_stream', 'bx_stream_meta_keywords', 'bx_stream_meta_locations', 'bx_stream_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream', 'bx_stream', 'bx_stream_meta_keywords', 'bx_stream_meta_locations', 'bx_stream_meta_mentions', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_stream_cats', '', 'bx_stream', 'bx_stream_cats', 'bx_stream_streams', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_stream_streams`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_stream_cats', 'bx_stream', '', 'bx_stream', 'bx_stream_cats', 'bx_stream_streams', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_stream_streams`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 2 - 2
modules/boonex/tasks/install/sql/enable.sql

@@ -252,8 +252,8 @@ INSERT INTO `sys_objects_connection` (`object`, `table`, `type`, `override_class
 ('bx_tasks_assignments', 'bx_tasks_assignments', 'one-way', '', '');
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_tasks_cats', 'bx_tasks', 'bx_tasks', 'bx_tasks_cats', 'bx_tasks_tasks', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_tasks_tasks`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_tasks_cats', 'bx_tasks', 'bx_tasks', 'bx_tasks', 'bx_tasks_cats', 'bx_tasks_tasks', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = ABS(`bx_tasks_tasks`.`author`))', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 -- STATS
 SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);

+ 2 - 2
modules/boonex/timeline/install/sql/enable.sql

@@ -513,8 +513,8 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_timeline', 'bx_timeline_meta_keywords', 'bx_timeline_meta_locations', 'bx_timeline_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_timeline', 'bx_timeline', 'bx_timeline_meta_keywords', 'bx_timeline_meta_locations', 'bx_timeline_meta_mentions', '', '');
 
 
 -- CONNECTIONS

+ 4 - 4
modules/boonex/videos/install/sql/enable.sql

@@ -394,13 +394,13 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `
 
 
 -- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
-('bx_videos', 'bx_videos_meta_keywords', 'bx_videos_meta_locations', 'bx_videos_meta_mentions', '', '');
+INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_videos', 'bx_videos', 'bx_videos_meta_keywords', 'bx_videos_meta_locations', 'bx_videos_meta_mentions', '', '');
 
 
 -- CATEGORY
-INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
-('bx_videos_cats', 'bx_videos', 'bx_videos', 'bx_videos_cats', 'bx_videos_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_videos_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+INSERT INTO `sys_objects_category` (`object`, `module`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_videos_cats', 'bx_videos', 'bx_videos', 'bx_videos', 'bx_videos_cats', 'bx_videos_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_videos_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
 
 
 -- STATS

+ 14 - 5
template/scripts/BxBaseCategory.php

@@ -28,7 +28,7 @@ class BxBaseCategory extends BxDolCategory
 		$this->_sBrowseUrl = bx_append_url_params('searchKeyword.php', array(
 			'cat' => '{category}',
 			'keyword' => '{keyword}'
-		)) . '{sections}';
+		)) . '{sections}' . '{context}';
     }
 
     public function getCategoryTitle($sValue)
@@ -40,12 +40,13 @@ class BxBaseCategory extends BxDolCategory
 		return $a[$sValue];
     }
 
-    public function getCategoryUrl($sValue)
+    public function getCategoryUrl($sValue, $aParams = [])
     {
         return BX_DOL_URL_ROOT . bx_replace_markers($this->_sBrowseUrl, array(
         	'category' => rawurlencode($this->getObjectName()),
         	'keyword' => rawurlencode($sValue),
-    		'sections' => $this->_aObject['search_object'] ? '&section[]=' . rawurlencode($this->_aObject['search_object']) : ''
+    		'sections' => $this->_aObject['search_object'] ? '&section[]=' . rawurlencode($this->_aObject['search_object']) : '',
+            'context' => isset($aParams['context_id']) ? '&context_id=' . $aParams['context_id'] : ''
         ));
     }
 
@@ -68,6 +69,12 @@ class BxBaseCategory extends BxDolCategory
      */
     public function getCategoriesList($bDisplayEmptyCats = true, $bAsArray = false)
     {
+        $aContextInfo = bx_get_page_info();
+        $mProfileContextId = false;
+        if (isset($aContextInfo['context_module']) && isset($aContextInfo['profile_context_id'])){
+            $mProfileContextId = $aContextInfo['profile_context_id'];
+        }
+        
         $a = BxDolForm::getDataItems($this->_aObject['list_name']);
         if (!$a)
             return $bAsArray ? array() : '';
@@ -76,11 +83,13 @@ class BxBaseCategory extends BxDolCategory
         foreach ($a as $sValue => $sName) {
             if (!is_numeric($sValue) && !$sValue)
                 continue;
-            $iNum = $this->getItemsNum($sValue);
+            
+            $iNum = $this->getItemsNum($sValue, ['context_id' => $mProfileContextId]);
             if (!$bDisplayEmptyCats && !$iNum)
                 continue;
+            
             $aVars['bx_repeat:cats'][] = array(
-                'url' => $this->getCategoryUrl($sValue),
+                'url' => $mProfileContextId? $this->getCategoryUrl($sValue, ['context_id' => $mProfileContextId]) : $this->getCategoryUrl($sValue),
                 'name' => $sName,
                 'value' => $sValue,
                 'num' => $iNum,

+ 2 - 2
template/scripts/BxBaseMetatags.php

@@ -63,9 +63,9 @@ class BxBaseMetatags extends BxDolMetatags
         return $this->_oTemplate->parseHtmlByName('metatags_keywords_list.html', $aVars);
     }
 
-    public function getKeywordsCloud($mixedSection, $iMaxCount, $bAsArray = false)
+    public function getKeywordsCloud($mixedSection, $iMaxCount, $bAsArray = false, $aParams = [])
     {
-        $aKeywords = $this->keywordsPopularList($iMaxCount);
+        $aKeywords = $this->keywordsPopularList($iMaxCount, isset($aParams['context_id']) ? $aParams['context_id'] : 0);
         if(!$aKeywords)
             return $bAsArray ? array() : '';
 

+ 1 - 1
template/scripts/BxBaseServiceCategory.php

@@ -40,7 +40,7 @@ class BxBaseServiceCategory extends BxDol
 
         if (!($o = BxDolCategory::getObjectInstance($sObject)))
             return $bShowEmpty ? MsgBox(_t('_Empty')) : '';
-
+        
 		$sResult = $o->getCategoriesList($bShowEmptyCategories);
 		if(empty($sResult))
 			return $bShowEmpty ? MsgBox(_t('_Empty')) : '';

+ 7 - 1
template/scripts/BxBaseServiceMetatags.php

@@ -51,7 +51,13 @@ class BxBaseServiceMetatags extends BxDol
     	$iMaxCount = isset($aParams['max_count']) ? (int)$aParams['max_count'] : BX_METATAGS_KEYWORDS_IN_CLOUD;
     	$bShowEmpty = isset($aParams['show_empty']) ? (bool)$aParams['show_empty'] : false;
 
-        $sResult = BxDolMetatags::getObjectInstance($sObject)->getKeywordsCloud($mixedSection, $iMaxCount);
+        $aContextInfo = bx_get_page_info();
+        if (isset($aContextInfo['context_module']) && isset($aContextInfo['profile_context_id'])){
+            $sResult = BxDolMetatags::getObjectInstance($sObject)->getKeywordsCloud($mixedSection, $iMaxCount, false, ['context_id' => $aContextInfo['profile_context_id']]);
+        }
+        else{
+            $sResult = BxDolMetatags::getObjectInstance($sObject)->getKeywordsCloud($mixedSection, $iMaxCount);
+        }
         if(empty($sResult))
 			return $bShowEmpty ? MsgBox(_t('_Empty')) : '';