Updated for V3 credit to Original Author
SQL
In torrent-details find
Add thanks (inline)
find
Add after
The next is to force members to say thanks (you dont have to use this)
In download.php
Add thanks & owner to line
find
Add after
Make folder called js and add thanks.js into it
ADD thanks.php to root
SQL
ALTER TABLE `torrents` ADD `thanks` LONGTEXT;In torrent-details find
//GET ALL MYSQL VALUES FOR THIS TORRENT
$res = SQL_Query_exec("SELECT torrents.anon, Add thanks (inline)
//GET ALL MYSQL VALUES FOR THIS TORRENT
$res = SQL_Query_exec("SELECT torrents.anon, torrents.thanks, find
print("<tr><td align='left'><b>".T_("HITS").":</b></td><td>" . number_format($row["hits"]) . "</td></tr>\n");Add after
//START THANKS\\\\
$thanksl = explode(",", $row['thanks']);
if ($CURUSER['username'] == $row['username']) {
$leftthanks = true;
$leftthanks2 = true;
} else {
foreach ($thanksl as $u) {
$thanks .= ($i > 0) ? ", $u" : $u;
if ($u == $CURUSER['username']) {
$leftthanks2 = true;
$leftthanks = true;
}
$i++;
}
}
if (!$leftthanks2) {
$button='<br/><input type="button" value="Say Thanks" id="refresh">';
} else {
$button='';
}
echo '<tr><td align="left"><b>Thanks by : </b></td><td><div id="thankput"></div>'.$button.'
<script type="text/javascript" src="'.$site_config["SITEURL"].'/js/thanks.js"></script>
<script type="text/javascript">
var $s = jQuery.noConflict();
$s("#thankput").load("thanks.php?id='.$id.'");
$s(function() {
$s("#refresh").click(function() {
$s("#thankput").empty().html(\'<center><img src="'.$site_config["SITEURL"].'/images/ajax-loader.gif"></center>\');
$s("#thankput").load("thanks.php?id='.$id.'&to=give&torrent='.$id.'")
return false;
})
})
</script></td></tr><br/>';
////END THANKS\\\\\
The next is to force members to say thanks (you dont have to use this)
In download.php
$res = SQL_Query_exec("SELECT filename, banned, external, announce FROM torrents WHERE id =".intval($id));Add thanks & owner to line
$res = SQL_Query_exec("SELECT filename, banned, external, announce, thanks, owner FROM torrents WHERE id =".intval($id));find
$name = $row['filename'];Add after
// START THANKS
if ($CURUSER["id"] != $row["owner"] && !in_array($CURUSER["username"], explode(',', $row["thanks"])))
show_error_msg("Error", "You have to say thanks before you can download.<br /><br />
<a href=torrents-details.php?id=$id>Return to the previous page</a>",1);
// END THANKSMake folder called js and add thanks.js into it
ADD thanks.php to root


