Index: trunk/kernel/include/itemreview.php =================================================================== diff -u -N -r1132 -r1462 --- trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 1132) +++ trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 1462) @@ -451,20 +451,15 @@ return $this->Query_item($sql); } - function GetItemReviewCount($TodayOnly = FALSE) + function GetItemReviewCount($TodayOnly = false) { - $sql = "SELECT count(*) as ItemCount FROM ".$this->SourceTable." WHERE ItemId=".$this->itemID." AND Status=1"; + $sql = 'SELECT COUNT(*) FROM '.$this->SourceTable.' WHERE ItemId = '.$this->itemID.' AND Status = 1'; if($TodayOnly) { - $today = mktime(0,0,0,date("m"),date("d"),date("Y")); - $where .= " AND CreatedOn>=$today"; + $today = mktime(0,0,0,date('m'),date('d'),date('Y')); + $sql .= ' AND CreatedOn >= '.$today; } - $sql .= $where; - $rs = $this->adodbConnection->execute($sql); - $count=0; - if($rs) - $count = $rs->fields["ItemCount"]; - return (int)$count; + return (int)$this->adodbConnection->GetOne($sql); } function ip_exists($ip,$id)