Skip to content

Commit

Permalink
Bugtracker e107inc#3657 - confusion on rated items - thanks V3 (and d…
Browse files Browse the repository at this point in the history
…idn't mess up Sweetas changes!)
  • Loading branch information
e107steved committed Jan 10, 2007
1 parent 0698110 commit 4fe68f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions e107_handlers/rate_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/rate_class.php,v $
| $Revision: 1.2 $
| $Date: 2006-12-07 17:47:20 $
| $Author: sweetas $
| $Revision: 1.3 $
| $Date: 2007-01-10 21:31:12 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/

Expand Down Expand Up @@ -162,11 +162,11 @@ function enterrating($rateindex){
$sep = chr(1);
$voter = USERID.$sep.intval($qs[3]);

if ($sql->db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$itemid' ")) {
if ($sql->db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$itemid}' ")) {
$row = $sql->db_Fetch();
$rate_voters = $row['rate_voters'].".".$voter.".";
$sql->db_Update("rate", "rate_votes=rate_votes+1, rate_rating=rate_rating+'$rate', rate_voters='$rate_voters' WHERE rate_itemid='$itemid' ");
} else {
$sql->db_Update("rate", "rate_votes=rate_votes+1, rate_rating=rate_rating+'{$rate}', rate_voters='{$rate_voters}' WHERE rate_id='{$row['rate_id']}' ");
} else {
$sql->db_Insert("rate", " 0, '$table', '$itemid', '$rate', '1', '.".$voter.".' ");
}
}
Expand Down
8 changes: 4 additions & 4 deletions rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/rate.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:09 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2007-01-10 21:31:12 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/

Expand Down Expand Up @@ -41,7 +41,7 @@
{
$rate_voters = $row['rate_voters'].".".USERID.".";
$new_rating = $row['rate_rating']+$rate;
$sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating='{$new_rating}', rate_voters='{$rate_voters}' WHERE rate_itemid='{$itemid}' ");
$sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating='{$new_rating}', rate_voters='{$rate_voters}' WHERE rate_id='{$row['rate_id']}' ");
}
else
{
Expand Down

0 comments on commit 4fe68f5

Please sign in to comment.