45 $aOxActionToCacheIds = array(
46 'oxbargain' =>
'RSS_BARGAIN',
47 'oxtop5' =>
'RSS_TopShop',
48 'oxnewest' =>
'RSS_NewArts'
51 $sFileCacheName = $aOxActionToCacheIds[$sOxActionId];
53 if (is_null($sFileCacheName)) {
57 return $sFileCacheName;
91 $oShop = $this->
getConfig()->getActiveShop();
92 $this->_aChannel[
'title'] = $oShop->oxshops__oxname->value;
94 $this->_aChannel[
'description'] =
'';
96 $aLangIds = $oLang->getLanguageIds();
97 $this->_aChannel[
'language'] = $aLangIds[$oLang->getBaseLanguage()];
98 $this->_aChannel[
'copyright'] = $oShop->oxshops__oxname->value;
99 $this->_aChannel[
'selflink'] =
'';
101 $this->_aChannel[
'managingEditor'] = $oShop->oxshops__oxinfoemail->value;
102 if ($oShop->oxshops__oxfname) {
103 $this->_aChannel[
'managingEditor'] .=
" ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})";
108 $this->_aChannel[
'generator'] = $oShop->oxshops__oxname->value;
109 $this->_aChannel[
'image'][
'url'] = $this->
getConfig()->getImageUrl() .
'logo.png';
112 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'];
113 $this->_aChannel[
'image'][
'link'] = $this->_aChannel[
'link'];
128 return $name .
'_' . $oConfig->getShopId() .
'_' .
oxRegistry::getLang()->getBaseLanguage() .
'_' . (int) $oConfig->getShopCurrency();
142 if ($aRes[
'timestamp'] > time() - self::CACHE_TTL) {
143 return $aRes[
'content'];
164 $sLastBuildDate = $aData2[
'content'][
'lastBuildDate'];
165 $aData2[
'content'][
'lastBuildDate'] =
'';
166 $aData[
'lastBuildDate'] =
'';
167 if (!strcmp(serialize($aData), serialize($aData2[
'content']))) {
168 return $sLastBuildDate;
172 return date(
'D, d M Y H:i:s O');
189 $aData = array(
'timestamp' => time(),
'content' => $aContent);
210 foreach ($oList as $oArticle) {
211 $oItem =
new stdClass();
212 $oActCur = $this->
getConfig()->getActShopCurrencyObject();
214 if ($oPrice = $oArticle->getPrice()) {
215 $sFrom = ($oArticle->isRangePrice()) ?
oxRegistry::getLang()->translateString(
'PRICE_FROM') :
'';
216 $sPrice .=
' ' . $sFrom . $oLang->formatCurrency($oPrice->getBruttoPrice(), $oActCur) .
" " . $oActCur->sign;
218 $oItem->title = strip_tags($oArticle->oxarticles__oxtitle->value . $sPrice);
219 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oArticle->getLink());
220 $oItem->isGuidPermalink =
true;
224 $oItem->description = $oArticle->getLongDesc();
226 $oItem->description = $oArticle->getLongDescription()->value;
229 if (trim(str_replace(
' ',
'', (strip_tags($oItem->description)))) ==
'') {
230 $oItem->description = $oArticle->oxarticles__oxshortdesc->value;
233 $oItem->description = trim($oItem->description);
234 if ($sThumb = $oArticle->getThumbnailUrl()) {
235 $oItem->description =
"<img src='$sThumb' border=0 align='left' hspace=5>" . $oItem->description;
237 $oItem->description = $oStr->htmlspecialchars($oItem->description);
239 if ($oArticle->oxarticles__oxtimestamp->value) {
240 list($date, $time) = explode(
' ', $oArticle->oxarticles__oxtimestamp->value);
241 $date = explode(
'-', $date);
242 $time = explode(
':', $time);
243 $oItem->date = date(
'D, d M Y H:i:s O', mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]));
245 $oItem->date = date(
'D, d M Y H:i:s O', time());
268 $sUrl .= $sUri .
'&lang=' . $iLang;
272 $sUrl = $oEncoder->getDynamicUrl($sUrl,
"rss/{$sTitle}/", $iLang);
289 $oShop = $this->
getConfig()->getActiveShop();
291 return $oShop->oxshops__oxname->value .
"/" . $sTitle;
302 $sUrl = $this->
getConfig()->getShopUrl();
304 if ($oStr->strpos($sUrl,
'?') !==
false) {
305 if (!$oStr->preg_match(
'/[?&](amp;)?$/i', $sUrl)) {
329 protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null)
333 $this->_aChannel[
'selflink'] = $sRssUrl;
336 $this->_aChannel[
'link'] = $this->_aChannel[
'image'][
'link'] = $sTargetUrl;
339 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'] = $sTitle;
340 $this->_aChannel[
'image'][
'description'] = $this->_aChannel[
'description'] = $sDesc;
342 $this->_aChannel[
'items'] = $aItems;
345 $this->_aChannel[
'lastBuildDate'] = $this->
_getLastBuildDate($sTag, $this->_aChannel);
348 $this->_aChannel[
'lastBuildDate'] = date(
'D, d M Y H:i:s O',
oxRegistry::get(
"oxUtilsDate")->getTime());
362 $iLang = $oLang->getBaseLanguage();
364 return $this->
_prepareFeedName($oLang->translateString(
'TOP_OF_THE_SHOP', $iLang));
388 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_TOPSHOP))) {
392 $oArtList =
oxNew(
'oxarticlelist');
393 $oArtList->loadTop5Articles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
399 $oLang->translateString(
'TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
416 $iLang = $oLang->getBaseLanguage();
418 return $this->
_prepareFeedName($oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $iLang));
442 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_NEWARTS))) {
445 $oArtList =
oxNew(
'oxarticlelist');
446 $oArtList->loadNewestArticles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
452 $oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
471 $iLang = $oLang->getBaseLanguage();
474 return $this->
_prepareFeedName($sTitle . $oLang->translateString(
'PRODUCTS', $iLang));
486 $sCatPathString =
'';
490 $sCatPathString = $oCat->oxcategories__oxtitle->value . $sSep . $sCatPathString;
493 $oCat = $oCat->getParentCategory();
496 return $sCatPathString;
513 "cl=rss&fnc=catarts&cat=" . urlencode($oCat->
getId()),
514 sprintf($oLang->translateString(
'CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value)
529 $sId = $oCat->
getId();
530 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_CATARTS . $sId))) {
534 $oArtList =
oxNew(
'oxarticlelist');
535 $oArtList->setCustomSorting(
'oc.oxtime desc');
536 $oArtList->loadCategoryArticles($oCat->
getId(), null, $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
540 self::RSS_CATARTS . $sId,
542 sprintf($oLang->translateString(
'S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value),
581 $sParams =
"searchparam=" . urlencode($sSearch);
583 $sParams .=
"&searchcnid=" . urlencode($sCatId);
587 $sParams .=
"&searchvendor=" . urlencode($sVendorId);
590 if ($sManufacturerId) {
591 $sParams .=
"&searchmanufacturer=" . urlencode($sManufacturerId);
612 $oObj =
oxNew($sObject);
613 if ($oObj->load($sId)) {
614 return $oObj->$sField->value;
637 if ($sTitle = $this->
_getObjectField($sCatId,
'oxcategory',
'oxcategories__oxtitle')) {
638 $sCatTitle = sprintf($oLang->translateString(
'CATEGORY_S', $oLang->getBaseLanguage()), $sTitle);
641 if ($sTitle = $this->
_getObjectField($sVendorId,
'oxvendor',
'oxvendor__oxtitle')) {
642 $sVendorTitle = sprintf($oLang->translateString(
'VENDOR_S', $oLang->getBaseLanguage()), $sTitle);
644 $sManufacturerTitle =
'';
645 if ($sTitle = $this->
_getObjectField($sManufacturerId,
'oxmanufacturer',
'oxmanufacturers__oxtitle')) {
646 $sManufacturerTitle = sprintf($oLang->translateString(
'MANUFACTURER_S', $oLang->getBaseLanguage()), $sTitle);
649 $sRet = sprintf($oLang->translateString($sSearch, $oLang->getBaseLanguage()), $sId);
651 $sRet = str_replace(
'<TAG_CATEGORY>', $sCatTitle, $sRet);
652 $sRet = str_replace(
'<TAG_VENDOR>', $sVendorTitle, $sRet);
653 $sRet = str_replace(
'<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet);
673 $sUrl = $this->
_prepareUrl(
"cl=rss&fnc=searcharts", $oLang->translateString(
'SEARCH', $oLang->getBaseLanguage()));
676 if (strpos($sUrl,
'?') !==
false) {
680 return $sUrl . $sJoin . $this->
_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId);
701 $oConfig->setConfigParam(
'iNrofCatArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
703 $oArtList =
oxNew(
'oxsearch')->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId,
oxNew(
'oxarticle')->getViewName() .
'.oxtimestamp desc');
710 $this->
_getSearchParamsTranslation(
'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER',
getStr()->htmlspecialchars($sSearch), $sCatId, $sVendorId, $sManufacturerId),
729 $iLang = $oLang->getBaseLanguage();
731 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $iLang), $oArticle->oxarticles__oxtitle->value));
746 $iLang = $oLang->getBaseLanguage();
749 "cl=rss&fnc=recommlists&anid=" . $oArticle->
getId(),
750 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oArticle->oxarticles__oxtitle->value
767 foreach ($oList as $oRecommList) {
768 $oItem =
new stdClass();
769 $oItem->title = $oRecommList->oxrecommlists__oxtitle->value;
770 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink());
771 $oItem->isGuidPermalink =
true;
772 $oItem->description = $oRecommList->oxrecommlists__oxdesc->value;
791 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_ARTRECOMMLISTS . $oArticle->
getId()))) {
796 $oConfig->setConfigParam(
'iNrofCrossellArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
798 $oList =
oxNew(
'oxrecommlist')->getRecommListsByIds(array($oArticle->
getId()));
799 if ($oList == null) {
800 $oList =
oxNew(
'oxlist');
805 self::RSS_ARTRECOMMLISTS . $oArticle->
getId(),
807 sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $oLang->getBaseLanguage()), $oArticle->oxarticles__oxtitle->value),
826 $iLang = $oLang->getBaseLanguage();
828 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $iLang), $oRecommList->oxrecommlists__oxtitle->value));
843 $iLang = $oLang->getBaseLanguage();
846 "cl=rss&fnc=recommlistarts&recommid=" . $oRecommList->
getId(),
847 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oRecommList->oxrecommlists__oxtitle->value
862 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_RECOMMLISTARTS . $oRecommList->
getId()))) {
866 $oList =
oxNew(
'oxarticlelist');
867 $oList->loadRecommArticles($oRecommList->
getId(),
' order by oxobject2list.oxtimestamp desc limit ' . $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
871 self::RSS_RECOMMLISTARTS . $oRecommList->
getId(),
873 sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $oLang->getBaseLanguage()), $oRecommList->oxrecommlists__oxtitle->value),
890 $iLang = $oLang->getBaseLanguage();
916 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_BARGAIN))) {
920 $oArtList =
oxNew(
'oxarticlelist');
921 $oArtList->loadActionArticles(
'OXBARGAIN', $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
927 $oLang->translateString(
'BARGAIN_PRODUCTS', $oLang->getBaseLanguage()),
952 return @unlink($sFilePath);