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
Edit & Delete Torrents from Torrenttable
Controls ·  Search New posts · Mark unread

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

Unknown User
2019-07-14 13:47:38
ok this little hack will let you edit and delete torrents on the fly without having to go to torrents-details and clicking edit torrent (credits to MVP)
open backend functions.php find


$dispname = "<b>".$smallname."</b>";


Replace with  



if ($CURUSER['edit_torrents'] == 'yes' || $row['owner'] == $CURUSER['id']) {
$edit = '<a href="torrents-edit.php?id=' . $row['id'] . '"><img src="images/edit.png" hieght ="15" width ="15" border="0" alt="edit torrent" /></a>';
$del = '<a href="torrents-edit.php?action=deleteit&id=' . $row['id'] . '"></a>';
} else {
$edit = '';
}
$dispname = "<b>".$smallname."</b> $edit";
$dispname .= ($CURUSER['control_panel'] == 'yes') ? '<a href="' . $_SERVER['REQUEST_URI']  . '?delete=' . $row['id'] . '"><img src="images/delete.png" border="0" alt="delete torrent" /></a>' : '';


now find


if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
$dispname .= "<img src='images/new.gif' border='0' alt='new torrent' />";


under add


  if (!empty($_GET['delete']) && is_valid_id($_GET['delete']) && $CURUSER['control_panel'] == 'yes') {
  deletetorrent($_GET['delete']);
  if ($_SERVER['HTTP_REFERER'] != $_SERVER['PHP_SELF'])
                {
                echo "<meta http-equiv='refresh' content='0;URL=". $_SERVER['PHP_SELF']."'>";
                }
               }


you probably already have the images but if not pop them into your images folder
edit.png
edit.png
delete.png
delete.png
2019-07-14 16:00:33
where does this show up at? I dont see it
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)
Unknown User
2019-07-14 16:48:27
Main torrent table next to the name
Unknown User
2019-07-14 17:03:03
if you have
$dispname = "<b>".$smallname."</b>";


remove it sorry my functions is heavy modded (First post updated)


whole code should look like

case 'name':
               $char1 = 32; //cut name length
               $smallname = htmlspecialchars(CutName($row["name"], $char1));
               if ($CURUSER['edit_torrents'] == 'yes' || $row['owner'] == $CURUSER['id']) {
               $edit = '<a href="torrents-edit.php?id=' . $row['id'] . '"><img src="images/edit.png" hieght ="15" width ="15" border="0" alt="edit torrent" /></a>';          
               $del = '<a href="torrents-edit.php?action=deleteit&id=' . $row['id'] . '"></a>';
               } else {          
                  $edit = '';        
               }        
                       
                $dispname = "<b>".$smallname."</b> $edit";
                $dispname .= ($CURUSER['control_panel'] == 'yes') ? '<a href="' . $_SERVER['REQUEST_URI']  . '?delete=' . $row['id'] . '"><img src="images/delete.png" border="0" alt="delete torrent" /></a>' : '';
               $last_access = $CURUSER["last_browse"];
               $time_now = gmtime();
               if ($last_access > $time_now || !is_numeric($last_access))
                   $last_access = $time_now;
               if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
                   $dispname .= "<img src='images/new.gif' border='0' alt='new torrent' />";          
               if (!empty($_GET['delete']) && is_valid_id($_GET['delete']) && $CURUSER['control_panel'] == 'yes') {
                    deletetorrent($_GET['delete']);
               }
             
2019-07-14 23:34:28
cool, heres a few better images if it helps
deleteTORRENT.png
deleteTORRENT.png
editTORRENT.png
editTORRENT.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-07-15 14:07:48
big thanks[USER=1398] serph[/USER] (y)M8
2019-08-08 17:21:57
Hello, I come to tell you that we can not delete from the account


Thanks,,
Unknown User
2019-08-09 09:51:56
Hit the refresh button in your Web browser should be gone after that
Unknown User
2019-08-12 15:30:47
sorry for the delay

find in [color=rgb(41, 105, 176)]functions.php[/color]
[color=rgb(204, 204, 204)]
deletetorrent($_GET['delete']);


under add

if ($_SERVER['HTTP_REFERER'] != $_SERVER['PHP_SELF'])
{
echo "<meta http-equiv='refresh' content='0;URL=". $_SERVER['PHP_SELF']."'>";
}


first post updated

[/color]
2019-08-17 11:53:37
thank you, but still the same problem and even if I update it is still in my profile and must I head on the index for it works
Unknown User
2019-08-17 12:20:32
post your functions.php ill need to take a look as its working as should on my dev site v03  and main site v2.08
2019-08-17 12:31:36
"serph, post: 67090, member: 1398":

post your functions.php ill need to take a look as its working as should on my dev site v03  and main site v2.08

ok , thanks
functions.zip
Download

Unknown User
2019-08-17 12:48:24
the code from your functions php works as should on my site try this standard functions.php
if someone else could install and give feedback please
functions.zip
Download
2020-04-25 23:27:25
hi how can one move the 2 icons to lets say in front of the torrent name?
Torrent Trader PDO/MVC 2021
Xampp Windows 10 21H1
Apache Version: Apache/2.4.48 (Win64)
Mysql Version: 10.4.20-MariaDB
PHP Version: 8.0.9
2021-05-13 21:15:37
Most beautiful


Thanks serph
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