-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrate.php
More file actions
32 lines (28 loc) · 767 Bytes
/
rate.php
File metadata and controls
32 lines (28 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once("../../class2.php");
$qs = explode("^", e_QUERY);
if (!$qs[0] || USER == false || $qs[3] > 10 || $qs[3] < 1)
{
header("location:" . e_BASE . "index.php");
exit;
}
global $rate_upviews;
$table = $qs[0];
$itemid = $qs[1];
$returnurl = $qs[2];
$rate = $qs[3];
$rate_upviews=false;
if ($sql->db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$itemid' "))
{
$row = $sql->db_Fetch();
extract($row);
$rate_voters .= USERID . ".";
$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_Insert("rate", " 0, '$table', '$itemid', '$rate', '1', '." . USERID . ".' ");
}
header("location:" . $returnurl);
exit;
?>