56 if ( isset( $iLang ) && $iLang != $oArticle->getLanguage() ) {
57 $sId = $oArticle->getId();
58 $oArticle =
oxNew(
'oxArticle' );
59 $oArticle->setSkipAssign(
true );
60 $oArticle->loadInLang( $iLang, $sId );
77 if ( $oRecomm = $this->
_getRecomm( $oArticle, $iLang ) ) {
79 if ( !( $sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oRecomm->getId(), true ) ) ) {
87 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderRecomm")->getRecommUri( $oRecomm, $iLang );
88 $sSeoUri = $this->
_processSeoUrl( $sSeoUri . $sTitle, $oArticle->getId(), $iLang );
90 $aStdParams = array(
'recommid' => $oRecomm->getId(),
'listtype' => $this->
_getListType() );
95 $oArticle->getBaseStdLink( $iLang ),
120 $oView = $this->
getConfig()->getActiveView();
121 if ( $oView instanceof
oxView ) {
122 $oList = $oView->getActiveRecommList();
134 return $this->
getConfig()->getActiveView()->getListType();
149 if ( $sTag = $this->
_getTag( $oArticle, $iLang ) ) {
150 $iShopId = $this->
getConfig()->getShopId();
151 $sStdUrl = $oArticle->getStdTagLink( $sTag );
154 if ( $sSeoUri =
oxRegistry::get(
"oxSeoEncoderTag")->getTagUri( $sTag, $iLang, $oArticle->getId() ) ) {
172 protected function _getTag( $oArticle, $iLang )
175 $oView = $this->
getConfig()->getTopActiveView();
176 if ( $oView instanceof
oxView ) {
177 $sTag = $oView->getTag();
193 startProfile(__FUNCTION__);
201 oxRegistry::get(
"oxSeoEncoderCategory")->getCategoryUri( $oCategory, $iLang ).$sTitle,
202 $oArticle->getId(), $iLang
204 $sCatId = $oCategory->getId();
209 $oArticle->getBaseStdLink( $iLang ),
210 array(
'cnid' => $sCatId )
219 stopProfile(__FUNCTION__);
235 startProfile(__FUNCTION__);
242 $sActCatId = $oActCat->getId();
244 $sActCatId = $oActCat->getId();
248 if ( $blRegenerate || !( $sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $sActCatId, true ) ) ) {
251 if ( $oActCat->isPriceCategory() ) {
252 $blInCat = $oArticle->inPriceCategory( $sActCatId );
254 $blInCat = $oArticle->inCategory( $sActCatId );
262 stopProfile(__FUNCTION__);
278 $oView = $this->
getConfig()->getActiveView();
279 if ( $oView instanceof
oxUBase ) {
280 $oCat = $oView->getActiveCategory();
281 } elseif ( $oView instanceof
oxView ) {
282 $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";
307 $sIdent = md5( $sQ );
309 if ( ( $sMainCatId = $this->
_loadFromCache( $sIdent,
"oxarticle" ) ) ===
false ) {
310 $sMainCatId = $oDb->getOne( $sQ );
312 $this->
_saveInCache( $sIdent, $sMainCatId,
"oxarticle" );
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__);
381 if ( !( $sTitle = $oArticle->oxarticles__oxtitle->value ) ) {
383 if ( ( $sParentId = $oArticle->oxarticles__oxparentid->value ) ) {
386 if ( !isset( self::$_aTitleCache[$sParentId] ) ) {
388 $sQ =
"select oxtitle from ".$oArticle->getViewName().
" where oxid = ".$oDb->quote( $sParentId );
389 self::$_aTitleCache[$sParentId] = $oDb->getOne( $sQ );
391 $sTitle = self::$_aTitleCache[$sParentId];
396 if ( $oArticle->oxarticles__oxvarselect->value ) {
397 $sTitle .= ( $sTitle ?
' ' :
'' ) . $oArticle->oxarticles__oxvarselect->value .
' ';
398 } elseif ( !$sTitle || ( $oArticle->oxarticles__oxparentid->value ) ) {
400 $sTitle .= ( $sTitle ?
' ' :
'' ) . $oArticle->oxarticles__oxartnum->value;
403 return $this->
_prepareTitle( $sTitle,
false, $oArticle->getLanguage() ) .
'.html';
417 startProfile(__FUNCTION__);
420 if ( $oVendor = $this->
_getVendor( $oArticle, $iLang ) ) {
422 if ( $blRegenerate || !( $sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oVendor->getId(), true ) ) ) {
430 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorUri( $oVendor, $iLang );
431 $sSeoUri = $this->
_processSeoUrl( $sSeoUri . $sTitle, $oArticle->getId(), $iLang );
433 $aStdParams = array(
'cnid' =>
"v_".$oVendor->getId(),
'listtype' => $this->
_getListType() );
438 $oArticle->getBaseStdLink( $iLang ),
449 stopProfile(__FUNCTION__);
464 $oView = $this->
getConfig()->getActiveView();
467 if ( $sActVendorId = $oArticle->oxarticles__oxvendorid->value ) {
468 if ( $oView instanceof
oxView && ( $oActVendor = $oView->getActVendor() ) ) {
469 $oVendor = $oActVendor;
471 $oVendor =
oxNew(
"oxVendor" );
473 if ( $oVendor->getId() !== $sActVendorId ) {
474 $oVendor =
oxNew(
"oxVendor" );
475 if ( !$oVendor->loadInLang( $iLang, $sActVendorId ) ) {
496 startProfile(__FUNCTION__);
499 if ( $blRegenerate || !( $sSeoUri = $this->
_loadFromDb(
'oxarticle', $oArticle->getId(), $iLang, null, $oManufacturer->getId(), true ) ) ) {
507 $sSeoUri =
oxRegistry::get(
"oxSeoEncoderManufacturer")->getManufacturerUri( $oManufacturer, $iLang );
508 $sSeoUri = $this->
_processSeoUrl( $sSeoUri . $sTitle, $oArticle->getId(), $iLang );
510 $aStdParams = array(
'mnid' => $oManufacturer->getId(),
'listtype' => $this->
_getListType() );
515 $oArticle->getBaseStdLink( $iLang ),
522 $oManufacturer->getId()
526 stopProfile(__FUNCTION__);
541 $oManufacturer = null;
542 if ( $sActManufacturerId = $oArticle->oxarticles__oxmanufacturerid->value ) {
543 $oView = $this->
getConfig()->getActiveView();
545 if ( $oView instanceof
oxView && ( $oActManufacturer = $oView->getActManufacturer() ) ) {
546 $oManufacturer = $oActManufacturer;
548 $oManufacturer =
oxNew(
"oxManufacturer" );
551 if ( $oManufacturer->getId() !== $sActManufacturerId || $oManufacturer->getLanguage() != $iLang ) {
552 $oManufacturer =
oxNew(
"oxManufacturer" );
553 if ( !$oManufacturer->loadInLang( $iLang, $sActManufacturerId ) ) {
554 $oManufacturer = null;
559 return $oManufacturer;
572 if ( !isset( $iLang ) ) {
573 $iLang = $oArticle->getLanguage();
590 if ( !isset( $iLang ) ) {
591 $iLang = $oArticle->getLanguage();
632 $sIdQuoted = $oDb->quote( $oArticle->getId() );
633 $oDb->execute(
"delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxarticle'");
634 $oDb->execute(
"delete from oxobject2seodata where oxobjectid = $sIdQuoted");
648 $oArticle =
oxNew(
"oxArticle" );
649 $oArticle->setSkipAssign(
true );
650 if ( $oArticle->loadInLang( $iLang, $sObjectId ) ) {