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]]);
298 $oArticle =
oxNew(
"oxarticle");
299 $sArticleTable = $oArticle->getViewName();
300 $sActiveSnippet = $oArticle->getSqlActiveSnippet();
301 $sViewName = getViewName(
'oxartextends', $iLang);
303 $sQ =
"select count(*) from {$sViewName} inner join {$sArticleTable} on " .
304 "{$sArticleTable}.oxid = {$sViewName}.oxid where {$sArticleTable}.oxparentid = '' and {$sArticleTable}.oxissearch = 1 AND match ( {$sViewName}.oxtags ) " .
305 "against( " . $oDb->quote(
"\"" . $sTag .
"\"") .
" IN BOOLEAN MODE ) and {$sActiveSnippet}";
307 return $oDb->getOne($sQ);
318 $this->
getConfig()->setGlobalParameter(
'aLocalVendorCache', null);
323 if (isset($aVendorData[$sVendorId])) {
324 unset($aVendorData[$sVendorId]);
337 if (!$sManufacturerId) {
338 $this->
getConfig()->setGlobalParameter(
'aLocalManufacturerCache', null);
343 if (isset($aManufacturerData[$sManufacturerId])) {
344 unset($aManufacturerData[$sManufacturerId]);
360 $aLocalCatCache =
$myConfig->getGlobalParameter(
'aLocalCatCache');
363 if (!$aLocalCatCache) {
365 if ($sLocalCatCache) {
366 $aLocalCatCache = $sLocalCatCache;
368 $aLocalCatCache = null;
370 $myConfig->setGlobalParameter(
'aLocalCatCache', $aLocalCatCache);
373 return $aLocalCatCache;
383 $this->
getConfig()->setGlobalParameter(
'aLocalCatCache', $aCache);
394 $this->
getConfig()->setGlobalParameter(
'aLocalVendorCache', $aCache);
405 $this->
getConfig()->setGlobalParameter(
'aLocalManufacturerCache', $aCache);
419 $aLocalVendorCache =
$myConfig->getGlobalParameter(
'aLocalVendorCache');
421 if (!$aLocalVendorCache) {
423 if ($sLocalVendorCache) {
424 $aLocalVendorCache = $sLocalVendorCache;
426 $aLocalVendorCache = null;
428 $myConfig->setGlobalParameter(
'aLocalVendorCache', $aLocalVendorCache);
431 return $aLocalVendorCache;
444 $aLocalManufacturerCache =
$myConfig->getGlobalParameter(
'aLocalManufacturerCache');
446 if (!$aLocalManufacturerCache) {
448 if ($sLocalManufacturerCache) {
449 $aLocalManufacturerCache = $sLocalManufacturerCache;
451 $aLocalManufacturerCache = null;
453 $myConfig->setGlobalParameter(
'aLocalManufacturerCache', $aLocalManufacturerCache);
456 return $aLocalManufacturerCache;
468 if ($this->_sUserViewId != null && !$blReset) {