Kaynağa Gözat

Ticket #907 - point 2.4

AntonLV 9 yıl önce
ebeveyn
işleme
ffc9da4286

+ 10 - 8
modules/boonex/market/classes/BxMarketModule.php

@@ -223,17 +223,19 @@ class BxMarketModule extends BxBaseModTextModule
     	);
     }
 
-	public function serviceGetCover($iPhotoId)
+    public function serviceGetCover($iPhotoId)
     {
-    	$CNF = &$this->_oConfig->CNF;
+        $CNF = &$this->_oConfig->CNF;
 
-    	$oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
-    	$oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_COVER']);
+        $oTiGallery = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']);
+        $oTiPage = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_COVER']);
+        $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
 
-    	return array(
-    		'small' => $oImagesTranscoder ? $oImagesTranscoder->getFileUrl($iPhotoId) : '',
-    		'big' => $oStorage ? $oStorage->getFileUrlById($iPhotoId) : ''
-    	);
+        return array(
+            'medium' => $oTiGallery ? $oTiGallery->getFileUrl($iPhotoId) : '',
+            'large' => $oTiPage ? $oTiPage->getFileUrl($iPhotoId) : '',
+            'big' => $oStorage ? $oStorage->getFileUrlById($iPhotoId) : ''
+        );
     }
 
     public function serviceGetFile($iFileId)

+ 23 - 17
studio/template/scripts/BxBaseStudioStore.php

@@ -800,24 +800,30 @@ class BxBaseStudioStore extends BxDolStudioStore
             $sDiscount = !$bFree && !empty($aItem['discount_single']) ? _t('_adm_str_txt_discount_csign', $aItem['author_currency_sign'], $aItem['discount_single']['price']) : '';
 
             $sIcon = !empty($aItem['thumbnail']['small']) ? $aItem['thumbnail']['small'] : BxDolStudioUtils::getIconDefault(BX_DOL_MODULE_TYPE_MODULE);
-			$bIcon = strpos($sIcon, '.') !== false;
-
-            $sImage = !empty($aItem['cover']['big']) ? $aItem['cover']['big'] : '';
-			$bImage = strpos($sImage, '.') !== false;
+            $bIcon = strpos($sIcon, '.') !== false;
+
+            $sImage = '';
+            if(!empty($aItem['cover']['medium']))
+                $sImage = $aItem['cover']['medium'];
+            else if(!empty($aItem['cover']['large']))
+                $sImage = $aItem['cover']['large'];
+            else if(!empty($aItem['cover']['big']))
+                $sImage = $aItem['cover']['big'];
+            $bImage = !empty($sImage) && strpos($sImage, '.') !== false;
+
+            $aTmplVarsRate = array();
+            $bTmplVarsRate = $bShowRating && !$bShoppingCart;
+            if($bTmplVarsRate)
+                $aTmplVarsRate = array(
+                    'rate' => $this->getVoteStars($aItem)
+                );
 
-			$aTmplVarsRate = array();
-			$bTmplVarsRate = $bShowRating && !$bShoppingCart;
-			if($bTmplVarsRate)
-			    $aTmplVarsRate = array(
-			        'rate' => $this->getVoteStars($aItem)
-			    );
-
-			$aTmplVarsVotes = array();
-			$bTmplVarsVotes = $bShowRating && !$bShoppingCart && (int)$aItem['votes_cnt'] > 0;
-			if($bTmplVarsVotes)
-			    $aTmplVarsVotes = array(
-			        'count' => (int)$aItem['votes_cnt']
-			    );
+            $aTmplVarsVotes = array();
+            $bTmplVarsVotes = $bShowRating && !$bShoppingCart && (int)$aItem['votes_cnt'] > 0;
+            if($bTmplVarsVotes)
+                $aTmplVarsVotes = array(
+                    'count' => (int)$aItem['votes_cnt']
+                );
 
             $sResult .= $oTemplate->parseHtmlByName('str_product_v2.html', array(
                 'js_object' => $sJsObject,