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

#1048 @mention tags fix, implementation in Albums

Alex Trofimov 8 лет назад
Родитель
Сommit
8bf5ac5084

+ 2 - 2
inc/classes/BxDolMetatags.php

@@ -276,7 +276,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
      */
     public function keywordsAdd($iId, $s) 
     {
-        return $this->_metaAdd($iId, ' ' . strip_tags($s), '/[\s]\#([\pL\pN_]+)/u', 'keywordsDelete', 'keywordsAdd', BX_METATAGS_KEYWORDS_MAX);
+        return $this->_metaAdd($iId, ' ' . strip_tags($s), '/[\s]\#([\pL\pN_]+)/u', 'keywordsDelete', 'keywordsAdd', BX_METATAGS_KEYWORDS_MAX, 'keyword');
     }
 
     /**
@@ -737,7 +737,7 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
      */
     public function mentionsAdd($iId, $s) 
     {
-        return $this->_metaAdd($iId, $s, '/data\-profile\-id="(\d+)"/u', 'mentionsDelete', 'mentionsAdd', BX_METATAGS_MENTIONS_MAX);
+        return $this->_metaAdd($iId, $s, '/data\-profile\-id="(\d+)"/u', 'mentionsDelete', 'mentionsAdd', BX_METATAGS_MENTIONS_MAX, 'mention');
     }
 
     /**

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

@@ -359,7 +359,7 @@ 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', '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', '', '', '', '');
 

+ 7 - 0
modules/boonex/albums/install/sql/install.sql

@@ -205,6 +205,13 @@ CREATE TABLE `bx_albums_meta_locations` (
   KEY `country_state_city` (`country`,`state`(8),`city`(8))
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
+CREATE TABLE `bx_albums_meta_mentions` (
+  `object_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `profile_id` (`profile_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
 -- TABLE: reports
 CREATE TABLE IF NOT EXISTS `bx_albums_reports` (
   `object_id` int(11) NOT NULL default '0',