Index: trunk/kernel/include/item.php
===================================================================
diff -u -N -r1099 -r1120
--- trunk/kernel/include/item.php (.../item.php) (revision 1099)
+++ trunk/kernel/include/item.php (.../item.php) (revision 1120)
@@ -77,8 +77,9 @@
function &AddReview($createdBy,$reviewText,$isPending,$ip=NULL,$ForceIP=0, $Module="", $CreatedOn = 0)
{
$this->Reviews->itemID=$this->Get("ResourceId");
+
if($ip == NULL)
- $ip = $_SERVER["REMOTE_ADDR"];
+ $ip = $_SERVER["REMOTE_ADDR"];
if(!$CreatedOn)
$CreatedOn = mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
@@ -445,17 +446,19 @@
{
global $Errors;
global $REMOTE_ADDR;
-
- if($this->rating_ip_exists($REMOTE_ADDR))
+ //echo "Submitting vote
";
+/* if($this->rating_ip_exists($REMOTE_ADDR))
{
// $Errors->AddError("error.already_voted","","","",get_class($this),"SubmitVote");
return false;
- }
+ }*/
$vote = new clsItemRating(NULL);
$vote->Set("ItemId",$this->UniqueId());
$vote->Set("RatingValue",$voteRating);
- if(!$vote->Create())
- return false;
+ if(!$vote->Create()) {
+ //echo "Submitting Failed
";
+ return false;
+ }
$NumVotes = (int)$this->Get("CachedVotesQty");
$CurrentRating = (int)$this->Get("CachedRating");
@@ -464,6 +467,7 @@
$this->Set("CachedRating",$Rating);
$this->Update();
$this->Increment("CachedVotesQty");
+ //echo "Submitting Done
";
}
function rating_ip_exists($ip)