44 if (isset($this->_aCatCache[$sCacheId])) {
45 $sSeoUrl = $this->_aCatCache[$sCacheId];
46 } elseif (($sSeoUrl = $this->
_loadFromDb(
'oxcategory', $oCat->getId(), $iLang))) {
48 $this->_aCatCache[$sCacheId] = $sSeoUrl;
66 return $oCat->getId() .
'_' . ((int) $iLang);
80 startProfile(__FUNCTION__);
81 $sCatId = $oCat->getId();
84 if ($oCat->oxcategories__oxextlink->value) {
89 $iLang = $oCat->getLanguage();
97 if ($iLang != $oCat->getLanguage()) {
98 $sId = $oCat->getId();
99 $oCat =
oxNew(
'oxcategory');
100 $oCat->loadInLang($iLang, $sId);
104 $sTitle = $this->
_prepareTitle($oCat->oxcategories__oxtitle->value,
false, $oCat->getLanguage());
106 foreach (array_keys($aCacheMap) as $id) {
107 $aCacheMap[$id] = $sTitle .
'/' . $aCacheMap[$id];
110 $aCacheMap[$oCat->getId()] = $sTitle;
111 $aStdLinks[$oCat->getId()] = $oCat->getBaseStdLink($iLang);
114 $oCat = $oCat->getParentCategory();
117 foreach ($aCacheMap as $sId => $sUri) {
118 $this->_aCatCache[$sId .
'_' . $iLang] = $this->
_processSeoUrl($sSeoUrl . $sUri .
'/', $sId, $iLang);
119 $this->
_saveToDb(
'oxcategory', $sId, $aStdLinks[$sId], $this->_aCatCache[$sId .
'_' . $iLang], $iLang);
122 $sSeoUrl = $this->_aCatCache[$sCatId .
'_' . $iLang];
125 stopProfile(__FUNCTION__);
143 if (!isset($iLang)) {
144 $iLang = $oCategory->getLanguage();
146 $sStdUrl = $oCategory->getBaseStdLink($iLang) .
'&pgNr=' . $iPage;
147 $sParams = (int) ($iPage + 1);
149 $sStdUrl = $this->
_trimUrl($sStdUrl, $iLang);
150 $sSeoUrl = $this->
getCategoryUri($oCategory, $iLang) . $sParams .
"/";
152 if ($blFixed === null) {
153 $blFixed = $this->
_isFixed(
'oxcategory', $oCategory->getId(), $iLang);
156 return $this->
_getFullUrl($this->
_getPageUri($oCategory,
'oxcategory', $sStdUrl, $sSeoUrl, $sParams, $iLang, $blFixed), $iLang);
173 if (!isset($iLang)) {
174 $iLang = $oCategory->getLanguage();
192 $sIdQuoted = $oDb->quote($oCategory->getId());
197 $aCatInfo = $oDb->getAll(
"select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1");
198 $sCatRootIdQuoted = $oDb->quote($aCatInfo[0][0]);
201 $sQ =
"update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ((int) $aCatInfo[0][1]) .
" and oxright < " . ((int) $aCatInfo[0][2]) .
") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid";
205 $sQ =
"update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category"
206 .
" as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= "
207 .((int) $aCatInfo[0][1] ).
" and cat.oxright <= ".((int) $aCatInfo[0][2] ).
") as seo2 "
208 .
"set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id "
209 .
"and seo1.oxfixed = 0";
223 $sIdQuoted = $oDb->quote($oCategory->getId());
224 $oDb->execute(
"update oxseo, (select oxseourl from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory') as test set oxseo.oxexpired=1 where oxseo.oxseourl like concat(test.oxseourl, '%') and (oxtype = 'oxcategory' or oxtype = 'oxarticle')");
225 $oDb->execute(
"delete from oxseo where oxseo.oxtype = 'oxarticle' and oxseo.oxparams = $sIdQuoted");
226 $oDb->execute(
"delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory'");
227 $oDb->execute(
"delete from oxobject2seodata where oxobjectid = $sIdQuoted");
241 $oCat =
oxNew(
"oxcategory");
242 if ($oCat->loadInLang($iLang, $sObjectId)) {