-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththanks.php
43 lines (34 loc) · 1.17 KB
/
thanks.php
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
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
**************************
** FreeTSP Version: 1.0 **
**************************
** https://github.com/Krypto/FreeTSP
** http://www.freetsp.info
** Licence Info: GPL
** Copyright (C) 2010 FreeTSP v1.0
** A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
** Project Leaders: Krypto, Fireknight.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'functions'.DIRECTORY_SEPARATOR.'function_main.php');
require_once(FUNC_DIR.'function_user.php');
require_once(FUNC_DIR.'function_vfunctions.php');
require_once(FUNC_DIR.'function_bbcode.php');
db_connect(true);
logged_in();
$uid = $CURUSER["id"];
$tid = 0 + $_POST["torrentid"];
if (isset($uid) && $tid > 0 )
{
$count = mysql_fetch_row(sql_query("SELECT COUNT(id)
FROM thanks
WHERE userid={$uid}
AND torrentid={$tid}"));
if ($count[0] == 0)
$res = sql_query("INSERT INTO thanks (torrentid, userid)
VALUES ($tid, $uid)");
header("Location: $site_url/details.php?id=$tid&thanks=1");
}
else
header("Location: $site_url/details.php?id=$tid");
?>