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
Say Thanks & Force
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-03-16 08:03:36
Updated for V3 credit to Original Author

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 THANKS


Make folder called js and add thanks.js into it
ADD thanks.php to root
thanks.zip
Download
2019-04-17 12:27:48
Can you update thanks php for class color function? i tried but ...
2019-04-17 13:41:30
had a quick go but cant seem to change it, i tried all 3 instances of username and no luck
2019-04-17 13:51:03
"m-jay,  post: 66435, member: 20288":

had a quick go but cant seem to change it, i tried all 3 instances of username and no luck

same for me. the username disappeared. i have the more group hack installed
2019-05-19 15:17:10
Thanks you ! (y)
2020-09-10 18:08:10
french;

Merci fonctionne bien et pouvez vous me dire comment mettre les membres qui on dit merci  en couleur,  j'ai la fonction class couleur et quand je change ce bout de code   ...

if ($CURUSER['username'] == $row['username']) {    

avec    

if ($CURUSER['username'] == " . class_user($row[username]) . " {




dans la fonction thanks sur le fichier torrent detail il y a un bug et page blanche

ci-dessous le code thanks du fichier torrent-detail.php




english;

Thank you works well and can you tell me how to put the members who said thank you in color, I have the function class color and when I change this piece of code...



if ($CURUSER['username'] == $row['username']) {

with  

if ($CURUSER['username'] == " . class_user($row[username]) . " {



in the thanks function on the torrent detail file there is a bug and blank page



below the thanks code of the torrent-detail.php file



    //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="Dire merci pour ce Torrent" 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\\\\\
2020-09-10 21:56:44
anyone wanna try this in thanks.php near the bottom. Im just reading the code because I know that the class user color is added to output, not database entries. Figured it was worth a quick go even though I cant test this wihout installing this mod. If it dont work, then I spose I can install it and try again
print("<table><tr><td>". class_user("$thanks") ."</td></tr></table>\n");

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-09-11 00:54:09
[USER=20338]niki[/USER], juste comme ça l'ami pour te dire qu'une page blanche a souvent rapport a la balise <table pas fermer ou manquante ;)
2020-09-11 04:01:32
ok merci à vous deux pour le soutient , je regarde tout à l'heure après le boulot puis revient dire le problème (y):giggle:
2020-09-11 04:39:34
I just did a test with the micomonkey code and it doesn't work. :(
je viens de faire un test avec le code de micomonkey et ça ne fonctionne pas :(

print("<table><tr><td>". class_user("$thanks") ."</td></tr></table>\n");
2020-09-11 19:31:31
Just tested class_user and its working fine on my test. the layout is terrible but I just installed this mod for testing. I did move the code to the top of the page. I'll keep testing
[ATTACH type="full" alt="Capture.PNG"]5889[/ATTACH]

I also changed that users class and the color changed with it
[ATTACH type="full" alt="Capture.PNG"]5890[/ATTACH]
Capture.PNG
Capture.PNG
Capture.PNG
Capture.PNG

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-09-11 19:46:57
seems like if more than 1 user thanks, then it wont display class color of each user....hmmm. What to do about that now.....
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-09-12 00:11:55
"MicroMonkey, post: 69345, member: 311":

seems like if more than 1 user thanks, then it wont display class color of each user....hmmm. What to do about that now.....


Loop the row results and define the array. This is done using while or preferably, and slower.. foreach. Then that iterates the row results and provides ability to do anything to it.
2021-04-23 07:27:32
The problem is in one line

In thanks.php find:
$u = ($u);


Replace with:
$u = class_user($u);


Thank you M-jay for updating this mod for TTv.3

Screenshot




2021-04-23 23:06:34
Big thanks coco  ;)
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728