Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -r881 -r904 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 881) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 904) @@ -2070,12 +2070,12 @@ { global $objCountCache; - $cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"], 3600); + $cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'), 3600); if(!is_numeric($cc)) { $sql = $this->SqlGlobalCount($attribs); $ret = QueryCount($sql); - $objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"],$ret); + $objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'),$ret); } else $ret = $cc; @@ -2158,7 +2158,7 @@ global $objCountCache, $objSession; $ret = ""; - $ListType = $attribs["_listtype"]; + $ListType = getArrayValue($attribs,'_listtype'); if(!strlen($ListType)) $ListType="_"; @@ -2169,43 +2169,43 @@ { case "_": $ret = $this->DoGlobalCount($attribs); - break; + break; case "category": $ret = $this->CategoryCount($attribs); - break; + break; case "myitems": $sql = $this->SqlMyItems($attribs); - break; + break; case "hot": $sql = $this->SqlHotItems($attribs); - break; + break; case "pop": $sql = $this->SqlPopItems($attribs); - break; + break; case "pick": $sql = $this->SqlPickItems($attribs); - break; + break; case "favorites": $sql = $this->SqlFavorites($attribs); - break; + break; case "search": $sql = $this->SqlSearchItems($attribs); - break; + break; case "new": $sql = $this->SqlNewItems($attribs); - break; + break; } //echo "SQL: $sql
"; - if(strlen($sql)) + if(isset($sql)&&$sql) { if(is_numeric($ListTypeId)) { - $cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"], 3600); + $cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'), 3600); if(!is_numeric($cc) || $attribs['_nocache'] == 1) { $ret = QueryCount($sql); - $objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"],$ret); + $objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'),$ret); } else $ret = $cc; @@ -2432,8 +2432,8 @@ { global $objSession, $objCatList; - $catid = (int)$attribs["_catid"]; - $scope = (int)$attribs["_scope"]; + $catid = (int)getArrayValue($attribs,'_catid'); + $scope = (int)getArrayValue($attribs,'_scope'); //$JoinCats = (int)$attribs["_catinfo"] || $scope; $TableName = $this->SourceTable; @@ -2450,15 +2450,15 @@ $where = $TableName.".EditorsPick=1 AND ".$TableName.".Status=1 "; $catid=NULL; } - if($attribs["_today"]) + if(getArrayValue($attribs,'_today')) { $today = mktime(0,0,0,date("m"),date("d"),date("Y")); $where .= " AND ($TableName.CreatedOn>=$today)"; } $CategoryTable = GetTablePrefix()."Category"; $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; - $sql .= $this->GetJoinedSQL($p,$CatUd,$where); + $sql .= $this->GetJoinedSQL($p,$catid,$where); $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); $sql .= " ".$OrderBy; @@ -2480,11 +2480,11 @@ else $this->PerPageVar = $this->PerPageVarLong; - $CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],3600); + $CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),3600); if(!is_numeric($CachedCount)) { $this->QueryItemCount= QueryCount($sql); - $objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],$this->QueryItemCount); + $objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),$this->QueryItemCount); } else $this->QueryItemCount=$CachedCount; @@ -2498,15 +2498,15 @@ $TableName = $this->SourceTable; $where = " ".$TableName.".Status>-1 AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - if($attribs["_today"]) + if(getArrayValue($attribs,'_today')) { $today = mktime(0,0,0,date("m"),date("d"),date("Y")); $where .= " AND ($TableName.CreatedOn>=$today)"; } $CategoryTable = GetTablePrefix()."Category"; $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; - $sql .= $this->GetJoinedSQL($p,$CatUd,$where); + $sql .= $this->GetJoinedSQL($p,null,$where); // maybe null should be replaced by some CategoryId $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); $sql .= " ".$OrderBy;