فهرست منبع

#2613 Badges: display badges in comments

RomanL 6 سال پیش
والد
کامیت
24ae3cf5ae
3فایلهای تغییر یافته به همراه9 افزوده شده و 5 حذف شده
  1. 2 1
      inc/classes/BxDolCmts.php
  2. 3 0
      template/css/cmts.css
  3. 4 4
      template/scripts/BxBaseCmtsMenuUnitMeta.php

+ 2 - 1
inc/classes/BxDolCmts.php

@@ -1483,7 +1483,8 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             $oProfile->getDisplayName(),
             $oProfile->getUrl(),
             $oProfile->getThumb(),
-            $oProfile->getUnit(0, array('template' => 'unit_wo_info'))
+            $oProfile->getUnit(0, array('template' => 'unit_wo_info')),
+            $oProfile->getBadges()
         );
     }
 

+ 3 - 0
template/css/cmts.css

@@ -521,6 +521,9 @@ div.cmt-mood-buttons a:hover {
 div.cmt-mood-buttons i.cmt-mood-star {
     color: transparent;
 }
+.cmt-meta .bx-badge-compact {
+    display: inline-block;
+}
 
 /*--- Rating Block Styles ---*/
 .cmts-box-rating div.cmt-mood i.cmt-mood-star,

+ 4 - 4
template/scripts/BxBaseCmtsMenuUnitMeta.php

@@ -43,18 +43,18 @@ class BxBaseCmtsMenuUnitMeta extends BxTemplMenuUnitMeta
 
     protected function _getMenuItemAuthor($aItem)
     {
-        list($sAuthorName, $sAuthorLink, $sAuthorIcon, $sAuthorUnit) = $this->_oCmts->getAuthorInfo($this->_aCmt['cmt_author_id']);
-
+        list($sAuthorName, $sAuthorLink, $sAuthorIcon, $sAuthorUnit, $sAuthorBadges) = $this->_oCmts->getAuthorInfo($this->_aCmt['cmt_author_id']);
+    
         if(!empty($sAuthorLink))
             return $this->getUnitMetaItemLink($sAuthorName, array(
                 'href' => $sAuthorLink,
                 'class' => $this->_sStylePrefix . '-username',
                 'title' => bx_html_attribute($sAuthorName),
-            ));
+            )). $sAuthorBadges;
         else
             return $this->getUnitMetaItemText($sAuthorName, array(
                 'class' => $this->_sStylePrefix . '-username'
-            ));
+            )). $sAuthorBadges;
     }
     
     protected function _getMenuItemDate($aItem)