mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 17:14:42 +02:00
Issue #4283 - Update deprecated sql method usage. Removed old code.
This commit is contained in:
57
rate.php
57
rate.php
@@ -26,9 +26,9 @@ if(!e_AJAX_REQUEST) // Legacy method.
|
||||
}
|
||||
|
||||
$table = $tp -> toDB($qs[0]);
|
||||
$itemid = intval($qs[1]);
|
||||
$itemid = (int) $qs[1];
|
||||
$returnurl = $tp -> toDB($qs[2]);
|
||||
$rate = intval($qs[3]);
|
||||
$rate = (int) $qs[3];
|
||||
e107::getRate()->submitVote($table,$itemid,$rate);
|
||||
header("location:".$returnurl);
|
||||
exit;
|
||||
@@ -37,7 +37,7 @@ else // Ajax Used.
|
||||
{
|
||||
if($_POST['mode'] == 'thumb')
|
||||
{
|
||||
if(vartrue($_GET['type']) !='up' && vartrue($_GET['type']) !='down')
|
||||
if(vartrue($_GET['type']) !== 'up' && vartrue($_GET['type']) !== 'down')
|
||||
{
|
||||
exit;
|
||||
}
|
||||
@@ -68,54 +68,3 @@ else // Ajax Used.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if ($sql -> db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$itemid}'"))
|
||||
{
|
||||
$row = $sql -> db_Fetch();
|
||||
if(strpos($row['rate_voters'], ".".USERID.".") === FALSE)
|
||||
{
|
||||
$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_id='{$row['rate_id']}' ");
|
||||
if(!$returnurl)
|
||||
{
|
||||
$voteStatus = e107::getRate()->renderVotes($rate_voters,($row['rate_votes'] +1));
|
||||
echo $voteStatus."|".RATELAN_3; // Thank you for your vote.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($returnurl)
|
||||
{
|
||||
header("location:".e_BASE."index.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You already voted!";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($sql->db_Insert("rate", " 0, '{$table}', '{$itemid}', '{$rate}', '1', '.".USERID.".' "))
|
||||
{
|
||||
if(!$returnurl)
|
||||
{
|
||||
echo RATELAN_3; // Thank you for your vote.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user