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'];
89 return $name .
'_' . $oConfig->getShopId() .
'_' .
oxRegistry::getLang()->getBaseLanguage() .
'_' . (int) $oConfig->getShopCurrency();
103 if ($aRes[
'timestamp'] > time() - self::CACHE_TTL) {
104 return $aRes[
'content'];
125 $sLastBuildDate = $aData2[
'content'][
'lastBuildDate'];
126 $aData2[
'content'][
'lastBuildDate'] =
'';
127 $aData[
'lastBuildDate'] =
'';
128 if (!strcmp(serialize($aData), serialize($aData2[
'content']))) {
129 return $sLastBuildDate;
133 return date(
'D, d M Y H:i:s O');
150 $aData = array(
'timestamp' => time(),
'content' => $aContent);
171 foreach ($oList as $oArticle) {
172 $oItem =
new stdClass();
173 $oActCur = $this->
getConfig()->getActShopCurrencyObject();
175 if ($oPrice = $oArticle->getPrice()) {
176 $sFrom = ($oArticle->isRangePrice()) ?
oxRegistry::getLang()->translateString(
'PRICE_FROM') :
'';
177 $sPrice .=
' ' . $sFrom . $oLang->formatCurrency($oPrice->getBruttoPrice(), $oActCur) .
" " . $oActCur->sign;
179 $oItem->title = strip_tags($oArticle->oxarticles__oxtitle->value . $sPrice);
180 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oArticle->getLink());
181 $oItem->isGuidPermalink =
true;
185 $oItem->description = $oArticle->getLongDesc();
187 $oItem->description = $oArticle->getLongDescription()->value;
190 if (trim(str_replace(
' ',
'', (strip_tags($oItem->description)))) ==
'') {
191 $oItem->description = $oArticle->oxarticles__oxshortdesc->value;
194 $oItem->description = trim($oItem->description);
195 if ($sThumb = $oArticle->getThumbnailUrl()) {
196 $oItem->description =
"<img src='$sThumb' border=0 align='left' hspace=5>" . $oItem->description;
198 $oItem->description = $oStr->htmlspecialchars($oItem->description);
200 if ($oArticle->oxarticles__oxtimestamp->value) {
201 list($date, $time) = explode(
' ', $oArticle->oxarticles__oxtimestamp->value);
202 $date = explode(
'-', $date);
203 $time = explode(
':', $time);
204 $oItem->date = date(
'D, d M Y H:i:s O', mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]));
206 $oItem->date = date(
'D, d M Y H:i:s O', time());
229 $sUrl .= $sUri .
'&lang=' . $iLang;
233 $sUrl = $oEncoder->getDynamicUrl($sUrl,
"rss/{$sTitle}/", $iLang);
250 $oShop = $this->
getConfig()->getActiveShop();
252 return $oShop->oxshops__oxname->value .
"/" . $sTitle;
263 $sUrl = $this->
getConfig()->getShopUrl();
265 if ($oStr->strpos($sUrl,
'?') !==
false) {
266 if (!$oStr->preg_match(
'/[?&](amp;)?$/i', $sUrl)) {
288 protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null)
292 $this->_aChannel[
'selflink'] = $sRssUrl;
295 $this->_aChannel[
'link'] = $this->_aChannel[
'image'][
'link'] = $sTargetUrl;
298 $this->_aChannel[
'image'][
'title'] = $this->_aChannel[
'title'] = $sTitle;
299 $this->_aChannel[
'image'][
'description'] = $this->_aChannel[
'description'] = $sDesc;
301 $this->_aChannel[
'items'] = $aItems;
304 $this->_aChannel[
'lastBuildDate'] = $this->
_getLastBuildDate($sTag, $this->_aChannel);
307 $this->_aChannel[
'lastBuildDate'] = date(
'D, d M Y H:i:s O',
oxRegistry::get(
"oxUtilsDate")->getTime());
321 $iLang = $oLang->getBaseLanguage();
323 return $this->
_prepareFeedName($oLang->translateString(
'TOP_OF_THE_SHOP', $iLang));
347 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_TOPSHOP))) {
351 $oArtList =
oxNew(
'oxarticlelist');
352 $oArtList->loadTop5Articles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
358 $oLang->translateString(
'TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
375 $iLang = $oLang->getBaseLanguage();
377 return $this->
_prepareFeedName($oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $iLang));
401 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_NEWARTS))) {
404 $oArtList =
oxNew(
'oxarticlelist');
405 $oArtList->loadNewestArticles($this->
getConfig()->getConfigParam(
'iRssItemsCount'));
411 $oLang->translateString(
'NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
430 $iLang = $oLang->getBaseLanguage();
433 return $this->
_prepareFeedName($sTitle . $oLang->translateString(
'PRODUCTS', $iLang));
445 $sCatPathString =
'';
449 $sCatPathString = $oCat->oxcategories__oxtitle->value . $sSep . $sCatPathString;
452 $oCat = $oCat->getParentCategory();
455 return $sCatPathString;
472 "cl=rss&fnc=catarts&cat=" . urlencode($oCat->
getId()),
473 sprintf($oLang->translateString(
'CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value)
488 $sId = $oCat->
getId();
489 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_CATARTS . $sId))) {
493 $oArtList =
oxNew(
'oxarticlelist');
494 $oArtList->setCustomSorting(
'oc.oxtime desc');
495 $oArtList->loadCategoryArticles($oCat->
getId(), null, $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
499 self::RSS_CATARTS . $sId,
501 sprintf($oLang->translateString(
'S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value),
540 $sParams =
"searchparam=" . urlencode($sSearch);
542 $sParams .=
"&searchcnid=" . urlencode($sCatId);
546 $sParams .=
"&searchvendor=" . urlencode($sVendorId);
549 if ($sManufacturerId) {
550 $sParams .=
"&searchmanufacturer=" . urlencode($sManufacturerId);
571 $oObj =
oxNew($sObject);
572 if ($oObj->load($sId)) {
573 return $oObj->$sField->value;
596 if ($sTitle = $this->
_getObjectField($sCatId,
'oxcategory',
'oxcategories__oxtitle')) {
597 $sCatTitle = sprintf($oLang->translateString(
'CATEGORY_S', $oLang->getBaseLanguage()), $sTitle);
600 if ($sTitle = $this->
_getObjectField($sVendorId,
'oxvendor',
'oxvendor__oxtitle')) {
601 $sVendorTitle = sprintf($oLang->translateString(
'VENDOR_S', $oLang->getBaseLanguage()), $sTitle);
603 $sManufacturerTitle =
'';
604 if ($sTitle = $this->
_getObjectField($sManufacturerId,
'oxmanufacturer',
'oxmanufacturers__oxtitle')) {
605 $sManufacturerTitle = sprintf($oLang->translateString(
'MANUFACTURER_S', $oLang->getBaseLanguage()), $sTitle);
608 $sRet = sprintf($oLang->translateString($sSearch, $oLang->getBaseLanguage()), $sId);
610 $sRet = str_replace(
'<TAG_CATEGORY>', $sCatTitle, $sRet);
611 $sRet = str_replace(
'<TAG_VENDOR>', $sVendorTitle, $sRet);
612 $sRet = str_replace(
'<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet);
632 $sUrl = $this->
_prepareUrl(
"cl=rss&fnc=searcharts", $oLang->translateString(
'SEARCH', $oLang->getBaseLanguage()));
635 if (strpos($sUrl,
'?') !==
false) {
639 return $sUrl . $sJoin . $this->
_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId);
660 $oConfig->setConfigParam(
'iNrofCatArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
662 $oArtList =
oxNew(
'oxsearch')->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId,
oxNew(
'oxarticle')->getViewName() .
'.oxtimestamp desc');
669 $this->
_getSearchParamsTranslation(
'SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER',
getStr()->htmlspecialchars($sSearch), $sCatId, $sVendorId, $sManufacturerId),
686 $iLang = $oLang->getBaseLanguage();
688 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $iLang), $oArticle->oxarticles__oxtitle->value));
701 $iLang = $oLang->getBaseLanguage();
704 "cl=rss&fnc=recommlists&anid=" . $oArticle->
getId(),
705 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oArticle->oxarticles__oxtitle->value
720 foreach ($oList as $oRecommList) {
721 $oItem =
new stdClass();
722 $oItem->title = $oRecommList->oxrecommlists__oxtitle->value;
723 $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink());
724 $oItem->isGuidPermalink =
true;
725 $oItem->description = $oRecommList->oxrecommlists__oxdesc->value;
742 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_ARTRECOMMLISTS . $oArticle->
getId()))) {
747 $oConfig->setConfigParam(
'iNrofCrossellArticles', $oConfig->getConfigParam(
'iRssItemsCount'));
749 $oList =
oxNew(
'oxrecommlist')->getRecommListsByIds(array($oArticle->
getId()));
750 if ($oList == null) {
751 $oList =
oxNew(
'oxlist');
756 self::RSS_ARTRECOMMLISTS . $oArticle->
getId(),
758 sprintf($oLang->translateString(
'LISTMANIA_LIST_FOR', $oLang->getBaseLanguage()), $oArticle->oxarticles__oxtitle->value),
775 $iLang = $oLang->getBaseLanguage();
777 return $this->
_prepareFeedName(sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $iLang), $oRecommList->oxrecommlists__oxtitle->value));
790 $iLang = $oLang->getBaseLanguage();
793 "cl=rss&fnc=recommlistarts&recommid=" . $oRecommList->
getId(),
794 $oLang->translateString(
"LISTMANIA", $iLang) .
"/" . $oRecommList->oxrecommlists__oxtitle->value
807 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_RECOMMLISTARTS . $oRecommList->
getId()))) {
811 $oList =
oxNew(
'oxarticlelist');
812 $oList->loadRecommArticles($oRecommList->
getId(),
' order by oxobject2list.oxtimestamp desc limit ' . $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
816 self::RSS_RECOMMLISTARTS . $oRecommList->
getId(),
818 sprintf($oLang->translateString(
'LISTMANIA_LIST_PRODUCTS', $oLang->getBaseLanguage()), $oRecommList->oxrecommlists__oxtitle->value),
835 $iLang = $oLang->getBaseLanguage();
861 if (($this->_aChannel = $this->
_loadFromCache(self::RSS_BARGAIN))) {
865 $oArtList =
oxNew(
'oxarticlelist');
866 $oArtList->loadActionArticles(
'OXBARGAIN', $this->
getConfig()->getConfigParam(
'iRssItemsCount'));
872 $oLang->translateString(
'BARGAIN_PRODUCTS', $oLang->getBaseLanguage()),