38 if (isset($iLang) && $iLang != $oArticle->getLanguage()) {
39 $sId = $oArticle->getId();
40 $oArticle =
oxNew(
'oxArticle');
41 $oArticle->setSkipAssign(
true);
42 $oArticle->loadInLang($iLang, $sId);
61 if ($oRecomm = $this->
_getRecomm($oArticle, $iLang)) {
63 if (!($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oRecomm->getId(),
true))) {
71 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderRecomm")->getRecommUri($oRecomm, $iLang);
72 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
74 $aStdParams = array(
'recommid' => $oRecomm->getId(),
'listtype' => $this->
_getListType());
79 $oArticle->getBaseStdLink($iLang),
107 $oView = $this->
getConfig()->getActiveView();
108 if ($oView instanceof
oxView) {
109 $oList = $oView->getActiveRecommList();
122 return $this->
getConfig()->getActiveView()->getListType();
139 if ($sTag = $this->
_getTag($oArticle, $iLang)) {
140 $iShopId = $this->
getConfig()->getShopId();
142 $oArticleTags =
oxNew(
'oxArticleTagList');
143 $oArticleTags->setArticleId($oArticle->getId());
144 $oArticleTags->getStdTagLink($sTag);
146 $sStdUrl = $oArticleTags->getStdTagLink($sTag);
149 if ($sSeoUri =
oxRegistry::get(
"oxSeoEncoderTag")->getTagUri($sTag, $iLang, $oArticle->getId())) {
173 $oView = $this->
getConfig()->getTopActiveView();
174 if ($oView instanceof
oxView) {
175 $sTag = $oView->getTag();
192 startProfile(__FUNCTION__);
200 oxRegistry::get(
"oxSeoEncoderCategory")->getCategoryUri($oCategory, $iLang) . $sTitle,
201 $oArticle->getId(), $iLang
203 $sCatId = $oCategory->getId();
208 $oArticle->getBaseStdLink($iLang),
209 array(
'cnid' => $sCatId)
218 stopProfile(__FUNCTION__);
234 startProfile(__FUNCTION__);
241 $sActCatId = $oActCat->getId();
243 $sActCatId = $oActCat->getId();
247 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $sActCatId,
true))) {
250 if ($oActCat->isPriceCategory()) {
251 $blInCat = $oArticle->inPriceCategory($sActCatId);
253 $blInCat = $oArticle->inCategory($sActCatId);
261 stopProfile(__FUNCTION__);
277 $oView = $this->
getConfig()->getActiveView();
278 if ($oView instanceof
oxUBase) {
279 $oCat = $oView->getActiveCategory();
280 } elseif ($oView instanceof
oxView) {
281 $oCat = $oView->getActCategory();
299 $sArtId = $oArticle->getId();
300 if (isset($oArticle->oxarticles__oxparentid->value) && $oArticle->oxarticles__oxparentid->value) {
301 $sArtId = $oArticle->oxarticles__oxparentid->value;
306 $sQ =
"select oxcatnid from " . getViewName(
"oxobject2category") .
" where oxobjectid = " . $oDb->quote($sArtId) .
" order by oxtime";
309 if (($sMainCatId = $this->
_loadFromCache($sIdent,
"oxarticle")) ===
false) {
310 $sMainCatId = $oDb->getOne($sQ);
316 $oMainCat =
oxNew(
"oxCategory");
317 if (!$oMainCat->load($sMainCatId)) {
335 startProfile(__FUNCTION__);
338 $sMainCatId = $oMainCat ? $oMainCat->getId() :
'';
341 if (!($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $sMainCatId,
true))) {
354 $oArticle->getBaseStdLink($iLang),
364 stopProfile(__FUNCTION__);
382 if (!($sTitle = $oArticle->oxarticles__oxtitle->value)) {
384 if (($sParentId = $oArticle->oxarticles__oxparentid->value)) {
387 if (!isset(self::$_aTitleCache[$sParentId])) {
389 $sQ =
"select oxtitle from " . $oArticle->getViewName() .
" where oxid = " . $oDb->quote($sParentId);
390 self::$_aTitleCache[$sParentId] = $oDb->getOne($sQ);
392 $sTitle = self::$_aTitleCache[$sParentId];
397 if ($oArticle->oxarticles__oxvarselect->value) {
398 $sTitle .= ($sTitle ?
' ' :
'') . $oArticle->oxarticles__oxvarselect->value .
' ';
399 } elseif (!$sTitle || ($oArticle->oxarticles__oxparentid->value)) {
401 $sTitle .= ($sTitle ?
' ' :
'') . $oArticle->oxarticles__oxartnum->value;
404 return $this->
_prepareTitle($sTitle,
false, $oArticle->getLanguage()) .
'.html';
418 startProfile(__FUNCTION__);
421 if ($oVendor = $this->
_getVendor($oArticle, $iLang)) {
423 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oVendor->getId(),
true))) {
431 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorUri($oVendor, $iLang);
432 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
434 $aStdParams = array(
'cnid' =>
"v_" . $oVendor->getId(),
'listtype' => $this->
_getListType());
439 $oArticle->getBaseStdLink($iLang),
450 stopProfile(__FUNCTION__);
466 $oView = $this->
getConfig()->getActiveView();
469 if ($sActVendorId = $oArticle->oxarticles__oxvendorid->value) {
470 if ($oView instanceof
oxView && ($oActVendor = $oView->getActVendor())) {
471 $oVendor = $oActVendor;
473 $oVendor =
oxNew(
"oxVendor");
475 if ($oVendor->getId() !== $sActVendorId) {
476 $oVendor =
oxNew(
"oxVendor");
477 if (!$oVendor->loadInLang($iLang, $sActVendorId)) {
498 startProfile(__FUNCTION__);
501 if ($blRegenerate || !($sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oManufacturer->getId(),
true))) {
509 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderManufacturer")->getManufacturerUri($oManufacturer, $iLang);
510 $sSeoUri = $this->
_processSeoUrl($sSeoUri . $sTitle, $oArticle->getId(), $iLang);
512 $aStdParams = array(
'mnid' => $oManufacturer->getId(),
'listtype' => $this->
_getListType());
517 $oArticle->getBaseStdLink($iLang),
524 $oManufacturer->getId()
528 stopProfile(__FUNCTION__);
544 $oManufacturer = null;
545 if ($sActManufacturerId = $oArticle->oxarticles__oxmanufacturerid->value) {
546 $oView = $this->
getConfig()->getActiveView();
548 if ($oView instanceof
oxView && ($oActManufacturer = $oView->getActManufacturer())) {
549 $oManufacturer = $oActManufacturer;
551 $oManufacturer =
oxNew(
"oxManufacturer");
554 if ($oManufacturer->getId() !== $sActManufacturerId || $oManufacturer->getLanguage() != $iLang) {
555 $oManufacturer =
oxNew(
"oxManufacturer");
556 if (!$oManufacturer->loadInLang($iLang, $sActManufacturerId)) {
557 $oManufacturer = null;
562 return $oManufacturer;
575 if (!isset($iLang)) {
576 $iLang = $oArticle->getLanguage();
593 if (!isset($iLang)) {
594 $iLang = $oArticle->getLanguage();
635 $sIdQuoted = $oDb->quote($oArticle->getId());
636 $oDb->execute(
"delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxarticle'");
637 $oDb->execute(
"delete from oxobject2seodata where oxobjectid = $sIdQuoted");
651 $oArticle =
oxNew(
"oxArticle");
652 $oArticle->setSkipAssign(
true);
653 if ($oArticle->loadInLang($iLang, $sObjectId)) {