$where = "CategoryId =".$catid." AND ((".$TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
-
}
-
else
-
{
-
$where = "((".$TableName.".CreatedOn >=".$this->GetNewValue()." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
-
}
-
-
$CategoryTable = GetTablePrefix()."Category";
-
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName ";
$where = "CategoryId =".$catid." AND ((".$TableName.".Hits >=".$this->GetLinkPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1";
-
}
-
else
-
{
-
$where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
-
-
$where = "((".$TableName.".Hits >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
$where = "CategoryId =".$catid." AND ((".$TableName.".CachedRating >=".$this->GetHotValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1";
-
}
-
else
-
{
-
$where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
$SelectSQL .= $relcalc.$popcalc.$ratecalc." as Relevance, ";
-
-
$SelectSQL .= $this->SourceTable.".".$idField." as ItemId, ".$this->SourceTable.".ResourceId as ResourceId, CONCAT($typestr) as ItemType, EditorsPick as EdPick FROM ".$this->SourceTable." ";
-
-
foreach($this->Relationships as $JoinTable=>$OnClause)
-
{
-
$SelectSQL .= "LEFT JOIN $JoinTable ON $OnClause ";
-
}
-
$first=1;
-
$where=0;
-
-
foreach($this->FieldList as $field)
-
{
-
if(strpos($field,"as")>0)
-
{
-
$fparts = explode("as",$field,2);
-
$f = $fparts[1];
-
$this->AddSearchWhereClause($field);
-
}
-
else {
-
$this->AddSearchWhereClause($field);
-
}
-
}
-
-
$SelectSQL .= " WHERE ";
-
$SelectSQL .= implode(" or ",$this->WhereClauses);
-
-
if(is_array($idlist))
-
{
-
$SelectSQL .= " AND (ResourceId IN (".implode(",",$idlist)."))";
-
}
-
}
-
$SelectSQL .= "GROUP BY $idField ";
-
//echo $SelectSQL."<br><br>\n";
-
if($InitTable)
-
{
-
$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$this->ResultTable);
-
//$indexSQL = "(INDEX(Relevance), INDEX(ItemId), INDEX(ItemType), INDEX sorting (EdPick,Relevance)) ";
$sql = "SELECT COUNT(*) as SubCount FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId");
-
$rs = $this->adodbConnection->Execute($sql);
-
if($rs && !$rs->EOF)
-
{
-
$val = $rs->fields["SubCount"];
-
if($val != $this->Get("CachedDescendantCatsQty"))
-
{
-
$this->Set("CachedDescendantCatsQty",$val);
-
$this->Update();
-
}
-
$ret = $this->Get("CachedDescendantCatsQty");
-
}
-
return $ret;
-
}
-
-
function GetSubCatIds()
-
{
-
$sql = "SELECT CategoryId FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId");
@description:Displays the category relevance in search results
-
@attrib:_displaymode:: How the relevance should be displayed<br>
-
<UL>
-
<LI>"Numerical": Show the decimal value
-
<LI>"Bar": Show the HTML representing the relevance. Returns two HTML cells ≶td< with specified background colors
-
<LI>"Graphical":Show image representing the relevance
-
</UL>
-
@attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension"
-
@attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode
-
@attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode