AntonLV 7 years ago
parent
commit
4a0d8c8f1d

+ 14 - 1
inc/classes/BxDolCmts.php

@@ -305,6 +305,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
                     `RootStylePrefix` AS `root_style_prefix`,
                     `RootStylePrefix` AS `root_style_prefix`,
                     `BaseUrl` AS `base_url`,
                     `BaseUrl` AS `base_url`,
                     `ObjectVote` AS `object_vote`,
                     `ObjectVote` AS `object_vote`,
+                    `ObjectReaction` AS `object_reaction`,
                     `ObjectScore` AS `object_score`,
                     `ObjectScore` AS `object_score`,
                     `ObjectReport` AS `object_report`,
                     `ObjectReport` AS `object_report`,
                     `TriggerTable` AS `trigger_table`,
                     `TriggerTable` AS `trigger_table`,
@@ -444,7 +445,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
     public function getVoteObject($iId)
     public function getVoteObject($iId)
     {
     {
         if(empty($this->_aSystem['object_vote']))
         if(empty($this->_aSystem['object_vote']))
-        	$this->_aSystem['object_vote'] = 'sys_cmts';
+            $this->_aSystem['object_vote'] = 'sys_cmts';
 
 
         $oVote = BxDolVote::getObjectInstance($this->_aSystem['object_vote'], $iId, true, $this->_oTemplate);
         $oVote = BxDolVote::getObjectInstance($this->_aSystem['object_vote'], $iId, true, $this->_oTemplate);
         if(!$oVote || !$oVote->isEnabled())
         if(!$oVote || !$oVote->isEnabled())
@@ -453,6 +454,18 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         return $oVote;
         return $oVote;
     }
     }
 
 
+    public function getReactionObject($iId)
+    {
+        if(empty($this->_aSystem['object_reaction']))
+            $this->_aSystem['object_reaction'] = 'sys_cmts_reactions';
+
+        $oReaction = BxDolVote::getObjectInstance($this->_aSystem['object_reaction'], $iId, true, $this->_oTemplate);
+        if(!$oReaction || !$oReaction->isEnabled())
+            return false;
+
+        return $oReaction;
+    }
+
     public function getScoreObject($iId)
     public function getScoreObject($iId)
     {
     {
         if(empty($this->_aSystem['object_score']))
         if(empty($this->_aSystem['object_score']))

+ 1 - 0
inc/classes/BxDolCmtsQuery.php

@@ -154,6 +154,7 @@ class BxDolCmtsQuery extends BxDolDb
 
 
         $sQuery = "SELECT
         $sQuery = "SELECT
                 `{$this->_sTable}`.`cmt_id`,
                 `{$this->_sTable}`.`cmt_id`,
+                `{$this->_sTableIds}`.`id` AS `cmt_unique_id`,
                 `{$this->_sTable}`.`cmt_parent_id`,
                 `{$this->_sTable}`.`cmt_parent_id`,
                 `{$this->_sTable}`.`cmt_vparent_id`,
                 `{$this->_sTable}`.`cmt_vparent_id`,
                 `{$this->_sTable}`.`cmt_object_id`,
                 `{$this->_sTable}`.`cmt_object_id`,

File diff suppressed because it is too large
+ 0 - 0
install/sql/system.sql


+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -2233,6 +2233,7 @@ If it is not enabled then please consider implement this optimization, since it
   <string name="_sys_menu_item_title_cmts_administration"><![CDATA[Comments]]></string>
   <string name="_sys_menu_item_title_cmts_administration"><![CDATA[Comments]]></string>
 	<string name="_sys_menu_item_title_cmts_item_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_cmts_item_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_cmts_item_edit"><![CDATA[Edit]]></string>
 	<string name="_sys_menu_item_title_cmts_item_edit"><![CDATA[Edit]]></string>
+        <string name="_sys_menu_item_title_cmts_item_reaction"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_reply"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_reply"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_score"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_score"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_vote"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_vote"><![CDATA[]]></string>
@@ -2297,6 +2298,7 @@ If it is not enabled then please consider implement this optimization, since it
   <string name="_sys_menu_item_title_system_cmts_administration"><![CDATA[Comments]]></string>
   <string name="_sys_menu_item_title_system_cmts_administration"><![CDATA[Comments]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_edit"><![CDATA[Edit]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_edit"><![CDATA[Edit]]></string>
+        <string name="_sys_menu_item_title_system_cmts_item_reaction"><![CDATA[Reaction]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_reply"><![CDATA[Reply]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_reply"><![CDATA[Reply]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_report"><![CDATA[Report]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_report"><![CDATA[Report]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_score"><![CDATA[Score]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_score"><![CDATA[Score]]></string>

+ 1 - 0
modules/boonex/lucid/data/template/system/comment.html

@@ -17,6 +17,7 @@
                     <bx_if:show_attached>
                     <bx_if:show_attached>
                         <div class="__style_prefix__-attached bx-def-margin-thd-leftright-neg bx-clearfix">__attached__</div>
                         <div class="__style_prefix__-attached bx-def-margin-thd-leftright-neg bx-clearfix">__attached__</div>
                     </bx_if:show_attached>
                     </bx_if:show_attached>
+                    <div class="__style_prefix__-reactions">__reactions__</div>
                 </div>
                 </div>
             </div>
             </div>
             __actions__
             __actions__

+ 2 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -2234,6 +2234,7 @@
 	<string name="_sys_menu_item_title_cmts_administration"><![CDATA[Комментарии]]></string>
 	<string name="_sys_menu_item_title_cmts_administration"><![CDATA[Комментарии]]></string>
 	<string name="_sys_menu_item_title_cmts_item_delete"><![CDATA[Удалить]]></string>
 	<string name="_sys_menu_item_title_cmts_item_delete"><![CDATA[Удалить]]></string>
 	<string name="_sys_menu_item_title_cmts_item_edit"><![CDATA[Редактировать]]></string>
 	<string name="_sys_menu_item_title_cmts_item_edit"><![CDATA[Редактировать]]></string>
+        <string name="_sys_menu_item_title_cmts_item_reaction"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_reply"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_reply"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_score"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_score"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_vote"><![CDATA[]]></string>
 	<string name="_sys_menu_item_title_cmts_item_vote"><![CDATA[]]></string>
@@ -2297,6 +2298,7 @@
   <string name="_sys_menu_item_title_system_cmts_administration"><![CDATA[Комментарии]]></string>
   <string name="_sys_menu_item_title_system_cmts_administration"><![CDATA[Комментарии]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_delete"><![CDATA[Удалить]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_delete"><![CDATA[Удалить]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_edit"><![CDATA[Редактировать]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_edit"><![CDATA[Редактировать]]></string>
+        <string name="_sys_menu_item_title_system_cmts_item_reaction"><![CDATA[Реагировать]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_reply"><![CDATA[Ответить]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_reply"><![CDATA[Ответить]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_report"><![CDATA[Пожаловаться]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_report"><![CDATA[Пожаловаться]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_score"><![CDATA[Голосовать (За/Против)]]></string>
 	<string name="_sys_menu_item_title_system_cmts_item_score"><![CDATA[Голосовать (За/Против)]]></string>

+ 1 - 0
template/comment.html

@@ -18,6 +18,7 @@
                     <bx_if:show_attached>
                     <bx_if:show_attached>
                         <div class="__style_prefix__-attached bx-def-margin-thd-leftright-neg bx-clearfix">__attached__</div>
                         <div class="__style_prefix__-attached bx-def-margin-thd-leftright-neg bx-clearfix">__attached__</div>
                     </bx_if:show_attached>
                     </bx_if:show_attached>
+                    <div class="__style_prefix__-reactions">__reactions__</div>
                 </div>
                 </div>
             </div>
             </div>
             __actions__
             __actions__

+ 32 - 28
template/css/cmts.css

@@ -141,26 +141,30 @@
         position: relative;
         position: relative;
     	text-align: left;
     	text-align: left;
     }
     }
-	div.cmt-cont .bullet {
-		padding: 0px 5px;
-		padding: 0px 0.3rem;
+    div.cmt-cont .bullet {
+        padding: 0px 5px;
+        padding: 0px 0.3rem;
     }
     }
     div.cmt-cont .cmt-body img {
     div.cmt-cont .cmt-body img {
         max-width: 100%;
         max-width: 100%;
     	height: auto;
     	height: auto;
     }
     }
     div.cmt-cont .cmt-post-reply .bx-form-element-wrapper {
     div.cmt-cont .cmt-post-reply .bx-form-element-wrapper {
-		margin-top: 10px;
+        margin-top: 10px;
     	margin-top: 0.5rem;
     	margin-top: 0.5rem;
     }
     }
-	div.cmt-cont .cmt-post-reply .bx-form-element-wrapper:first-child {
-		margin-top: 0px;
+    div.cmt-cont .cmt-post-reply .bx-form-element-wrapper:first-child {
+        margin-top: 0px;
     }
     }
     span.cmt-body-see-more a {
     span.cmt-body-see-more a {
-		font-weight: bold;
+        font-weight: bold;
+    }
+    div.cmt-reactions .bx-vote-counter-wrapper {
+        line-height: 2.0rem;
+        font-size: 1.2rem;
     }
     }
     div.cmt-attached-preview {
     div.cmt-attached-preview {
-		overflow:hidden;
+        overflow:hidden;
     }
     }
     div.cmt-attached-preview,
     div.cmt-attached-preview,
     div.cmt-attached-preview img {
     div.cmt-attached-preview img {
@@ -173,27 +177,27 @@
     	position: relative;
     	position: relative;
     	float: left;
     	float: left;
 	}
 	}
-	div.cmt-attached-preview img {
-		background-position: center center;
-		background-repeat: no-repeat;
-		background-size: contain;
-	}
-	
+    div.cmt-attached-preview img {
+        background-position: center center;
+        background-repeat: no-repeat;
+        background-size: contain;
+    }
+
     /*--- Comment Actions ---*/
     /*--- Comment Actions ---*/
-	div.cmt-actions {
-		position: relative;
-		text-align: left;
-	}
-	div.cmt-meta-ago,
-	div.cmt-comment-manage-link, 
-	div.cmt-actions ul.bx-menu-hor,
-	div.cmt-points-wrp {
-		position: relative;
-		float: left;
-	}
-	div.cmt-actions li .bx-vote {
-	   margin-right: 1.25rem;
-	}
+    div.cmt-actions {
+        position: relative;
+        text-align: left;
+    }
+    div.cmt-meta-ago,
+    div.cmt-comment-manage-link, 
+    div.cmt-actions ul.bx-menu-hor,
+    div.cmt-points-wrp {
+        position: relative;
+        float: left;
+    }
+    div.cmt-actions li .bx-vote {
+       margin-right: 1.25rem;
+    }
     div.cmt-comment-manage .bx-menu-ver li {
     div.cmt-comment-manage .bx-menu-ver li {
 		white-space: nowrap;
 		white-space: nowrap;
     }
     }

+ 10 - 3
template/scripts/BxBaseCmts.php

@@ -275,14 +275,20 @@ class BxBaseCmts extends BxDolCmts
             }
             }
         }
         }
 
 
+        $sReactions = '';
+        if(($oReaction = $this->getReactionObject($aCmt['cmt_unique_id'])) !== false)
+            $sReactions = $oReaction->getCounter(array(
+                'show_counter' => true
+            ));
+
         return $this->_oTemplate->parseHtmlByName('comment.html', array_merge(array(
         return $this->_oTemplate->parseHtmlByName('comment.html', array_merge(array(
             'system' => $this->_sSystem,
             'system' => $this->_sSystem,
             'style_prefix' => $this->_sStylePrefix,
             'style_prefix' => $this->_sStylePrefix,
             'js_object' => $this->_sJsObjName,
             'js_object' => $this->_sJsObjName,
             'id' => $aCmt['cmt_id'],
             'id' => $aCmt['cmt_id'],
-        	'anchor' => $this->getItemAnchor($aCmt['cmt_id']),
+            'anchor' => $this->getItemAnchor($aCmt['cmt_id']),
             'class' => $sClass,
             'class' => $sClass,
-        	'class_cnt' => $sClassCnt,
+            'class_cnt' => $sClassCnt,
             'bx_if:show_reply_to' => array(
             'bx_if:show_reply_to' => array(
                 'condition' => !empty($aTmplReplyTo),
                 'condition' => !empty($aTmplReplyTo),
                 'content' => $aTmplReplyTo
                 'content' => $aTmplReplyTo
@@ -298,8 +304,9 @@ class BxBaseCmts extends BxDolCmts
                     'attached' => $sAttachments
                     'attached' => $sAttachments
                 )
                 )
             ),
             ),
+            'reactions' => $sReactions,
             'actions' => $sActions,
             'actions' => $sActions,
-            'replies' =>  $sReplies
+            'replies' =>  $sReplies,
         ), $this->_getTmplVarsAuthor($aCmt), $this->_getTmplVarsText($aCmt)));
         ), $this->_getTmplVarsAuthor($aCmt), $this->_getTmplVarsText($aCmt)));
     }
     }
 
 

+ 16 - 3
template/scripts/BxBaseCmtsMenuActions.php

@@ -48,13 +48,26 @@ class BxBaseCmtsMenuActions extends BxTemplMenuCustom
     {
     {
         $oVote = $this->_oCmts->getVoteObject($this->_aCmt['cmt_unique_id']);
         $oVote = $this->_oCmts->getVoteObject($this->_aCmt['cmt_unique_id']);
         if(!$oVote)
         if(!$oVote)
-        	return false;
+            return false;
 
 
         $aVotesParams = array('dynamic_mode' => $this->_bDynamicMode);
         $aVotesParams = array('dynamic_mode' => $this->_bDynamicMode);
         if($this->_bShowTitles)
         if($this->_bShowTitles)
-		    $aVotesParams['show_do_vote_label'] = true;
+            $aVotesParams['show_do_vote_label'] = true;
+
+        return $oVote->getElementInline($aVotesParams);
+    }
+
+    protected function _getMenuItemItemReaction($aItem)
+    {
+        $oReaction = $this->_oCmts->getReactionObject($this->_aCmt['cmt_unique_id']);
+        if(!$oReaction)
+            return false;
+
+        $aReactionParams = array('dynamic_mode' => $this->_bDynamicMode);
+        if($this->_bShowTitles)
+            $aReactionParams['show_do_vote_label'] = true;
 
 
-    	return $oVote->getElementInline($aVotesParams);
+        return $oReaction->getElementInline($aReactionParams);
     }
     }
 
 
     protected function _getMenuItemItemScore($aItem)
     protected function _getMenuItemItemScore($aItem)

Some files were not shown because too many files changed in this diff