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

TT Team bug — 2020-03-07 07:20:33 in v3 Support
playing around with bootstrap on team create and noticed a bug with TT
If you create team then keep refreshing page it keeps re-adding team luckily only members with control panel access can do this

v3 url will differ a little bit
https:/YOUR_URL/teams-create.php?team_name=fsfew&team_owner=mjay&team_description=vrvre&team_image=&add=true
Your new line is correct the other is just a typing error I'll  update  (y)
Now my table head looks like this

print("<div class='table-responsive'><table class='table table-striped'>
<thead><tr>
<th>" . T_("USERNAME") . "</th>
<th>" . T_("REGISTERED") . "</th>
<th>" . T_("LAST_ACCESS") . "</th>
<th>" . T_("CLASS") . "</th>
<th>" . T_("COUNTRY") . "</th>
</tr></thead>");


and the info, although this is a messy example
print("<tbody><tr>
<td><a href='account-details.php?id=$row[id]'><b>".class_user($row['username'])."</b></a>" .($row["donated"] > 0 ? "<img src='$site_config[SITEURL]/images/star.png' border='0' alt='Donated' />" : "")."</td>"."
<td>".utc_to_tz($row["added"])."</td>
<td>".utc_to_tz($row["last_access"])."</td>
<td>".T_($row["level"])."</td>$country
</tr></tbody></table></div>");


Some css for header
.table thead th {
       color: #fff;
       background-color: #072F5F;
       background-image: -webkit-linear-gradient(top, #072F5F, #3895D3);
       background-image: linear-gradient(to bottom, #072F5F, #3895D3);
       background-repeat: repeat-x;
}
.table tbody td {
   background-color: #EEEEEE;
}


error 508 — 2020-03-05 17:33:18 in v3 Support
You should contact the host it is a problem on there side maybe space, cpu
It is possible bad script if you have added something new recently but most of times its host
Ps - how many backups do you have? these take a bit of space if you have a few
This is a function replacement im  working on to navigate pages better using bootstrap here is the function and example to see.
Im using this for pagination and i just need a table function now and thought id post it if its any use to anyone

This is memberlist.php for testing purposes ($statement = "`[color=rgb(250, 197, 28)]users[/color]` ORDER BY `[color=rgb(250, 197, 28)]id[/color]` ASC"; // Change `[color=rgb(250, 197, 28)]users[/color]` & '[color=rgb(250, 197, 28)]id[/color]' according to your table name.
<?php
require_once("backend/init.php");
dbconn();
loggedinonly();

stdhead(T_("USERS"));
begin_frame(T_("USERS"));

$page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]);
if ($page <= 0) $page = 1;

$per_page = 5; // Set how many records do you want to display per page.
$startpoint = ($page * $per_page) - $per_page;
$statement = "`users` ORDER BY `id` ASC"; // Change `users` & 'id' according to your table name.
$results = DB::run("SELECT * FROM {$statement} LIMIT {$startpoint} , {$per_page}");

if ($results->rowCount()) {

   // displaying records this is where main code goes
   while ($row = $results->fetch(PDO::FETCH_LAZY)) {
             echo $row["username"]."<br>";  // if you change query remember change column name
   }

} else {
    echo "No records are found.";
}

// displaying paginaiton.
echo pagination($statement,$per_page,$page,$url='?');

end_frame();
stdfoot();


Add to functions before ?> at end

<?php
function pagination($query,$per_page=10,$page=1,$url='?'){  

   $query = "SELECT COUNT(*) as `num` FROM {$query}";
   $row = DB::run($query)->fetch();
   $total = $row['num'];
   $adjacents = "2";
   
   $prevlabel = "Prev";
   $nextlabel = "Next";
   $lastlabel = "Last";
   
   $page = ($page == 0 ? 1 : $page);
   $start = ($page - 1) * $per_page;                              
   
   $prev = $page - 1;                        
   $next = $page + 1;
   
   $lastpage = ceil($total/$per_page);
   
   $lpm1 = $lastpage - 1; // //last page minus 1
   
   $pagination = "";
   if($lastpage > 1){  
       $pagination .= "<nav aria-label='Page navigation example'><ul class='pagination'>";
  //     $pagination .= "<li class='page-item'><a class='page-link' href='#'>{$page}</a></li>";
                     
           if ($page > 1) $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$prev}'>{$prevlabel}</a></li>";
           
       if ($lastpage < 7 + ($adjacents * 2)){  
           for ($counter = 1; $counter <= $lastpage; $counter++){
               if ($counter == $page)
                   $pagination.= "<li class='page-item'><a class='page-link' >{$counter}</a></li>";
               else
                   $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$counter}'>{$counter}</a></li>";                  
           }
       
       }
     
       elseif($lastpage > 5 + ($adjacents * 2)){
           
           if($page < 1 + ($adjacents * 2)) {
               
               for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++){
                   if ($counter == $page)
                       $pagination.= "<li class='page-item'><a class='page-link'>{$counter}</a></li>";
                   else
                       $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$counter}'>{$counter}</a></li>";                  
               }
               $pagination.= "<li class='page-link'>...</li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$lpm1}'>{$lpm1}</a></li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$lastpage}'>{$lastpage}</a></li>";
                   
           } elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {
               
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page=1'>1</a></li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page=2'>2</a></li>";
               $pagination.= "<li class='page-link'>...</li>";
               for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {
                   if ($counter == $page)
                       $pagination.= "<li class='page-item'><a class='page-link>{$counter}</a></li>";
                   else
                       $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$counter}'>{$counter}</a></li>";                  
               }
               $pagination.= "<li class='page-link'>..</li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$lpm1}'>{$lpm1}</a></li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$lastpage}'>{$lastpage}</a></li>";    
               
           } else {
               
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page=1'>1</a></li>";
               $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page=2'>2</a></li>";
               $pagination.= "<li class='page-link'>..</li>";
               for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {
                   if ($counter == $page)
                       $pagination.= "<li class='page-item'><a class='page-link'>{$counter}</a></li>";
                   else
                       $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$counter}'>{$counter}</a></li>";                  
               }
           }
       }
     
           if ($page < $counter - 1) {
       $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page={$next}'>{$nextlabel}</a></li>";
       $pagination.= "<li class='page-item'><a class='page-link' href='{$url}page=$lastpage'>{$lastlabel}</a></li>";
       }
       
       $pagination.= "</ul></nav>";      
   }
   
   return $pagination;
}



Remember you need bootstrap
    <!-- Required meta tags -->
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <!-- Bootstrap CSS -->
   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
       integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
   <!-- Optional JavaScript -->
   <!-- jQuery first, then Popper.js, then Bootstrap JS -->
   <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
       integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
   </script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
       integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
   </script>
   <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
       integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
   </script>


heres with limit set to 1 for more pages
I hope to add more emotions angry, love, thanks - on torrents it seems easy  but comments are causing headache but we keep trying
I looked at that mod spirtblue in torrent-details near top dont forgot to add columns to big query torrent.angry, torrent.love, etc
Ive removed that for now and just left the button because it caused a issue with torrent comments for some reason
ive added to comments as well but
noticed now it will need another column for post type at minute i like everything with id 1
Just need to try forum comments
This is a like button i have made it is fully working but doesn't show names of members who have thanked yet. Ive tried a join query with no luck so if any one can help would be very appreciated.

I havent tested this on v3 but it is fine on mine so any issues let me know and ill look at the query's

Its just like button on torrents for now but im going to add to forum as well here is the db structure
$id = table id
$lid = like id/ type so we can add others thanks, love etc like is type 1
$uid = user id
$pid = post id, this will be torrent id, shoutbox comment id, forumpost id, comment id etc

In torrent-details.php find
echo "</table></fieldset><br /><br />";

// $srating IS RATING VARIABLE


above add
// like mod
if(isset($_POST['like'])) {
   SQL_Query_exec("INSERT INTO likes (lid, uid, pid) VALUES (1, $CURUSER['id'], $row['id']));
   header('Location: '.$_SERVER['REQUEST_URI']);
   exit;
} elseif (isset($_POST['unlike'])) {
   SQL_Query_exec("DELETE FROM likes WHERE lid=1 AND uid=$CURUSER['id'] AND pid= $row['id']");
   header('Location: '.$_SERVER['REQUEST_URI']);
   exit;
}

/* Check Database */
$res2 = SQL_Query_exec("SELECT * FROM likes WHERE lid=1 AND uid=$CURUSER['id'] AND pid= $row['id']");
$row = mysqli_fetch_row($re2);
$likes = $row[0];

if (!$likes) {

   /* If No Result Like */
   print("<tr><td align='left'><b>Likes</b></td><td><form action='' method='post'>
             <input type='submit' name='like' value='Like' />
         </form></br></td></tr>");

} else {

   /* If Result UnLike */
   print("<tr><td align='left'><b>Likes</b></td><td><form action='' method='post'>
             <input type='submit' name='unlike' value='Unlike' />
         </form></br></td></tr>");

}


sql
CREATE TABLE IF NOT EXISTS `likes` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `lid` int(10) NOT NULL DEFAULT 0,
 `uid` int(10) NOT NULL DEFAULT 0,
 `pid` int(10) NOT NULL DEFAULT 0,
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;





Seed Bonus [TTv3] — 2020-03-01 16:58:32 in v3 Mods Completed
How long as it been installed might just be delayed or you can force cleanup in admincp
Does the rest of the mod work for you
movie-torrentz was modified by MVP and he also wrote them some mods, not too sure if it's the same owner but last i knew the owner came from my neck of the woods
Played around with this for a bit of fun, im thinking about using it to upload avatars, torrent images and stop files been uploaded to the server, this code uploads to imgbb then returns the link - so far ive just done the test page

You need to make account and get key here https://api.imgbb.com/

Then create a file imgbb.php and place in it                 (remember to add your key)
<?php
 require_once("backend/functions.php");
 dbconn();
 loggedinonly();
stdhead();
begin_frame();

function save_record_image($image,$name = null){
   $API_KEY = 'YOUR_CLIENT_API_KEY'; // ADD YOUR KEY
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, 'https://api.imgbb.com/1/upload?key='.$API_KEY);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
   $file_name = ($image['name']) ;
   $data = array('image' => base64_encode(file_get_contents($image['tmp_name'])));
   curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
   $result = curl_exec($ch);
   if (curl_errno($ch)) {
       return 'Error:' . curl_error($ch);
   }else{
       return json_decode($result, true);
   }
   curl_close($ch);
}


?>
<form method="post" enctype="multipart/form-data">
   <input type="file" name="record_image" accept="image/*">
   <button type="submit">Upload</button>
</form>
<?php

if (!empty($_FILES['record_image'])) {
   $return = save_record_image($_FILES['record_image']);
   echo $return['data']['url'];
}

 end_frame();
 stdfoot();



[ATTACH type="full" alt="5388"]5388[/ATTACH]
Mines private tracker, members only with https announce and has been fine for years
With the v3 unless you mean a different combination of settings or external
my line in config is
$site_config[SITEURL]/announce.php?passkey=%s

Also do you have ssl and the siteurl matches the announce address having https in one and not the other would cause that error
Snatchlist [TTv3] — 2020-02-26 20:24:27 in v3 Mods Completed
On torrentsdetails and accountdetails it provides a link to  that user or that torrents download history
This data is in a table
Upload, download, ratio, added, startime, endtime Seedtime
This is set so only staff can view  (y)
[USER=401]@spiritblue[/USER] this can be removed from config
// Color of the Groups
$site_config['administrator_color'] = '#FF0000';   // Administrator
$site_config['super_moderator_color'] = '#00C000';   // Super Moderator
$site_config['moderator_color'] = '#007F00';   // Moderator
$site_config['uploader_color'] = '#00ABA6';   // Uploader
$site_config['vip_color'] = '#FF5E00';   // VIP
$site_config['power_user_color'] = '#BD8B00';   // Power User
$site_config['member_color'] = '#856A00';   // Member

and i added disabled to functions
// Start class_user colour function
function class_user($name)
{
   global $site_config;
   $classy = DB::run("SELECT u.class, u.donated, u.warned, u.enabled, g.Color, g.level, u.uploaded, u.downloaded FROM `users` `u` INNER JOIN `groups` `g` ON g.group_id=u.class WHERE username ='" . $name . "'")->fetch();
   $gcolor = $classy['Color'];
   if ($classy['donated'] > 0) {
       $star = "<img src='" . $site_config['SITEURL'] . "/images/donor.png' alt='donated' border='0' width='15' height='15'>";
   } else {
       $star = "";
   }
   if ($classy['warned'] == "yes") {
       $warn = "<img src='" . $site_config['SITEURL'] . "/images/warn.png' alt='Warn' border='0'>";
   } else {
       $warn = "";
   }
  if ($classy['enabled'] == "no") {
       $disabled = "<img src='".$site_config['SITEURL']."/images/disabled.png' title='Disabled' border='0'>";
  } else {
      $disabled = "";
  }

   return unesc("<font color='" . $gcolor . "'>" . $name . "" . $star . "" . $warn . "" . $disabled . "</font>");
}
TorrentTrader 3.0 — 2020-02-24 17:20:50 in v3 Download
Here is what ive done and it seems fine on live site php 7.4
Chances are this has been turned off since 5.6 and so i removed this in functions.php
// Prefer unescaped. Data will be escaped as needed.
if (ini_get("magic_quotes_gpc")) {
   $_POST = array_map_recursive("unesc", $_POST);
   $_GET = array_map_recursive("unesc", $_GET);
   $_REQUEST = array_map_recursive("unesc", $_REQUEST);
   $_COOKIE = array_map_recursive("unesc", $_COOKIE);
}


this is not needed by looks of it in any file
function unesc($x) {
   if (get_magic_quotes_gpc())
       return stripslashes($x);
   return $x;
}


in announce remove
$_GET = array_map_recursive("unesc", $_GET);

//START FUNCTIONS
function array_map_recursive ($callback, $array) {
   $ret = array();

   if (!is_array($array))
       return $callback($array);

   foreach ($array as $key => $val) {
       $ret[$key] = array_map_recursive($callback, $val);
   }
   return $ret;
}

function unesc($x) {
       return stripslashes($x);
   return $x;
}


for stripslashes/addslashes theres 48 instances in TT code this is stuff like removing slashes from db a good example is $site_config["UPLOADRULES"] where things like bbcode can be used (the 6 addslashes are for bencode and should be left alone)
so that just leaves injection security which is what magic quotes did (prevent injection by adding slashes to input)

You should never trust user input so you can escape html with htmlspec/entities and everything else use function sqlesc, input var is another way, in queries you can define a little better like
$id= (int)


This is where TT shows its age everything should be prepared, bind, before executed to prevent sql injection but you dont need to replace array map just escape everything manually
I've removed that line of code and should work on 7.4
Pdo is the future but the original 2.08 code is so old and could be simplified, we will slowly get there.
As for theme everyone has different taste so the plan is to make everything generic and replace with bootstrap for example all block css (blockframe) could be replaced with theme css (frame) , all image buttons could be replaced with input buttons etc and just remove as much as possible
We can separate ui into view files
Ive placed all files for stable release back to the rightful location, i have them all moved but im having a issue with dynamic links with the router it doesnt like all url ( id/do/action/edit etc ) statements

At least this makes it easy to compare changes  from v3 and everything is in the right place for mods to be added and every ones familiar with the code.
The base is fully done and has been tested by me but  just need more people to test but its now a stable release that ill be posting around.
The only thing is the style been so basic but im hoping to remove most of the theme when i add bootstrap for each page. At the minute theme frame & torrent-details are bootstrap

I just need to add init.php from mine but any changes will be commented on github and im going to add a few mods

remove mysql.php
https://github.com/M-jay84/Torrent-Trader-2020-PDO/commit/b89583720767de4b018ecd6918abd4302173b050
this is a stable release so please report any bugs or thoughts for improving
Statics are a good tool but are frowned on because you cant extend them and If there do too much can bite you in ass in future but these two I have both are tiny, one is just settings in one file and the only connection to db so are strictly one purpose using another db like sqlite might change that but as far as I know with this dbclass I just need to change the dsn a little
Once I'm done the two statics can be removed easily then added to function parameters I've got a new db ready but mass editing keeps breaking it lol need to do each file one by one but that can wait its just a case of autoloader(init.php) then define class
$pdo = new db
$Config = require (config/config.php

Example function dbconn($pdo, $config)

I've added a router just playing with the dynamic links hopefully it works, moved memberlist.php out of root and it works just some of the links
The urls look better though siteurl/memberlist
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