mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Bugtracker #3657 - confusion on rated items - thanks V3 (and didn't mess up Sweetas changes!)
This commit is contained in:
parent
0698110993
commit
4fe68f56c4
@ -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 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -162,10 +162,10 @@ class rater {
|
||||
$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' ");
|
||||
$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.".' ");
|
||||
}
|
||||
|
8
rate.php
8
rate.php
@ -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 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -41,7 +41,7 @@ if ($sql -> db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$ite
|
||||
{
|
||||
$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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user