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
Delete NFO on existing torrents
Controls ·  Search New posts · Mark unread

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

2019-06-29 05:47:52
You can delete a NFO file on an existing torrent. This is very simple. I did this because I was trying to test something and the NFO was blowing my screen out. It was too big and caused me to have to scroll to the right to see the whole page. Rather than edit the database with phpmyadmin, I chose this method so anyone who uploads an NFO with bad formatting that destroys the page can remove it
in torrents-edit.php find
    $img2action = $_POST['img2action'];
   if ($img2action == "update")
       $updateset[] = "image2 = " .sqlesc(uploadimage(1, $row["image2"], $id));
   if ($img2action == "delete") {
       if ($row[image2]) {
           $del = unlink($site_config["torrent_dir"]."/images/$row[image2]");
           $updateset[] = "image2 = ''";
       }
   }

add after
    if ($nfoaction == "delete"){
        $updateset[] = "nfo = 'no'";
           }

find
echo "<tr><td class='table_col1'  align='right'><b>".T_("NFO").": </b><br /></td><td class='table_col2' ><input type='radio' name='nfoaction' value='keep' checked='checked' />Keep NFO &nbsp; <input type='radio' name='nfoaction' value='update' />Update NFO:";

replace with
echo "<tr><td class='table_col1'  align='right'><b>".T_("NFO").": </b><br /></td><td class='table_col2' ><input type='radio' name='nfoaction' value='keep' checked='checked' />Keep NFO <input type='radio' name='nfoaction' value='update' />Update NFO <input type='radio' name='nfoaction' value='delete'/>Delete NFO ";
[ATTACH type="full"]5080[/ATTACH]
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)
2019-06-30 11:09:02
Thanks you M8
2023-05-14 17:50:06
thanks man
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