38 if (isset($iLang) && $iLang != $oArticle->getLanguage()) {
39 $sId = $oArticle->getId();
40 $oArticle =
oxNew(
'oxArticle');
41 $oArticle->setSkipAssign(
true);
42 $oArticle->loadInLang($iLang, $sId);
59 if ($oRecomm = $this->
_getRecomm($oArticle, $iLang)) {
61 if (!($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oRecomm->getId(),
true))) {
69 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderRecomm")->getRecommUri($oRecomm, $iLang);
70 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
72 $aStdParams = array(
'recommid' => $oRecomm->getId(),
'listtype' => $this->
_getListType());
77 $oArticle->getBaseStdLink($iLang),
103 $oView = $this->
getConfig()->getActiveView();
104 if ($oView instanceof
oxView) {
105 $oList = $oView->getActiveRecommList();
118 return $this->
getConfig()->getActiveView()->getListType();
133 if ($sTag = $this->
_getTag($oArticle, $iLang)) {
134 $iShopId = $this->
getConfig()->getShopId();
136 $oArticleTags =
oxNew(
'oxArticleTagList');
137 $oArticleTags->setArticleId($oArticle->getId());
138 $oArticleTags->getStdTagLink($sTag);
140 $sStdUrl = $oArticleTags->getStdTagLink($sTag);
143 if ($sSeoUri =
oxRegistry::get(
"oxSeoEncoderTag")->getTagUri($sTag, $iLang, $oArticle->getId())) {
165 $oView = $this->
getConfig()->getTopActiveView();
166 if ($oView instanceof
oxView) {
167 $sTag = $oView->getTag();
184 startProfile(__FUNCTION__);
192 oxRegistry::get(
"oxSeoEncoderCategory")->getCategoryUri($oCategory, $iLang) . $sTitle,
193 $oArticle->getId(), $iLang
195 $sCatId = $oCategory->getId();
200 $oArticle->getBaseStdLink($iLang),
201 array(
'cnid' => $sCatId)
210 stopProfile(__FUNCTION__);
226 startProfile(__FUNCTION__);
233 $sActCatId = $oActCat->getId();
235 $sActCatId = $oActCat->getId();
239 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $sActCatId,
true))) {
242 if ($oActCat->isPriceCategory()) {
243 $blInCat = $oArticle->inPriceCategory($sActCatId);
245 $blInCat = $oArticle->inCategory($sActCatId);
253 stopProfile(__FUNCTION__);
269 $oView = $this->
getConfig()->getActiveView();
270 if ($oView instanceof
oxUBase) {
271 $oCat = $oView->getActiveCategory();
272 } elseif ($oView instanceof
oxView) {
273 $oCat = $oView->getActCategory();
291 $sArtId = $oArticle->getId();
292 if (isset($oArticle->oxarticles__oxparentid->value) && $oArticle->oxarticles__oxparentid->value) {
293 $sArtId = $oArticle->oxarticles__oxparentid->value;
298 $sQ =
"select oxcatnid from " . getViewName(
"oxobject2category") .
" where oxobjectid = " . $oDb->quote($sArtId) .
" order by oxtime";
301 if (($sMainCatId = $this->
_loadFromCache($sIdent,
"oxarticle")) ===
false) {
302 $sMainCatId = $oDb->getOne($sQ);
308 $oMainCat =
oxNew(
"oxCategory");
309 if (!$oMainCat->load($sMainCatId)) {
327 startProfile(__FUNCTION__);
330 $sMainCatId = $oMainCat ? $oMainCat->getId() :
'';
333 if (!($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $sMainCatId,
true))) {
346 $oArticle->getBaseStdLink($iLang),
356 stopProfile(__FUNCTION__);
374 if (!($sTitle = $oArticle->oxarticles__oxtitle->value)) {
376 if (($sParentId = $oArticle->oxarticles__oxparentid->value)) {
379 if (!isset(self::$_aTitleCache[$sParentId])) {
381 $sQ =
"select oxtitle from " . $oArticle->getViewName() .
" where oxid = " . $oDb->quote($sParentId);
382 self::$_aTitleCache[$sParentId] = $oDb->getOne($sQ);
384 $sTitle = self::$_aTitleCache[$sParentId];
389 if ($oArticle->oxarticles__oxvarselect->value) {
390 $sTitle .= ($sTitle ?
' ' :
'') . $oArticle->oxarticles__oxvarselect->value .
' ';
391 } elseif (!$sTitle || ($oArticle->oxarticles__oxparentid->value)) {
393 $sTitle .= ($sTitle ?
' ' :
'') . $oArticle->oxarticles__oxartnum->value;
396 return $this->
_prepareTitle($sTitle,
false, $oArticle->getLanguage()) .
'.html';
410 startProfile(__FUNCTION__);
413 if ($oVendor = $this->
_getVendor($oArticle, $iLang)) {
415 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oVendor->getId(),
true))) {
423 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorUri($oVendor, $iLang);
424 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
426 $aStdParams = array(
'cnid' =>
"v_" . $oVendor->getId(),
'listtype' => $this->
_getListType());
431 $oArticle->getBaseStdLink($iLang),
442 stopProfile(__FUNCTION__);
458 $oView = $this->
getConfig()->getActiveView();
461 if ($sActVendorId = $oArticle->oxarticles__oxvendorid->value) {
462 if ($oView instanceof
oxView && ($oActVendor = $oView->getActVendor())) {
463 $oVendor = $oActVendor;
465 $oVendor =
oxNew(
"oxVendor");
467 if ($oVendor->getId() !== $sActVendorId) {
468 $oVendor =
oxNew(
"oxVendor");
469 if (!$oVendor->loadInLang($iLang, $sActVendorId)) {
490 startProfile(__FUNCTION__);
493 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oManufacturer->getId(),
true))) {
501 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderManufacturer")->getManufacturerUri($oManufacturer, $iLang);
502 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
504 $aStdParams = array(
'mnid' => $oManufacturer->getId(),
'listtype' => $this->
_getListType());
509 $oArticle->getBaseStdLink($iLang),
516 $oManufacturer->getId()
520 stopProfile(__FUNCTION__);
536 $oManufacturer = null;
537 if ($sActManufacturerId = $oArticle->oxarticles__oxmanufacturerid->value) {
538 $oView = $this->
getConfig()->getActiveView();
540 if ($oView instanceof
oxView && ($oActManufacturer = $oView->getActManufacturer())) {
541 $oManufacturer = $oActManufacturer;
543 $oManufacturer =
oxNew(
"oxManufacturer");
546 if ($oManufacturer->getId() !== $sActManufacturerId || $oManufacturer->getLanguage() != $iLang) {
547 $oManufacturer =
oxNew(
"oxManufacturer");
548 if (!$oManufacturer->loadInLang($iLang, $sActManufacturerId)) {
549 $oManufacturer = null;
554 return $oManufacturer;
567 if (!isset($iLang)) {
568 $iLang = $oArticle->getLanguage();
585 if (!isset($iLang)) {
586 $iLang = $oArticle->getLanguage();
625 $sIdQuoted = $oDb->quote($oArticle->getId());
626 $oDb->execute(
"delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxarticle'");
627 $oDb->execute(
"delete from oxobject2seodata where oxobjectid = $sIdQuoted");
641 $oArticle =
oxNew(
"oxArticle");
642 $oArticle->setSkipAssign(
true);
643 if ($oArticle->loadInLang($iLang, $sObjectId)) {