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
2008-03-18 23:17:49
thanks TorrentialStorm.
Unknown User
2008-03-30 02:29:41
not working! when someone clicks thnx it shows

$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");
Unknown User
2008-05-24 17:26:27
thanks works well on v2.03
Unknown User
2008-05-27 15:17:54
thank you works super on v2.04
Unknown User
2008-07-02 11:53:28
it works brill.. thank you
Unknown User
2008-08-05 18:50:00
Thanks a lot! Works just as it should on v2.04
Unknown User
2008-08-09 14:53:20
work fine thx
Unknown User
2008-08-16 20:40:44
thanks work great ( 2.04 )
Unknown User
2008-08-18 21:49:47
never minds works fine:D
Unknown User
2008-08-19 01:45:20
works just fine . Thank you :blink:
Unknown User
2008-11-01 10:47:35
thanks!!work perfect
Unknown User
2008-11-01 17:09:36
in ajax?
Unknown User
2008-11-27 19:03:18
"Torrential-Storm.co.uk, post: 33304":
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);

?>



run this query:

ALTER TABLE `torrents` ADD `thanks` LONGTEXT;


I am a noob at this and I don't know what this part means: "run this query"  and I don't know if i'm supposed to add that somewhere? If someone could help me out with this part I would greatly appreciate it. Thanks for the mod I hope I can get it to work.
Unknown User
2008-11-27 20:29:59
don't you know what is SQL ?
Unknown User
2008-11-27 20:42:29
the easiest way to get hacked is not knowing the basics. but even if you do know a lot you can still get hacked. read up a bit a W3 Schools. it is not the best for tutorials out ther but it is a good start for beginners
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728