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
Thanks Button on Home Page
Controls ·  Search New posts · Mark unread

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

Unknown User
2011-11-21 19:17:36
Hi Guys,

Can someone help me to link my thanks button thats in my torrent-details to the "home" page next to the download or uploader  or seeders .......

Please

Thanks

Stolla
Unknown User
2011-11-21 19:40:12
on the torrenttable?
Unknown User
2011-11-21 19:43:14
Yes
Unknown User
2011-11-21 19:43:46
Find me topic for thanks and il write it
Unknown User
2011-11-21 19:52:44
This one ?? [url="http://www.torrenttrader.org/index.php?showtopic=6740&hl=thanks+button"]http://www.torrenttrader.org/index.php?sho...l=thanks+button[/url]
Unknown User
2011-11-21 20:15:38
You should have something like

	case 'completed':

print("<tr><td><b>".T_("COMPLETED")."</b>: ".number_format($row['times_completed'])."</td></tr>");

break;
underneath Add




						case 'thanks': 

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

if ($CURUSER['username'] == $row['username'] || !$CURUSER) $leftthanks = true;

foreach ($thanksleft as $u)

{

$thanks .= ($i > 0) ? ", $u": $u;

if ($u == $CURUSER['username']) $leftthanks = true;

$i++;

}



if (!$thanks) $thanks = "No Thanks Yet!";



if (!$leftthanks)

$mythank = '<form action="thanks.php" method="post"><input type="hidden" name="torrent" value="'.$row["id"].'" /><input type="submit" value="Thanks!" /></form>';



print("<tr><td><b>Thanks By</b>: $thanks $mythank</td></tr>");

break;



then u will need to add the option to your config.php, and specifiy the thanks field in all queries which use torrenttable.
Unknown User
2011-11-21 22:46:00
did this work for you stolla so it can be moved to mods completed ?
Unknown User
2011-11-22 09:28:36
Looks like we might have used a differnt way that time when we added the thanks button



[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5371"]thanks.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5372"]torrents_details.php[/url]
thanks.png
thanks.png
thanks.php
Download
torrents_details.php
Download
Unknown User
2011-11-22 14:25:01
I don't understand i thought you said for the torrenttable?
Unknown User
2011-11-22 14:36:58
Sorry, but i'm a bit stupid....want the button on the red area aswell.

tt.png
tt.png
Unknown User
2011-11-22 14:46:08
Ha so hide the people who have already thanked and just show the thank button?
Unknown User
2011-11-22 17:07:44
No, basically i want to add the "Thanks button" to the home screen also, people usually don't go into the torrent-details page to thank but rather just click on the download button. So now i want to add the "Thanks button" there also so that they don't have to go into the "torrent-details" just to hit the thanks button. If the Thanks button is next to the download button (green arrow) its easy to hit it.

Hope this explains it a bit better.
Unknown User
2011-11-22 17:12:51
I never understood why people want everything on the index page.. site has torrent details for an reason LOL, mids as well delete the torrent details and make it all off torrents.php  be easier on uploaders LOL
Unknown User
2011-11-22 17:18:22
I also don't know  :)  , it was a request from my members. All I'm trying to do is keep them happy.
Unknown User
2011-11-22 20:13:24
Find

if ($row["freeleech"] == 1)

$dispname .= " <img src='images/free.gif' border='0' alt='' />";
In backend/functions.php > torrenttable function underneath it add...




$dispname .= ' <form action="index.php" method="post"><input type="hidden" name="torrent" value="'.$row["id"].'" /><input type="submit" value="Thanks!" /></form>';





Open index.php underneath dbconn Add





 if ( is_valid_id($_POST['torrent']) )

{

 $res = SQL_Query_exec("SELECT `thanks` FROM `torrents` WHERE `id` = " . $_POST['torrent']);

 $row = mysql_fetch_assoc($res);

 

 if (!$row) show_error_msg("Error", "Invalid Torrent...", 1);

 

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

 

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

 

 $res = sprintf("UPDATE `torrents` SET `thanks` = CONCAT_WS(',', `thanks`, %s) WHERE `id` = %d", sqlesc($CURUSER['username']), $_POST['torrent']);

 SQL_Query_exec($res);

 

 header("Refresh: 3; url=index.php");

 show_error_msg("Success", "Thanks Added, redirecting...", 1);

}



if you dont have SQL_Query_exec use mysql_query
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728