require "function.php";
@require "$DOCUMENT_ROOT/../conn.php";
$sql="SELECT s.title, s.id_s
FROM stories s
WHERE s.id_s=$id_s";
if(!$result = @mysql_query($sql)) die("Can't get fanfiction data.");
if (!$row=@mysql_num_rows($result)) die ("Нет ни одного рассказа");
$myrow1 = @mysql_fetch_array($result);
if (isset($golos)) {
//Check if user already voted
$lock_timeout=3000;
$script_path = dirname(__FILE__);
$include_path = "$script_path/art_vote";
if (!check_poll_ip($id_s))
{
if (!is_numeric($vote)) die ('Stop messing with url, you, motherfucker! Your IP was logged and e-mail was sent to admin!');
if ($vote < 0 || $vote > 5 )
{
$admin_message= "
IP = $REMOTE_ADDR\n
vote = $vote\n
id_s = $id_s
";
@mail("gadget@rxwp.ru", "ПОдтасовка голосования", $admin_message, "From: rxwp@rxwp.ru","-f rxwp@rxwp.ru");
die ('Stop messing with url, you, motherfucker! Your IP was logged and e-mail was sent to admin!');
}
// Update votes table
$sql="update stories set points=(points + $vote), voted=(voted+1) where id_s=$id_s";
if (!$result=@mysql_query($sql) ) die ("Cant't update votes table ");
lock_ip($id_s);
echo "