52 $oShop = $this->
getConfig()->getActiveShop();
53 $this->_aChannel[
'title'] = $oShop->oxshops__oxname->value;
55 $this->_aChannel[
'description'] =
'';
57 $aLangIds = $oLang->getLanguageIds();
58 $this->_aChannel[
'language'] = $aLangIds[$oLang->getBaseLanguage()];
59 $this->_aChannel[
'copyright'] = $oShop->oxshops__oxname->value;
60 $this->_aChannel[
'selflink'] =
'';
62 $this->_aChannel[
'managingEditor'] = $oShop->oxshops__oxinfoemail->value;
63 if ( $oShop->oxshops__oxfname ) {
64 $this->_aChannel[
'managingEditor'] .=
" ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})";
69 $this->_aChannel[
'generator'] = $oShop->oxshops__oxname->value;
70 $this->_aChannel[
'image'][
'url'] = $this->
getConfig()->getImageUrl().
'logo.png';
73 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'];
74 $this->_aChannel[
'image'][
'link'] = $this->_aChannel[
'link'];
88 return $name.
'_'.$oConfig->getShopId().
'_'.
oxRegistry::getLang()->getBaseLanguage().
'_'.(int) $oConfig->getShopCurrency();
102 if ($aRes[
'timestamp'] > time() - self::CACHE_TTL) {
103 return $aRes[
'content'];
123 $sLastBuildDate = $aData2[
'content'][
'lastBuildDate'];
124 $aData2[
'content'][
'lastBuildDate'] =
'';
125 $aData[
'lastBuildDate'] =
'';
126 if (!strcmp(serialize($aData), serialize($aData2[
'content']))) {
127 return $sLastBuildDate;
130 return date(
'D, d M Y H:i:s O');
147 $aData = array(
'timestamp' => time(),
'content' => $aContent );
167 foreach ($oList as $oArticle) {
168 $oItem =
new stdClass();
169 $oActCur = $this->
getConfig()->getActShopCurrencyObject();
171 if ( $oPrice = $oArticle->getPrice() ) {
172 $sPrice =
" " . $oArticle->getPriceFromPrefix().$oLang->formatCurrency( $oPrice->getBruttoPrice(), $oActCur ) .
" ". $oActCur->sign;
174 $oItem->title = strip_tags($oArticle->oxarticles__oxtitle->value . $sPrice);
175 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oArticle->getLink());
176 $oItem->isGuidPermalink =
true;
180 $oItem->description = $oArticle->getLongDesc();
182 $oItem->description = $oArticle->getLongDescription()->value;
185 if (trim(str_replace(
' ',
'', (strip_tags($oItem->description)))) ==
'') {
186 $oItem->description = $oArticle->oxarticles__oxshortdesc->value;
189 $oItem->description = trim($oItem->description);
190 if ( $sThumb = $oArticle->getThumbnailUrl() ) {
191 $oItem->description =
"<img src='$sThumb' border=0 align='left' hspace=5>".$oItem->description;
193 $oItem->description = $oStr->htmlspecialchars( $oItem->description );
195 if ( $oArticle->oxarticles__oxtimestamp->value ) {
196 list($date, $time) = explode(
' ', $oArticle->oxarticles__oxtimestamp->value);
197 $date = explode(
'-', $date);
198 $time = explode(
':', $time);
199 $oItem->date = date(
'D, d M Y H:i:s O', mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]) );
201 $oItem->date = date(
'D, d M Y H:i:s O', time() );
223 $sUrl .= $sUri.
'&lang='.$iLang;
227 $sUrl = $oEncoder->getDynamicUrl( $sUrl,
"rss/{$sTitle}/", $iLang );
244 $oShop = $this->
getConfig()->getActiveShop();
246 return $oShop->oxshops__oxname->value .
"/" . $sTitle;
257 $sUrl = $this->
getConfig()->getShopUrl();
259 if ( $oStr->strpos($sUrl,
'?') !== false ) {
260 if ( !$oStr->preg_match(
'/[?&](amp;)?$/i', $sUrl)) {
282 protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null)
286 $this->_aChannel[
'selflink'] = $sRssUrl;
289 $this->_aChannel[
'link'] = $this->_aChannel[
'image'][
'link'] = $sTargetUrl;
292 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'] = $sTitle;
293 $this->_aChannel[
'image'][
'description'] = $this->_aChannel[
'description'] = $sDesc;
295 $this->_aChannel[
'items'] = $aItems;
298 $this->_aChannel[
'lastBuildDate'] = $this->
_getLastBuildDate($sTag, $this->_aChannel);
301 $this->_aChannel[
'lastBuildDate'] = date(
'D, d M Y H:i:s O',
oxRegistry::get(
"oxUtilsDate")->getTime() );
315 $iLang = $oLang->getBaseLanguage();
316 return $this->
_prepareFeedName( $oLang->translateString(
'TOP_OF_THE_SHOP', $iLang ) );
340 if ( ( $this->_aChannel = $this->
_loadFromCache( self::RSS_TOPSHOP ) ) ) {
344 $oArtList =
oxNew(
'oxarticlelist' );
345 $oArtList->loadTop5Articles( $this->
getConfig()->getConfigParam(
'iRssItemsCount' ) );
351 $oLang->translateString(
'TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage() ),
369 $iLang = $oLang->getBaseLanguage();
370 return $this->
_prepareFeedName( $oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $iLang ) );
394 if ( ( $this->_aChannel = $this->
_loadFromCache(self::RSS_NEWARTS ) ) ) {
397 $oArtList =
oxNew(
'oxarticlelist' );
398 $oArtList->loadNewestArticles( $this->
getConfig()->getConfigParam(
'iRssItemsCount' ) );
404 $oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage() ),
423 $iLang = $oLang->getBaseLanguage();
425 return $this->
_prepareFeedName( $sTitle . $oLang->translateString(
'PRODUCTS', $iLang ) );
437 $sCatPathString =
'';
441 $sCatPathString = $oCat->oxcategories__oxtitle->value.$sSep.$sCatPathString ;
444 $oCat = $oCat->getParentCategory();
446 return $sCatPathString;
461 return $this->
_prepareUrl(
"cl=rss&fnc=catarts&cat=".urlencode($oCat->
getId()),
462 sprintf($oLang->translateString(
'CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage() ), $oCat->oxcategories__oxtitle->value));
476 $sId = $oCat->
getId();
477 if ( ( $this->_aChannel = $this->
_loadFromCache( self::RSS_CATARTS.$sId ) ) ) {
481 $oArtList =
oxNew(
'oxarticlelist' );
482 $oArtList->setCustomSorting(
'oc.oxtime desc');
483 $oArtList->loadCategoryArticles($oCat->
getId(), null, $this->
getConfig()->getConfigParam(
'iRssItemsCount' ));
487 self::RSS_CATARTS.$sId,
489 sprintf($oLang->translateString(
'S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage() ), $oCat->oxcategories__oxtitle->value),
528 $sParams =
"searchparam=".urlencode($sSearch);
530 $sParams .=
"&searchcnid=".urlencode($sCatId);
534 $sParams .=
"&searchvendor=".urlencode($sVendorId);
537 if ($sManufacturerId) {
538 $sParams .=
"&searchmanufacturer=".urlencode($sManufacturerId);
559 $oObj =
oxNew($sObject);
560 if ($oObj->load($sId)) {
561 return $oObj->$sField->value;
583 if ($sTitle = $this->
_getObjectField($sCatId,
'oxcategory',
'oxcategories__oxtitle')) {
584 $sCatTitle = sprintf($oLang->translateString(
'CATEGORY_S', $oLang->getBaseLanguage() ), $sTitle);
587 if ($sTitle = $this->
_getObjectField($sVendorId,
'oxvendor',
'oxvendor__oxtitle')) {
588 $sVendorTitle = sprintf($oLang->translateString(
'VENDOR_S', $oLang->getBaseLanguage() ), $sTitle);
590 $sManufacturerTitle =
'';
591 if ($sTitle = $this->
_getObjectField($sManufacturerId,
'oxmanufacturer',
'oxmanufacturers__oxtitle')) {
592 $sManufacturerTitle = sprintf($oLang->translateString(
'MANUFACTURER_S', $oLang->getBaseLanguage() ), $sTitle);
595 $sRet = sprintf($oLang->translateString( $sSearch, $oLang->getBaseLanguage() ), $sId);
597 $sRet = str_replace(
'<TAG_CATEGORY>', $sCatTitle, $sRet);
598 $sRet = str_replace(
'<TAG_VENDOR>', $sVendorTitle, $sRet);
599 $sRet = str_replace(
'<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet);
619 $sUrl = $this->
_prepareUrl(
"cl=rss&fnc=searcharts", $oLang->translateString(
'SEARCH', $oLang->getBaseLanguage()));
622 if (strpos($sUrl,
'?') !==
false) {
625 return $sUrl.$sJoin.$this->_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId);
648 $oConfig->setConfigParam(
'iNrofCatArticles', $oConfig->getConfigParam(
'iRssItemsCount' ));
650 $oArtList =
oxNew(
'oxsearch' )->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId,
oxNew(
'oxarticle')->getViewName().
'.oxtimestamp desc');
657 $this->
_getSearchParamsTranslation(
'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER',
getStr()->htmlspecialchars( $sSearch ), $sCatId, $sVendorId, $sManufacturerId),
674 $iLang = $oLang->getBaseLanguage();
675 return $this->
_prepareFeedName( sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $iLang ), $oArticle->oxarticles__oxtitle->value) );
688 $iLang = $oLang->getBaseLanguage();
689 return $this->
_prepareUrl(
"cl=rss&fnc=recommlists&anid=".$oArticle->
getId(),
690 $oLang->translateString(
"LISTMANIA", $iLang ) .
"/" . $oArticle->oxarticles__oxtitle->value );
704 foreach ($oList as $oRecommList) {
705 $oItem =
new stdClass();
706 $oItem->title = $oRecommList->oxrecommlists__oxtitle->value;
707 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink());
708 $oItem->isGuidPermalink =
true;
709 $oItem->description = $oRecommList->oxrecommlists__oxdesc->value;
725 if ( ( $this->_aChannel = $this->
_loadFromCache( self::RSS_ARTRECOMMLISTS.$oArticle->
getId() ) ) ) {
730 $oConfig->setConfigParam(
'iNrofCrossellArticles', $oConfig->getConfigParam(
'iRssItemsCount' ));
732 $oList =
oxNew(
'oxrecommlist' )->getRecommListsByIds(array($oArticle->
getId()));
733 if ($oList == null) {
734 $oList =
oxNew(
'oxlist');
739 self::RSS_ARTRECOMMLISTS.$oArticle->
getId(),
741 sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $oLang->getBaseLanguage() ), $oArticle->oxarticles__oxtitle->value),
758 $iLang = $oLang->getBaseLanguage();
759 return $this->
_prepareFeedName( sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $iLang ), $oRecommList->oxrecommlists__oxtitle->value) );
772 $iLang = $oLang->getBaseLanguage();
773 return $this->
_prepareUrl(
"cl=rss&fnc=recommlistarts&recommid=".$oRecommList->
getId(),
774 $oLang->translateString(
"LISTMANIA", $iLang ) .
"/" . $oRecommList->oxrecommlists__oxtitle->value );
786 if ( ( $this->_aChannel = $this->
_loadFromCache( self::RSS_RECOMMLISTARTS.$oRecommList->
getId() ) ) ) {
790 $oList =
oxNew(
'oxarticlelist' );
791 $oList->loadRecommArticles( $oRecommList->
getId(),
' order by oxobject2list.oxtimestamp desc limit '. $this->
getConfig()->getConfigParam(
'iRssItemsCount' ) );
795 self::RSS_RECOMMLISTARTS.$oRecommList->
getId(),
797 sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $oLang->getBaseLanguage() ), $oRecommList->oxrecommlists__oxtitle->value),
814 $iLang = $oLang->getBaseLanguage();
815 return $this->
_prepareFeedName( $oLang->translateString(
'BARGAIN', $iLang ) );
839 if ( ( $this->_aChannel = $this->
_loadFromCache( self::RSS_BARGAIN ) ) ) {
843 $oArtList =
oxNew(
'oxarticlelist' );
844 $oArtList->loadActionArticles(
'OXBARGAIN', $this->
getConfig()->getConfigParam(
'iRssItemsCount' ) );
850 $oLang->translateString(
'BARGAIN_PRODUCTS', $oLang->getBaseLanguage() ),