43 $aOxActionToCacheIds = array(
44 'oxbargain' =>
'RSS_BARGAIN',
45 'oxtop5' =>
'RSS_TopShop',
46 'oxnewest' =>
'RSS_NewArts'
49 $sFileCacheName = $aOxActionToCacheIds[$sOxActionId];
51 if (is_null($sFileCacheName)) {
55 return $sFileCacheName;
89 $oShop = $this->
getConfig()->getActiveShop();
90 $this->_aChannel[
'title'] = $oShop->oxshops__oxname->value;
92 $this->_aChannel[
'description'] =
'';
94 $aLangIds = $oLang->getLanguageIds();
95 $this->_aChannel[
'language'] = $aLangIds[$oLang->getBaseLanguage()];
96 $this->_aChannel[
'copyright'] = $oShop->oxshops__oxname->value;
97 $this->_aChannel[
'selflink'] =
'';
99 $this->_aChannel[
'managingEditor'] = $oShop->oxshops__oxinfoemail->value;
100 if ($oShop->oxshops__oxfname) {
101 $this->_aChannel[
'managingEditor'] .=
" ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})";
106 $this->_aChannel[
'generator'] = $oShop->oxshops__oxname->value;
107 $this->_aChannel[
'image'][
'url'] = $this->
getConfig()->getImageUrl() .
'logo.png';
110 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'];
111 $this->_aChannel[
'image'][
'link'] = $this->_aChannel[
'link'];
126 return $name .
'_' . $oConfig->getShopId() .
'_' .
oxRegistry::getLang()->getBaseLanguage() .
'_' . (int) $oConfig->getShopCurrency();
140 if ($aRes[
'timestamp'] > time() - self::CACHE_TTL) {
141 return $aRes[
'content'];
162 $sLastBuildDate = $aData2[
'content'][
'lastBuildDate'];
163 $aData2[
'content'][
'lastBuildDate'] =
'';
164 $aData[
'lastBuildDate'] =
'';
165 if (!strcmp(serialize($aData), serialize($aData2[
'content']))) {
166 return $sLastBuildDate;
170 return date(
'D, d M Y H:i:s O');
187 $aData = array(
'timestamp' => time(),
'content' => $aContent);
208 foreach ($oList as $oArticle) {
209 $oItem =
new stdClass();
210 $oActCur = $this->
getConfig()->getActShopCurrencyObject();
212 if ($oPrice = $oArticle->getPrice()) {
213 $sFrom = ($oArticle->isRangePrice()) ?
oxRegistry::getLang()->translateString(
'PRICE_FROM') :
'';
214 $sPrice .=
' ' . $sFrom . $oLang->formatCurrency($oPrice->getBruttoPrice(), $oActCur) .
" " . $oActCur->sign;
216 $oItem->title = strip_tags($oArticle->oxarticles__oxtitle->value . $sPrice);
217 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oArticle->getLink());
218 $oItem->isGuidPermalink =
true;
222 $oItem->description = $oArticle->getLongDesc();
224 $oItem->description = $oArticle->getLongDescription()->value;
227 if (trim(str_replace(
' ',
'', (strip_tags($oItem->description)))) ==
'') {
228 $oItem->description = $oArticle->oxarticles__oxshortdesc->value;
231 $oItem->description = trim($oItem->description);
232 if ($sThumb = $oArticle->getThumbnailUrl()) {
233 $oItem->description =
"<img src='$sThumb' border=0 align='left' hspace=5>" . $oItem->description;
235 $oItem->description = $oStr->htmlspecialchars($oItem->description);
237 if ($oArticle->oxarticles__oxtimestamp->value) {
238 list($date, $time) = explode(
' ', $oArticle->oxarticles__oxtimestamp->value);
239 $date = explode(
'-', $date);
240 $time = explode(
':', $time);
241 $oItem->date = date(
'D, d M Y H:i:s O', mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]));
243 $oItem->date = date(
'D, d M Y H:i:s O', time());
266 $sUrl .= $sUri .
'&lang=' . $iLang;
270 $sUrl = $oEncoder->getDynamicUrl($sUrl,
"rss/{$sTitle}/", $iLang);
287 $oShop = $this->
getConfig()->getActiveShop();
289 return $oShop->oxshops__oxname->value .
"/" . $sTitle;
300 $sUrl = $this->
getConfig()->getShopUrl();
302 if ($oStr->strpos($sUrl,
'?') !==
false) {
303 if (!$oStr->preg_match(
'/[?&](amp;)?$/i', $sUrl)) {
325 protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null)
329 $this->_aChannel[
'selflink'] = $sRssUrl;
332 $this->_aChannel[
'link'] = $this->_aChannel[
'image'][
'link'] = $sTargetUrl;
335 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'] = $sTitle;
336 $this->_aChannel[
'image'][
'description'] = $this->_aChannel[
'description'] = $sDesc;
338 $this->_aChannel[
'items'] = $aItems;
341 $this->_aChannel[
'lastBuildDate'] = $this->
_getLastBuildDate($sTag, $this->_aChannel);
344 $this->_aChannel[
'lastBuildDate'] = date(
'D, d M Y H:i:s O',
oxRegistry::get(
"oxUtilsDate")->getTime());
358 $iLang = $oLang->getBaseLanguage();
360 return $this->
_prepareFeedName($oLang->translateString(
'TOP_OF_THE_SHOP', $iLang));
384 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_TOPSHOP))) {
388 $oArtList =
oxNew(
'oxarticlelist');
389 $oArtList->loadTop5Articles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
395 $oLang->translateString(
'TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
412 $iLang = $oLang->getBaseLanguage();
414 return $this->
_prepareFeedName($oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $iLang));
438 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_NEWARTS))) {
441 $oArtList =
oxNew(
'oxarticlelist');
442 $oArtList->loadNewestArticles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
448 $oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
467 $iLang = $oLang->getBaseLanguage();
470 return $this->
_prepareFeedName($sTitle . $oLang->translateString(
'PRODUCTS', $iLang));
482 $sCatPathString =
'';
486 $sCatPathString = $oCat->oxcategories__oxtitle->value . $sSep . $sCatPathString;
489 $oCat = $oCat->getParentCategory();
492 return $sCatPathString;
509 "cl=rss&fnc=catarts&cat=" . urlencode($oCat->
getId()),
510 sprintf($oLang->translateString(
'CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value)
525 $sId = $oCat->
getId();
526 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_CATARTS . $sId))) {
530 $oArtList =
oxNew(
'oxarticlelist');
531 $oArtList->setCustomSorting(
'oc.oxtime desc');
532 $oArtList->loadCategoryArticles($oCat->
getId(), null, $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
536 self::RSS_CATARTS . $sId,
538 sprintf($oLang->translateString(
'S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value),
577 $sParams =
"searchparam=" . urlencode($sSearch);
579 $sParams .=
"&searchcnid=" . urlencode($sCatId);
583 $sParams .=
"&searchvendor=" . urlencode($sVendorId);
586 if ($sManufacturerId) {
587 $sParams .=
"&searchmanufacturer=" . urlencode($sManufacturerId);
608 $oObj =
oxNew($sObject);
609 if ($oObj->load($sId)) {
610 return $oObj->$sField->value;
633 if ($sTitle = $this->
_getObjectField($sCatId,
'oxcategory',
'oxcategories__oxtitle')) {
634 $sCatTitle = sprintf($oLang->translateString(
'CATEGORY_S', $oLang->getBaseLanguage()), $sTitle);
637 if ($sTitle = $this->
_getObjectField($sVendorId,
'oxvendor',
'oxvendor__oxtitle')) {
638 $sVendorTitle = sprintf($oLang->translateString(
'VENDOR_S', $oLang->getBaseLanguage()), $sTitle);
640 $sManufacturerTitle =
'';
641 if ($sTitle = $this->
_getObjectField($sManufacturerId,
'oxmanufacturer',
'oxmanufacturers__oxtitle')) {
642 $sManufacturerTitle = sprintf($oLang->translateString(
'MANUFACTURER_S', $oLang->getBaseLanguage()), $sTitle);
645 $sRet = sprintf($oLang->translateString($sSearch, $oLang->getBaseLanguage()), $sId);
647 $sRet = str_replace(
'<TAG_CATEGORY>', $sCatTitle, $sRet);
648 $sRet = str_replace(
'<TAG_VENDOR>', $sVendorTitle, $sRet);
649 $sRet = str_replace(
'<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet);
669 $sUrl = $this->
_prepareUrl(
"cl=rss&fnc=searcharts", $oLang->translateString(
'SEARCH', $oLang->getBaseLanguage()));
672 if (strpos($sUrl,
'?') !==
false) {
676 return $sUrl . $sJoin . $this->
_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId);
697 $oConfig->setConfigParam(
'iNrofCatArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
699 $oArtList =
oxNew(
'oxsearch')->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId,
oxNew(
'oxarticle')->getViewName() .
'.oxtimestamp desc');
706 $this->
_getSearchParamsTranslation(
'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER',
getStr()->htmlspecialchars($sSearch), $sCatId, $sVendorId, $sManufacturerId),
723 $iLang = $oLang->getBaseLanguage();
725 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $iLang), $oArticle->oxarticles__oxtitle->value));
738 $iLang = $oLang->getBaseLanguage();
741 "cl=rss&fnc=recommlists&anid=" . $oArticle->
getId(),
742 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oArticle->oxarticles__oxtitle->value
757 foreach ($oList as $oRecommList) {
758 $oItem =
new stdClass();
759 $oItem->title = $oRecommList->oxrecommlists__oxtitle->value;
760 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink());
761 $oItem->isGuidPermalink =
true;
762 $oItem->description = $oRecommList->oxrecommlists__oxdesc->value;
779 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_ARTRECOMMLISTS . $oArticle->
getId()))) {
784 $oConfig->setConfigParam(
'iNrofCrossellArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
786 $oList =
oxNew(
'oxrecommlist')->getRecommListsByIds(array($oArticle->
getId()));
787 if ($oList == null) {
788 $oList =
oxNew(
'oxlist');
793 self::RSS_ARTRECOMMLISTS . $oArticle->
getId(),
795 sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $oLang->getBaseLanguage()), $oArticle->oxarticles__oxtitle->value),
812 $iLang = $oLang->getBaseLanguage();
814 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $iLang), $oRecommList->oxrecommlists__oxtitle->value));
827 $iLang = $oLang->getBaseLanguage();
830 "cl=rss&fnc=recommlistarts&recommid=" . $oRecommList->
getId(),
831 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oRecommList->oxrecommlists__oxtitle->value
844 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_RECOMMLISTARTS . $oRecommList->
getId()))) {
848 $oList =
oxNew(
'oxarticlelist');
849 $oList->loadRecommArticles($oRecommList->
getId(),
' order by oxobject2list.oxtimestamp desc limit ' . $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
853 self::RSS_RECOMMLISTARTS . $oRecommList->
getId(),
855 sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $oLang->getBaseLanguage()), $oRecommList->oxrecommlists__oxtitle->value),
872 $iLang = $oLang->getBaseLanguage();
898 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_BARGAIN))) {
902 $oArtList =
oxNew(
'oxarticlelist');
903 $oArtList->loadActionArticles(
'OXBARGAIN', $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
909 $oLang->translateString(
'BARGAIN_PRODUCTS', $oLang->getBaseLanguage()),
934 return @unlink($sFilePath);