Sfoglia il codice sorgente

Ticket #4148 - Build-in API support: Ads

roman.lesnikov@gmail.com 2 anni fa
parent
commit
5c8f53ace1
1 ha cambiato i file con 14 aggiunte e 8 eliminazioni
  1. 14 8
      modules/boonex/ads/classes/BxAdsModule.php

+ 14 - 8
modules/boonex/ads/classes/BxAdsModule.php

@@ -2110,14 +2110,20 @@ class BxAdsModule extends BxBaseModTextModule
         $sInclude = $this->_oTemplate->addCss(array('timeline.css'), $bDynamic);
 
         $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
-        $aResult['text'] = $this->_oTemplate->parseHtmlByName('timeline_post_text.html', array(
-            'category_link' => $sCategoryLink,
-            'category_title' => $sCategory,
-            'category_title_attr' => bx_html_attribute($sCategory),
-            'price' => $sPrice,
-            'text' => $aResult['text']
-        )) . ($bDynamic ? $sInclude : '');
-
+        
+        if(bx_is_api()){
+            $aResult['price'] = $sPrice;
+            $aResult['category_title'] = $sCategory;
+        }
+        else{
+            $aResult['text'] = $this->_oTemplate->parseHtmlByName('timeline_post_text.html', array(
+                'category_link' => $sCategoryLink,
+                'category_title' => $sCategory,
+                'category_title_attr' => bx_html_attribute($sCategory),
+                'price' => $sPrice,
+                'text' => $aResult['text']
+            )) . ($bDynamic ? $sInclude : '');
+        }
         
         return $aResult;
     }