31 if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) {
34 $iCnt = $aCatData[$sCatId][$sActIdent];
57 if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) {
60 $iCnt = $aCatData[$sCatId][$sActIdent];
81 if (!$aVendorData || !isset($aVendorData[$sVendorId][$sActIdent])) {
84 $iCnt = $aVendorData[$sVendorId][$sActIdent];
104 if (!$aManufacturerData || !isset($aManufacturerData[$sManufacturerId][$sActIdent])) {
107 $iCnt = $aManufacturerData[$sManufacturerId][$sActIdent];
124 $oArticle =
oxNew(
'oxarticle');
125 $sTable = $oArticle->getViewName();
126 $sO2CView = getViewName(
'oxobject2category');
130 $sQ =
"SELECT COUNT( DISTINCT $sTable.`oxid` )
132 INNER JOIN $sTable ON $sO2CView.`oxobjectid` = $sTable.`oxid` AND $sTable.`oxparentid` = ''
133 WHERE $sO2CView.`oxcatnid` = " . $oDb->quote($sCatId) .
" AND " . $oArticle->getSqlActiveSnippet();
135 $aCache[$sCatId][$sActIdent] = $oDb->getOne($sQ);
139 return $aCache[$sCatId][$sActIdent];
155 $oArticle =
oxNew(
'oxarticle');
156 $sTable = $oArticle->getViewName();
158 $sSelect =
"select count({$sTable}.oxid) from {$sTable} where oxvarminprice >= 0 ";
159 $sSelect .= $dPriceTo ?
"and oxvarminprice <= " . (double) $dPriceTo .
" " :
" ";
160 $sSelect .= $dPriceFrom ?
"and oxvarminprice >= " . (double) $dPriceFrom .
" " :
" ";
161 $sSelect .=
"and {$sTable}.oxissearch = 1 and " . $oArticle->getSqlActiveSnippet();
163 $aCache[$sCatId][$sActIdent] =
oxDb::getDb()->getOne($sSelect);
167 return $aCache[$sCatId][$sActIdent];
182 if ($sCatId ==
'root') {
186 $oArticle =
oxNew(
'oxarticle');
187 $sTable = $oArticle->getViewName();
190 $sQ =
"select $sTable.oxvendorid AS vendorId, count(*) from $sTable where ";
191 $sQ .=
"$sTable.oxvendorid <> '' and $sTable.oxparentid = '' and " . $oArticle->getSqlActiveSnippet() .
" group by $sTable.oxvendorid ";
194 foreach ($aDbResult as $sKey => $sValue) {
195 $aCache[$sKey][$sActIdent] = $sValue;
200 return $aCache[$sCatId][$sActIdent];
215 if ($sMnfId ==
'root') {
219 $oArticle =
oxNew(
'oxarticle');
220 $sArtTable = $oArticle->getViewName();
221 $sManTable = getViewName(
'oxmanufacturers');
225 $sQ =
"select count($sArtTable.oxid) from $sArtTable where $sArtTable.oxparentid = '' and oxmanufacturerid = '$sMnfId' and " . $oArticle->getSqlActiveSnippet();
229 $aCache[$sMnfId][$sActIdent] = (int) $iValue;
233 return $aCache[$sMnfId][$sActIdent];
244 $this->
getConfig()->setGlobalParameter(
'aLocalCatCache', null);
249 if (isset($aCatData[$sCatId])) {
250 unset($aCatData[$sCatId]);
266 $sTable = getViewName(
'oxcategories');
267 $sSelect =
"select $sTable.oxid from $sTable where " . (double) $iPrice .
" >= $sTable.oxpricefrom and " . (
double) $iPrice .
" <= $sTable.oxpriceto ";
269 $rs =
oxDb::getDb()->select($sSelect,
false,
false);
270 if ($rs !=
false && $rs->recordCount() > 0) {
272 if (isset($aCatData[$rs->fields[0]])) {
273 unset($aCatData[$rs->fields[0]]);
296 $oArticle =
oxNew(
"oxarticle");
297 $sArticleTable = $oArticle->getViewName();
298 $sActiveSnippet = $oArticle->getSqlActiveSnippet();
299 $sViewName = getViewName(
'oxartextends', $iLang);
301 $sQ =
"select count(*) from {$sViewName} inner join {$sArticleTable} on " .
302 "{$sArticleTable}.oxid = {$sViewName}.oxid where {$sArticleTable}.oxparentid = '' and {$sArticleTable}.oxissearch = 1 AND match ( {$sViewName}.oxtags ) " .
303 "against( " . $oDb->quote(
"\"" . $sTag .
"\"") .
" IN BOOLEAN MODE ) and {$sActiveSnippet}";
305 return $oDb->getOne($sQ);
316 $this->
getConfig()->setGlobalParameter(
'aLocalVendorCache', null);
321 if (isset($aVendorData[$sVendorId])) {
322 unset($aVendorData[$sVendorId]);
335 if (!$sManufacturerId) {
336 $this->
getConfig()->setGlobalParameter(
'aLocalManufacturerCache', null);
341 if (isset($aManufacturerData[$sManufacturerId])) {
342 unset($aManufacturerData[$sManufacturerId]);
358 $aLocalCatCache =
$myConfig->getGlobalParameter(
'aLocalCatCache');
361 if (!$aLocalCatCache) {
363 if ($sLocalCatCache) {
364 $aLocalCatCache = $sLocalCatCache;
366 $aLocalCatCache = null;
368 $myConfig->setGlobalParameter(
'aLocalCatCache', $aLocalCatCache);
371 return $aLocalCatCache;
381 $this->
getConfig()->setGlobalParameter(
'aLocalCatCache', $aCache);
392 $this->
getConfig()->setGlobalParameter(
'aLocalVendorCache', $aCache);
403 $this->
getConfig()->setGlobalParameter(
'aLocalManufacturerCache', $aCache);
417 $aLocalVendorCache =
$myConfig->getGlobalParameter(
'aLocalVendorCache');
419 if (!$aLocalVendorCache) {
421 if ($sLocalVendorCache) {
422 $aLocalVendorCache = $sLocalVendorCache;
424 $aLocalVendorCache = null;
426 $myConfig->setGlobalParameter(
'aLocalVendorCache', $aLocalVendorCache);
429 return $aLocalVendorCache;
442 $aLocalManufacturerCache =
$myConfig->getGlobalParameter(
'aLocalManufacturerCache');
444 if (!$aLocalManufacturerCache) {
446 if ($sLocalManufacturerCache) {
447 $aLocalManufacturerCache = $sLocalManufacturerCache;
449 $aLocalManufacturerCache = null;
451 $myConfig->setGlobalParameter(
'aLocalManufacturerCache', $aLocalManufacturerCache);
454 return $aLocalManufacturerCache;
466 if ($this->_sUserViewId != null && !$blReset) {