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
User Posts

Go to Profile

happy to share just got a few more areas to do

on torrents-upload example
$ifilename = $next_id . $x . $allowed_types[$im['mime']];


below should look like
                    $image_name = copyImage($ifile, $uploaddir . $ifilename);
                   $inames[] = $image_name;


so minimum edits

made a convertor too for existing images seems to time out after around 20 images - bit of a pain converting all country flags lol lucky i moved to icons and removed most images - for old uploaded images i used something similar to the TMDB edit in post above to write to webp then unlink the old file to phase them out

convertor
        if (Input::exist()) {
$files = array_filter($_FILES['upload']['name']); //Use something similar before processing files.
// Count the number of uploaded files in array
$total_count = count($_FILES['upload']['name']);
// Loop through every file
for( $i=0 ; $i < $total_count ; $i++ ) {
  //The temp file path is obtained
   $source_file = $_FILES['upload']['tmp_name'][$i];
  //A file path needs to be present
  if ($source_file != ""){
     $newname = $_FILES['upload']['name'][$i];
     $destination_file = "assets/images/$newname"; //URLROOT."/$newname";
     //File is uploaded to temp dir
     echo 'temp file<pre>'.print_r($source_file, true).'</pre><br>';
     echo 'name<pre>'.print_r($newname, true).'</pre><br>';
     echo 'filepath<pre>'.print_r($destination_file, true).'</pre><br>';
     
     copyImage($source_file, $destination_file);
     
  }
}
}

?>

<form action="<?php echo URLROOT ?>/test/upload" method="post" enctype="multipart/form-data">
   Select Image Files to Upload:
   <input type="file" name="upload[]" multiple >
   <input type="submit" name="submit" value="UPLOAD">
</form>
All torrents is red — 2022-10-06 13:44:42 in General Chat
seedbox will have interval so might take few minutes to change

i can not understand why seedbox is not receiving error message this means the connection must be block - why i dont know - which seedbox

if utorrent gets error it should work with your announce on new torrent please test
Missed these from log when i update github ill add seperate project for sql changes

ALTER TABLE clients ADD  `code` varchar(20) DEFAULT NULL;
ALTER TABLE clients ADD `peer_id` varchar(40) DEFAULT NULL;
All torrents is red — 2022-10-06 11:19:50 in General Chat
because all is red lets try send error

save announce.php
then replace all file (even <?php) and just place one line

so full announce file will be
d14:failure reason4:teste


this will show if its announce causing issues - just try force re-announce on one torrent and see if message returns

first change on log https://torrenttrader.uk/docs?id=3

docs not fully finished yet but all sql changes are there - the final finished project will be added to github by end of this weekend
Currently changing all images to webp - webp images are a lot  smaller

This uses the gd extension and will save loads of space. As far as i know most browsers support webp.

I added check if gd added or use php copy
where ever copy is we just will add new function passing source and destination so edits are small

function copyImage($source, $destination, $redirect = URLROOT)
{
   if (extension_loaded('gd')) {
       // compress size max 100
       $compression_quality = 25;
       // set type
       $type = substr($destination, -3);
       $jpeg = substr($destination, -4);
       // set destination
       $new_destination = substr($destination, 0, -3) . 'webp';
               
       if ($type == 'png') {
           $image = imagecreatefrompng($source);
           imagepalettetotruecolor($image);
           imagealphablending($image, true);
           imagesavealpha($image, true);
       } elseif ($type == 'jpg') {
           $image = imagecreatefromjpeg($source);
       } elseif ($type == 'gif') {
           $image = imagecreatefromgif($source);
           imagepalettetotruecolor($image);
       } elseif ($jpeg == 'jpeg') {
           $image = imagecreatefromjpeg($source);
           $new_destination = substr($destination, 0, -4) . 'webp';
       } else {
           Redirect::autolink($redirect, sprintf(Lang::T("Strange Image Type")));
       }

       // convert image
       $result = imagewebp($image, $new_destination, $compression_quality);
       // check result
       if (false === $result) {
           Redirect::autolink($redirect, sprintf(Lang::T("No Image Result")));
       }
       // destroy temp
       imagedestroy($image);
       return $new_destination;
   } else {
       $copy = copy($source, $destination);
       if (!$copy) {
           Redirect::autolink($redirect, sprintf(Lang::T("IMAGE_UPLOAD_FAILED")));
       }
       return $destination;
   }
}




Example For TMDB posters under saveimage i used this - halving image sizes
        if (extension_loaded('gd')) {
           copyImage(UPLOADDIR . "/tmdb/film/$id_tmdb.jpg", UPLOADDIR . "/tmdb/film/$id_tmdb.jpg");
           unlink(UPLOADDIR . "/tmdb/film/$id_tmdb.jpg");
           unlink(CACHE . "/tmdb/film/$id_tmdb.cache");
           $image = "$id_tmdb.webp";
       }
All torrents is red — 2022-10-05 06:38:50 in General Chat
check error logs - sql, apache etc

it is worth noting php has limits - this attached to server limits would kill all connections

how old is site ?
i guess its internal ?
how many peers ?

my old site died before because one user had 850 torrents if he deleted 1 torrent fine but as soon as 850 it would die - this number would be different for each server but its worth ruling this out

this is big issue for TT upd is faster and modded announces causes bigger hit (or bad code) i assume thats why some older trackers use xbt.
activate account — 2022-09-23 05:46:58 in v3 Support
Backend/config.php
$site_config['CONFIRMEMAIL'] = true;


This sends confirmation email with signup link
All torrents is red — 2022-09-20 07:22:54 in General Chat
maybe user or port blacklisted - it is a server error but why just now. post any changes to sql or announce or has anything changed host side ?

ModSecurity is from server blocking access to something.
on cpanel you can switch off not sure about other host,

looking at log
Found 1 byte(s) in ARGS:info_hash outside
Found 1 byte(s) in ARGS:peer_id outside

this would point me to unicode maybe characters causing issue
see \xd96\\x1bV\\xa0n\\xe7\\xdf\ in log above
NOTE
if you have not changed anything it probably wont this this

is there any error in admin sql log

if a repeated bad connection or code throws tiny error - after a while modsecurity will ban that users access - check blacklist
Debts of seed — 2022-09-17 12:51:20 in v2.08 Support
Happy to help mate

For anyone else who experiences this the unique key was missing
UNIQUE KEY `tid_uid` (`tid`,`uid`),
Debts of seed — 2022-09-06 21:56:23 in v2.08 Support
internal ? that is normal after 1 hour cleanup removes peer from peers table when user connects again after 1 hour new peer is added to table

what page is that from ? because for current connected peers you just get from peers table

i would check peer table to check any difference between them, search by torrent id, then user id. also check last action row

after 1 hour any old peer should be removed from table lets check that first
New Pagination — 2022-08-29 04:36:10 in v2.08 Mods Completed
you can try these, see if you have any luck

first lets try set limit
for ($i = 1; $i <= $pages; ++$i) {


replace with
for ($i = 1; $i <= $pages; $i < 5; ++$i) {


or you could try break
for ($i = 1; $i <= $pages; ++$i) {


below add
    if ($i > 5) {
       break;
   }
ACL Query — 2022-08-13 17:32:29 in General Chat
i placed user class in a define so didnt have to change code when adding groups but am leaning towards isAdmin, isUser etc

was thinking about reducing groups
user, mod, admin

these would default permissions
standard access, mod access, admin access

moving uploader, donator to user table wouldnt be much issue then you could display badges on users name like on the colour_user_name mod you could then link to donators table from column instead of group same with vip and uploaders

i like it simple but easy to build on - adding a setting in future would just be adding to permission table with a default
ACL Query — 2022-08-13 14:23:59 in General Chat
looking to move user and group settings from those tables to a new permissions table.
Trying to do this a simple as possible, ill probably put in a little class

the idea is to have role_id in user table & group_role_id in group table

these have default permissions from permission table (canviewtorrents, editforum etc)

then i have group_permissions table to link group or user to permission id
we check if user role_id & group group_role_id is not default so users in same group can have different settings

i use single array but should be multi permission,group,user etc but that would mean too many edits lol i was also thinking about adding another table called roles with full access, limited access etc but opted to just add name to permission to keep it simple but making that start to start moving user settings
i had it has one join query but that limited scope a little bit

Any thoughts on improvements

ALTER TABLE groups
ADD `group_role_id` int(10) NOT NULL DEFAULT 1;

ALTER TABLE users
ADD `role_id` int(10) NOT NULL DEFAULT 1;

CREATE TABLE IF NOT EXISTS `group_permissions` (
 `id` int(10) NOT NULL AUTO_INCREMENT,
 `permission_id` int(10) NOT NULL DEFAULT 0,
 `role_id` int(10) NOT NULL DEFAULT 0,
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4;

INSERT INTO `group_permissions` (`id`, `permission_id`, `role_id`) VALUES
(1,0,1);

CREATE TABLE IF NOT EXISTS `permissions` (
 `permission_id` int(10) NOT NULL AUTO_INCREMENT,
 `permission_name` varchar(40) NOT NULL DEFAULT 'no name',
 `view_torrents` enum('yes','no') NOT NULL DEFAULT 'yes',
 `edit_torrents` enum('yes','no') NOT NULL DEFAULT 'no',
 `delete_torrents` enum('yes','no') NOT NULL DEFAULT 'no',
 `view_users` enum('yes','no') NOT NULL DEFAULT 'yes',
 `edit_users` enum('yes','no') NOT NULL DEFAULT 'no',
 `delete_users` enum('yes','no') NOT NULL DEFAULT 'no',
 `view_news` enum('yes','no') NOT NULL DEFAULT 'yes',
 `edit_news` enum('yes','no') NOT NULL DEFAULT 'no',
 `delete_news` enum('yes','no') NOT NULL DEFAULT 'no',
 `can_upload` enum('yes','no') NOT NULL DEFAULT 'no',
 `can_download` enum('yes','no') NOT NULL DEFAULT 'yes',
 `view_forum` enum('yes','no') NOT NULL DEFAULT 'yes',
 `edit_forum` enum('yes','no') NOT NULL DEFAULT 'yes',
 `delete_forum` enum('yes','no') NOT NULL DEFAULT 'no',
 PRIMARY KEY (`permission_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4;

INSERT INTO `permissions` (`permission_id`, `permission_name`, `view_torrents`, `edit_torrents`, `delete_torrents`, `view_users`, `edit_users`, `delete_users`, `view_news`, `edit_news`, `delete_news`, `can_upload`, `can_download`, `view_forum`, `edit_forum`, `delete_forum`) VALUES
('0','default','yes', 'no','no','yes','no','no','yes','no','no','yes','yes','yes','no','yes'),
(1,'staff', 'yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes');


then the query stuff
          // Lets Build Permission Array
         $data = array();

         // Get User & Group
         $user = DB::run(
           "SELECT * FROM `users`
           LEFT OUTER JOIN `groups`
           ON users.class=groups.group_id
           WHERE id = $_COOKIE[id]
           AND users.enabled='yes'
           AND users.status ='confirmed'"
         )->fetch();
         foreach ($user as $key => $value) {
           $data[$key] = $value;
         }
         echo '<pre>'.print_r($user, true).'</pre>';

         // User Role Or Group Role
         $user_or_group_role = $user['role_id'] != 0 ? $user['role_id'] : $user['group_role_id'];
         echo '<pre>'.print_r($user_or_group_role, true).'</pre>';

         // Now Get Role (default id 1 for default group role)
         $role = DB::run(
           "SELECT `permission_id`
            FROM `group_permissions` WHERE `role_id`=?",
            [$user_or_group_role]
         )->fetchColumn();
         echo '<pre>'.print_r($role, true).'</pre>';

         // Now Get Permission
         $permission = DB::run(
           "SELECT *
            FROM `permissions` WHERE `permission_id`=?",
            [$role]
         )->fetch(PDO::FETCH_ASSOC);
         foreach ($permission as $key => $value) {
           $data[$key] = $value;
         }
         echo '<pre>'.print_r($permission, true).'</pre>';

         // Full Single Array (less editing for now but should be multi)
         echo '<pre>'.print_r($data, true).'</pre>';
Daily Login Bonus — 2022-08-12 16:01:43 in v3 Mods Completed
this doesn't get enough attention from v3 users https://torrenttrader.uk/post?id=10390

although the class is still used (& working) the querys should be updated to prepared, time consuming but simple modernisation

Daily Login Bonus — 2022-08-06 21:22:16 in v3 Mods Completed
inline change
NOW()
With
".get_date_time()."
Need quick help, please — 2022-08-01 17:12:23 in General Chat
on torrent-upload.php
add var_dump($vip); die();
below $vip = $_POST["vip"];

try with box ticked and not - see if we can see what's happening
Error sql — 2022-08-01 17:04:05 in v3 Support
i think bigint signed is best option with big range from postive to negative

you can try cast for both
CAST(uploaded AS UNSIGNED) + $upthis

or
CAST(uploaded AS SIGNED) + $upthis


this option - please backup database first my friend
when you backup database at top of database file you should get sql mode add
'NO_UNSIGNED_SUBTRACTION';

some times you get this error if strict mode is on

it seems odd if it just started - strict mode is enabled by default so any update would reset my old host use to do it all time


VIP torrents — 2022-08-01 16:40:09 in General Chat
this should work but i recommend using v3

https://torrenttrader.uk/topic?topicid=9882

in the download.php edits replace sqli with sql
$res = SQL_Query_exec("SELECT filename, vip FROM torrents WHERE id = $id");
$arr = mysql_fetch_assoc($res);
$name = $arr['filename'];
$vip = $arr['vip'];

if ($vip == "yes" && $CURUSER["class"]<4 ){
  show_error_msg("Error","<b>You can not download, you have to be VIP</b>",1);
}


and also search for sqli in the downloaded vip-torrents.php and replace with sql
block paypal — 2022-07-30 15:57:47 in v3 Mods Requests
i have not seen a mod that connects to paypals api - i believe admin have to confirm donations manually

however creating a progress bar is simple - just need somewhere to keep amount gained - db seems too much just to keep amount - maybe a file it depends on what mods or process you use but for simple code this should work

$target = 100;
$current = 21;
?>              
<div style="background-color:#ffff00;height:24px;width:<?php echo $target ?>%">
   <div style="background-color:#ff0000;height:24px;width:<?php echo $current ?>%"></div>
</div>
<?php
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728