AntonLV 5 年之前
父節點
當前提交
1decf1cf3b

+ 1 - 0
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -14,6 +14,7 @@
     <string name="_bx_timeline_option_enable_delete"><![CDATA[Разрешить владельцу ленты удалять сообщения]]></string>
     <string name="_bx_timeline_option_enable_show_all"><![CDATA[Показывать все сообщения в 'Общей хронике', включая те, что были написаны в персональных Хрониках]]></string>
     <string name="_bx_timeline_option_enable_count_all_views"><![CDATA[Считать просмотры для всех событий в хронике]]></string>
+    <string name="_bx_timeline_option_enable_repost_own_actions"><![CDATA[Репост использует собственные действия (просмотры, голосование и тп.)]]></string>
     <string name="_bx_timeline_option_events_per_page_profile"><![CDATA[Количество элементов на странице профайла]]></string>
     <string name="_bx_timeline_option_events_per_page_account"><![CDATA[Количество элементов на странице "панель аккаунта"]]></string>
     <string name="_bx_timeline_option_events_per_page_home"><![CDATA[Количество элементов на главной странице сайта]]></string>

+ 7 - 0
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -19,6 +19,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
     protected $_bAllowDelete;
     protected $_bShowAll;
     protected $_bCountAllViews;
+    protected $_bRepostOwnActions;
 
     protected $_bCacheItem;
     protected $_sCacheItemEngine;
@@ -328,6 +329,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         $this->_bAllowDelete = getParam($sOptionPrefix . 'enable_delete') == 'on';
         $this->_bShowAll = getParam($sOptionPrefix . 'enable_show_all') == 'on';
         $this->_bCountAllViews = getParam($sOptionPrefix . 'enable_count_all_views') == 'on';
+        $this->_bRepostOwnActions = getParam($sOptionPrefix . 'enable_repost_own_actions') == 'on';
 
         $this->_bCacheItem = getParam($sOptionPrefix . 'enable_cache_item') == 'on';
         $this->_sCacheItemEngine = getParam($sOptionPrefix . 'cache_item_engine');
@@ -447,6 +449,11 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         return $this->_bCountAllViews;
     }
 
+    public function isRepostOwnActions()
+    {
+        return $this->_bRepostOwnActions;
+    }
+
     public function isBriefCards()
     {
         return $this->_bBriefCards;

+ 9 - 0
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -2602,6 +2602,15 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                     'module' => $this->_oConfig->getName(),
                     'method' => 'get_timeline_repost_allowed_view',
                 );
+
+                if(!$this->_oConfig->isRepostOwnActions()) {
+                    $aResult['views'] = $aReposted['views'];
+                    $aResult['votes'] = $aReposted['votes'];
+                    $aResult['reactions'] = $aReposted['reactions'];
+                    $aResult['scores'] = $aReposted['scores'];
+                    $aResult['reports'] = $aReposted['reports'];
+                    $aResult['comments'] = $aReposted['comments'];
+                }
                 break;
         }
 

+ 1 - 0
modules/boonex/timeline/install/langs/en.xml

@@ -14,6 +14,7 @@
     <string name="_bx_timeline_option_enable_delete"><![CDATA[Allow Timeline owner to remove items]]></string>
     <string name="_bx_timeline_option_enable_show_all"><![CDATA[Show all items in Public Feed including ones which were posted in personal Feeds]]></string>
     <string name="_bx_timeline_option_enable_count_all_views"><![CDATA[Count views for all items in the Feed]]></string>
+    <string name="_bx_timeline_option_enable_repost_own_actions"><![CDATA[Repost uses its own actions (views, likes, etc)]]></string>
     <string name="_bx_timeline_option_events_per_page_profile"><![CDATA[Number of items on profile page]]></string>
     <string name="_bx_timeline_option_events_per_page_account"><![CDATA[Number of items on dashboard page]]></string>
     <string name="_bx_timeline_option_events_per_page_home"><![CDATA[Number of items on site home page]]></string>

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

@@ -253,7 +253,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_timeline_enable_edit', 'on', @iCategId, '_bx_timeline_option_enable_edit', 'checkbox', '', '', '', '', 1),
 ('bx_timeline_enable_delete', 'on', @iCategId, '_bx_timeline_option_enable_delete', 'checkbox', '', '', '', '', 2),
 ('bx_timeline_enable_count_all_views', '', @iCategId, '_bx_timeline_option_enable_count_all_views', 'checkbox', '', '', '', '', 3),
-('bx_timeline_events_hide', '', @iCategId, '_bx_timeline_option_events_hide', 'rlist', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:21:"get_actions_checklist";}', 4);
+('bx_timeline_enable_repost_own_actions', 'on', @iCategId, '_bx_timeline_option_enable_repost_own_actions', 'checkbox', '', '', '', '', 4),
+('bx_timeline_events_hide', '', @iCategId, '_bx_timeline_option_events_hide', 'rlist', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:21:"get_actions_checklist";}', 5);
 
 -- Category: Browse
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)