Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] Thanks
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2007-10-03 19:03:04
very important first

[size=12px]you don't forget this[/size]

run this query:

ALTER TABLE `torrents` ADD `thanks` LONGTEXT;

torrents-details.php, find:

$res = mysql_query("SELECT torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id") or die(mysql_error());

replace with:
$res = mysql_query("SELECT torrents.seeders, torrents.thanks, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id") or die(mysql_error());

find:
print("<tr><td align=left><b>" . HITS . ":</b></td><td>" . $row["hits"] . "</td></tr>n");

add below:
$thanksl = explode(",", $row['thanks']);
if ($CURUSER['username'] == $row['username'] || !$CURUSER) $leftthanks = true;
foreach ($thanksl as $u) {
$thanks .= ($i>0)?", $u":$u;
if ($u == $CURUSER['username']) $leftthanks = true;
$i++;
}

if (!$thanks) $thanks = "No one yet.";

print("<tr><td align=left><b>Thanks By:</b></td><td>$thanks</td></tr>n");
if (!$leftthanks) print("<tr><td align=left>&nbsp;</td><td><form action=thanks.php method=POST><input type=hidden name=torrent value=$id><input type=submit value='Thanks!'></form></td></tr>n");

create "thanks.php":

<?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly();

$id = (int)$_POST['torrent'];

if (!is_valid_id($id)) die;

$res = mysql_query("SELECT `thanks` FROM torrents WHERE id=$id");
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
if (!$row) show_error_msg("Error", "Sorry no .torrent found with this ID, it has probably been deleted.",1);

$thanksl = explode(",", $row['thanks']);

if (in_array($CURUSER['username'], $thanksl)) show_error_msg("Error", "You have already left thanks for this torrent.",1);

mysql_query(sprintf("UPDATE `torrents` SET thanks = CONCAT_WS(',', `thanks`, %s) WHERE `id`=%d", sqlesc($CURUSER['username']), $id)) or die(mysql_error());

header("Refresh: 3;url=torrents-details.php?id=$id");
show_error_msg("Success", "Thanks added.<BR>Redirecting...", 1);
?>
Unknown User
2007-10-03 20:12:30
Much nicer than the other one.. thanks  :P

Guess you can either lock and/or delete mine :P
Unknown User
2007-10-05 10:26:25
what is the difference with the first mod thanks

bye gia
Unknown User
2007-10-14 23:38:13
what does this mod do in any way?

there is no pic or explain?

can somebody help me  :)
categories.zip
Download
Unknown User
2007-11-10 07:10:58
thanks for this cool modification :)
Unknown User
2007-11-10 16:49:28
erm anyone can help me? im missing thanks button
Unknown User
2007-11-11 02:31:41
Read what TS said just above about torrents-details.php
Unknown User
2007-11-11 12:35:50
you cant thanks your self  :)  if you add torrent  :P  register new account and then you can thanks :(
Unknown User
2007-11-12 21:42:10
I followed the instructions perfectly but when the thank you button is pressed it goes to thanks.php and this appears on the page

Redirecting...", 1); ?>
Unknown User
2007-11-20 03:11:55
"KingFox, post: 35044":
I followed the instructions perfectly but when the thank you button is pressed it goes to thanks.php and this appears on the page
Redirecting...", 1); ?>

hey kf...

evidently you did it wrong because i just did this mod on the nx torrent beta page and it worked fine...



ps... you may take a look at getting rid of the <BR> or checking out the very beginning of the code... maybe you didn't c/p the entire thing...

Unknown User
2007-12-17 18:06:17
Hi

After the installation of the thanks mod, i have this message when clicking on my torrent :

Table 'babyrasta_db.torrentlang' doesn't exist

Can Anyone help me?

thank you
Unknown User
2008-01-05 17:26:51
thank you for this mod

there is an error after clicking the thanks button

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/maroctorrent.net/public_html/thanks.php:2) in /home/sites/maroctorrent.net/public_html/thanks.php on line 22
Unknown User
2008-01-07 05:52:17
thanks work number one :(
Unknown User
2008-01-09 00:06:37
"dodez, post: 37086":
thank you for this modthere is an error after clicking the thanks button

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/maroctorrent.net/public_html/thanks.php:2) in /home/sites/maroctorrent.net/public_html/thanks.php on line 22


is there an issue?
Unknown User
2008-03-18 21:46:08
Works great on 2.03

thanks for the thanks button :D
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728