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
Freeleech and sticky during upload [TTv3
Controls ·  Search New posts · Mark unread

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

2019-05-06 00:41:19
Install this mod first https://torrenttrader.xyz/index.php?threads/sticky-torrents-ttv3.9800/
In torrents-upload.php before


   //Uploaded ok message (update later)
   if ($external=='no')
       $message = sprintf( T_("TORRENT_UPLOAD_LOCAL"), $name, $id, $id );

add


       if ($CURUSER["edit_torrents"] == "yes")
           if(get_user_class($CURUSER) > 4){
               if ($_POST["sticky"] == "yes"){
               $updateset[] = "sticky = 'yes'";
                }else{
               $updateset[] = "sticky = 'no'";
       }
}
       $updateset[] = "freeleech = '".intval($_POST["freeleech"])."'";
       SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");

after


print ("<tr><td colspan='2' align='center'>".T_("MAX_FILE_SIZE").": ".mksize($site_config['image_max_filesize'])."<br />".T_("ACCEPTED_FORMATS").": ".implode(", ", array_unique($site_config["allowed_image_types"]))."<br /></td></tr><tr><td align='right'>".T_("IMAGE")." 1:&nbsp;&nbsp;</td><td><input type='file' name='image0' size='50' /></td></tr><tr><td align='right'>".T_("IMAGE")." 2:&nbsp;&nbsp;</td><td><input type='file' name='image1' size='50' /></td></tr>");

add


if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){
   echo "<tr><td align='right'><b>".T_("FREE_LEECH").": </b></td><td><input type=\"checkbox\" name=\"freeleech\"" . (($row["freeleech"] == "1") ? " checked=\"checked\"" : "" ) . " value=\"1\" />".T_("FREE_LEECH_MSG")."<br /></td></tr>";
   echo "<tr><td align='right'><b>Sticky?</b></td><td><input type='checkbox' name='sticky'" .
(($row["sticky"] == "yes") ? " checked='checked'" : "" ) . " value='yes' />";
}

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)
2019-05-21 13:52:27
Thanks  @[USER=311]MicroMonkey[/USER]


thank you very much for this mod tres useful.

I had an admin error on the jut after .. "$ message = sprintf (T _ (" TORRENT_UPLOAD_LOCAL "), $ name, $ id, $ id);"

small correction, look for:

   //Uploaded ok message (update later)
   if ($external=='no')
       $message = sprintf( T_("TORRENT_UPLOAD_LOCAL"), $name, $id, $id );
   else
       $message = sprintf( T_("TORRENT_UPLOAD_EXTERNAL"), $name, $id );
   show_error_msg(T_("UPLOAD_COMPLETE"), $message, 1);


Add after:

   // Freeleech and sticky during upload
       if ($CURUSER["edit_torrents"] == "yes")
           if(get_user_class($CURUSER) > 4){
               if ($_POST["sticky"] == "yes"){
               $updateset[] = "sticky = 'yes'";
                }else{
               $updateset[] = "sticky = 'no'";
           }
       }
       $updateset[] = "freeleech = '".intval($_POST["freeleech"])."'";
   // End Freeleech and sticky during upload


Which will give in the end:

   //Uploaded ok message (update later)
   if ($external=='no')
       $message = sprintf( T_("TORRENT_UPLOAD_LOCAL"), $name, $id, $id );
   else
       $message = sprintf( T_("TORRENT_UPLOAD_EXTERNAL"), $name, $id );
   show_error_msg(T_("UPLOAD_COMPLETE"), $message, 1);
   // Freeleech and sticky during upload
       if ($CURUSER["edit_torrents"] == "yes")
           if(get_user_class($CURUSER) > 4){
               if ($_POST["sticky"] == "yes"){
               $updateset[] = "sticky = 'yes'";
                }else{
               $updateset[] = "sticky = 'no'";
           }
       }
       $updateset[] = "freeleech = '".intval($_POST["freeleech"])."'";
   // End Freeleech and sticky during upload        
       SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");

   die();
   }//takeupload


2019-06-01 01:31:49
Hi :)

blank page with the line to upload?


       if ($CURUSER["edit_torrents"] == "yes")
           if(get_user_class($CURUSER) > 4){
               if ($_POST["sticky"] == "yes"){
               $updateset[] = "sticky = 'yes'";
                }else{
               $updateset[] = "sticky = 'no'";
       }
}
       $updateset[] = "freeleech = '".intval($_POST["freeleech"])."'";
       SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");


2019-06-01 05:31:13
install first https://www.torrenttrader.xyz/index.php?threads/sticky-torrents-ttv3.9800/#post-66657
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)
2019-06-22 16:12:51
"MicroMonkey, post: 66658, member: 311":


Allo MicroMonkey ;)

I have my freeleech who does not want to apply to upload ??? I did a lot of testing and nothing to do? Can you help me?
2019-06-25 21:32:22
I cant duplicate your problem. Worked perfectly when I tested it just 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)
2019-06-26 21:34:43
"MicroMonkey, post: 66723, member: 311":

I cant duplicate your problem. Worked perfectly when I tested it just now.

ok, but for the time I did what is said above  :(
2019-06-26 23:04:48
hmm, did you install this first? https://www.torrenttrader.xyz/index.php?threads/sticky-torrents-ttv3.9800/#post-66657
I actually installed this backwards by installing this mod first then I went back and installed the other one with the SQL edits and tested it and it appears to work fine. I am testing on TTv3
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)
2019-06-27 02:00:53
"MicroMonkey, post: 66740, member: 311":

hmm, did you install this first? https://www.torrenttrader.xyz/index.php?threads/sticky-torrents-ttv3.9800/#post-66657
I actually installed this backwards by installing this mod first then I went back and installed the other one with the SQL edits and tested it and it appears to work fine. I am testing on TTv3


no I install freeleech first and then your change.
I'm sure it works too, but for me it does not apply to upload, only on edition.

Weird! lol :unsure::)

but I still go to all the installation of freeleech and the change to you, I have to mock of what? (y)
2024-05-14 14:20:24
tyyyyyyyyyyyy
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