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

update logout function v3 — 2022-04-10 16:23:04 in v3 Support
Delete after logout
update logout function v3 — 2022-04-09 21:42:48 in v3 Support
new error i came across
Quote:
setcookie(): Passing null to parameter #2 ($value) of type string is deprecated


replace null for empty string in functions.php
function logoutcookie() {
setcookie("pass", "", time(), "/");
setcookie("uid", "", time(), "/");
}
Proposal — 2022-04-09 09:06:19 in General Chat
for update backup files first & just delete 3 files from downloaded github project

1) ht.access
2) public_html/ht.access
3) app/config/config.php

i removed the themes as well now there is just default, on louie.eu its the darktheme that would need changing on the stylesheet table to default & the old darktheme will be on the users table stylesheet column or add default in admincp/theme management before updating

any issues look at the data/logs/exception log - search for call stack that line will show any issues  👍
help 2 — 2022-04-02 12:56:15 in v3 Support
Try $_SERVER["REQUEST_METHOD"]
in app/views/forum/topic/index.php line 79 should look like this for forum thanks
print("<a href='" . URLROOT . "/like/thanks?id=$arr[id]&type=thanksforum'><i class='fa fa-thumbs-up' title='Thanks'></i></a>&nbsp;");


Some one else has raised image re-sizing - stuff like the images in the bbcode and i found a nice piece of css that hopefully will solve the resize problems if you notice any

ill test here later so can be seen  👍


where does this happen
Quote:
- The picture in the profile for the user overlaps content when viewed on small screens
ill look through these  😊 just little improvements now, https://torrenttrader.uk/post/user?id=1  &  https://torrenttrader.uk/comment/user?id=1
i did the comments & forum post and ill post them for a example of mvc - using this as a guide you can build stuff pretty quick

need to add sql & replace app/helpers_general_helper with https://github.com/M-jay84/M-BiTsy/blob/main/M-BiTsy/app/helpers/general_helper.php - added a function to tidy up a bit & sort ratio, avatar etc which i used for comments & forum which ill re-use everywhere

added new sql
ALTER TABLE `comments` ADD `type` VARCHAR(11) DEFAULT NULL;


first re-write model function - i only try use 1 query each page to get info from database - not always possible but makes life easier
app/models/Comments.php
    public static function join($id, $limit)
   {
       $row = DB::run("SELECT comments.id, comments.type, comments.news, comments.torrent, text, user, comments.added, avatar,
                              signature, username, users.title, class, uploaded, downloaded, privacy, donated,
                              news.title as newstitle,
                              torrents.name as torrenttitle
                       FROM comments
                       LEFT JOIN users
                       ON comments.user = users.id
                       LEFT JOIN news
                       ON comments.news = news.id
                       LEFT JOIN torrents
                       ON comments.torrent = torrents.id
                       WHERE user = $id ORDER BY comments.id $limit")->fetchAll();
       return $row;
   }


second write the controller (page) this is where we sort the data and send to view eg $_GET or query results
rewrite user function in app/controllers/users/Comment.php
    public function user()
   {
       // Get Id
       $id = (int) Input::get("id");

       // Run Some Checks
       if (!isset($id) || !$id) {
           Redirect::autolink(URLROOT, Lang::T("ERROR"));
       }
       
       // Count For Pager
       $count = DB::column('comments', 'count(*)', ['user' => $id]);
       list($pager, $limit) = Pagination::pager(20, $count, URLROOT . "/comment/user?id=$id&");
               
       // Grab All Data
       $row = Comments::join($id, $limit);
       //echo '<pre>'.print_r($row, true).'</pre>';  

       // Check If Data Returned
       if (!$row) {
           Redirect::autolink(URLROOT, "User has not posted any comments");
       }

       // Send Sorted Data
       $data = [
           'title' => Lang::T("Search Users Comments"),
           'id' => $id,
           'res' => $row,
           'pager' => $pager,
       ];
       View::render('comment/user', $data, 'user');
   }


Third make a view - this is where we go through the data sent from controller placing it into html
rewrite  app/views/user/comment
<p class="text-center"><a href='<?php echo URLROOT  ?>/profile?id=<?php echo $data['id']  ?>'>Go To Profile</a></p>
<?php
foreach ($data['res'] as $row) {
  // Quick Function To Tidy Results
  $user = userpostdetails($row); ?>

  <div class="container">
     <div class="row ttborder">
        <div class="col-2 d-none d-sm-block"> <?php
           if (Users::get('edit_users') == 'no' && $user['privacylevel'] == 'strong') {
              print('<td align="left" width="180"><center><small><a href="' . URLROOT . '/profile?id=' . $row['id'] . '"><b>' . $user['postername'] . '</b></a><br /><i>' . $user['title'] . '</i><img width="80" height="80" src="' . $user['avatar'] . '" alt="" /><br />Uploaded: ---<br />Downloaded: ---<br />Ratio: ' . get_ratio_color('---') . '</small><br /><br /><a href="' . URLROOT . '/profile?id=' . $row["user"] . '"><i class="fa fa-user tticon" title="Profile"></i></a> <a href="' . URLROOT . '/message/create?id=' . $row["user"] . '"><i class="fa fa-comment" title="Send PM"></i></a></center></td>');
           } else {
              print('<td align="left" width="180"><center><small><a href="' . URLROOT . '/profile?id=' . $row['id'] . '"><b>' . $user['postername'] . '</b></a><br /><i>' . $user['title'] . '</i><img width="80" height="80" src="' . $user['avatar'] . '" alt="" /><br />Uploaded: ' . $user['useruploaded'] . '<br />Downloaded: ' . $user['userdownloaded'] . '<br />Ratio: ' . get_ratio_color($user['userratio']) . '</small><br /><a href="' . URLROOT . '/profile?id=' . $row["user"] . '"><i class="fa fa-user" title="Profile"></i></a> <a href="/message/create?id=' . $row["user"] . '"><i class="fa fa-comment" title="Send PM"></i></a></center></td>');
           } ?>
        </div>
        <div class="col-10">
           <a href="<?php echo URLROOT ?>/topic?topicid=<?php echo $row['topicid']  ?>"><b><?php echo $row['subject'] ?></b></a> Posted: <?php echo date("d-m-Y \\a\\t H:i:s", TimeDate::utc_to_tz_time($row["added"]))  ?><a id="comment<?php echo $row["id"]  ?>"></a> in <a href="<?php echo URLROOT ?>/forum/view&forumid=<?php echo $row['forumid'] ?>"><b><?php echo $row['name'] ?></b></a>
           <p class="float-end"><?php echo $user['edit'] . $user['delete']  ?><a href="<?php echo URLROOT ?>/report/forum?forumid=<?php echo $row['topicid']  ?>&forumpost=<?php echo $row['id']  ?>"><i class="fa fa-flag" title='Report' aria-hidden="true"></i></a></p>
           <hr />
           <?php echo $user['commenttext']  ?>
           <hr />
           <?php echo $user['usersignature']  ?>
        </div>
     </div><br>
  </div> <?php
}
print($data['pager']);


here it is on github the user comments https://github.com/M-jay84/M-BiTsy/commit/0a2d20a3064fd1f0c2936e7ca8e66a489f1c49c0 and user forum post https://github.com/M-jay84/M-BiTsy/commit/82d00a4b0c58dabc1fc6d9ddfde8a07535fb5ba1

debug your own
the best way to build is printing out the data so in controller print out the data from the model make sure you have everything you want
        // Grab All Data
       $row = Comments::join($id, $limit);
       echo '<pre>'.print_r($row, true).'</pre>';


so before you start you plan on what you need and then in the controller we check the data been sent to the view
View::render('comment/user', $data, 'user');
echo '<pre>'.print_r($data, true).'</pre>';


here is example of the data sent to view for users comments - once you've got your model data its so easy hopefully 🤣 making it user friendly is something i;m more aware of
    [title] => Search Users Comments
   [id] => 1
   [res] => Array
       (
           [0] => Array
               (
                   [id] => 2
                   [type] => forum
                   [news] => 0
                   [torrent] => 28
                   [text] => jntrhjrh
                   [user] => 1
                   [added] => 2022-03-26 17:29:50
                   [avatar] =>
                   [signature] =>
                   [username] => M-jay
                   [title] =>
                   [class] => 7
                   [uploaded] => 524288000
                   [downloaded] => 1073741824
                   [privacy] => normal
                   [donated] => 0
                   [newstitle] =>
                   [torrenttitle] => MP3-daily-2022-March-17-Vocal
               )
 
This is for security
* if system doesn't like you (eg bad IP, not a member) you must login - after been logged out and all saved details removed

this is to stop endless loop as well - not member so logout - to login page - - not member so logout - to login page - etc etc

what we do for login is delete cookies read password & username - if confirmed write new ones

we use bycrypt for password so its not like md5 and keeps changing so is good for another way of checking user verified like crsf protection  👍
download ban — 2022-03-21 19:32:27 in v3 Mods Requests
Noticed this announce edit could be improved https://torrenttrader.uk/topic?topicid=1651&page=#post8905

This allows user to seed but not leech so can improve ratio
if($user["downloadbanned"] != 'no' && $seeder == 'no')
{
err("You cannot leech your banned from downloading.");
}


Further down in post there is download.php edit I changed this
$subbanned = mysql_query("SELECT id FROM users WHERE id=$CURUSER[id] AND downloadbanned='no' LIMIT 1") or err('Tracker error (1)');
if (mysql_num_rows($subbanned) < 1  ||   $row["external"] =='yes'  && $CURUSER["downloadbanned"]=="yes" ){
show_error_msg("Error", "You have been banned from download.", 1);
}


Now members can't download external and if internal can download and seed but can't leech so can upload if banned for poor ratio
Captcha TTv3 — 2022-03-20 20:22:39 in v3 Mods in Progress
I remove captcha keys here & delete in google admin - but still works - maybe google has cache - no keys but all browsers work - strange
how long on new server ?

#################################

Je supprime les clés captcha ici et les supprime dans google admin - mais fonctionne toujours - peut-être que google a du cache - pas de clés mais tous les navigateurs fonctionnent - étrange
combien de temps sur nouveau serveur ?
Captcha TTv3 — 2022-03-20 12:24:45 in v3 Mods in Progress
A new server = maybe dns change

1 Try turn off in config & empty keys

2 in Google admin remove site eg https://www.google.com/recaptcha/admin/site/438532290/settings

3 turn config on/true (no keys) try site it should stop connection

4 back to Google admin add domain back get keys and add to config

Google needs to re-connect, or I think you can add a new site get new keys and do it that way

#####################

Un nouveau serveur = peut-être un changement de DNS

1 Essayez de désactiver dans la configuration et les touches vides

2 dans Google admin supprimer le site, par exemple https://www.google.com/recaptcha/admin/site/438532290/settings

3 allumez la configuration/true (pas de clés) essayez le site, il devrait arrêter la connexion

4 retour à l'administrateur Google ajouter le domaine récupérer les clés et ajouter à la configuration

Google doit se reconnecter, ou je pense que vous pouvez ajouter un nouveau site, obtenir de nouvelles clés et procéder ainsi
had a quick look at ratio colour & its calculated the same $user["uploaded"] / $user["downloaded"] but through out the code it's approached different ways

The best way to re-do it is to re-factor the code so its all the same but here is the idea - anywhere ratio is needed run this line
$ratio = $user["downloaded"] > 0 ? number_format($user["uploaded"] / $user["downloaded"], 1) : "---";


update 20/03/22
updated function
function get_ratio_color($ratio)
{
  if ($ratio == '---') {
      return "<font color='FFFFFF'>$ratio</font>";
  }
  if ($ratio < 0.5) {
      return "<font color='#fc0313'>$ratio</font>";
  }
  if ($ratio < 1) {
      return "<font color='#fc6203'>$ratio</font>";
  }
  if ($ratio < 1.5) {
      return "<font color='#ebc334'>$ratio</font>";
  }
  if ($ratio < 2) {
      return "<font color='#1a7d09'>$ratio</font>";
  }
  return "<font color='#0d6efd'>$ratio</font>";
}


it seemed a little silly to go up by 0.1 each time so used every 0.5 - header user ratio always same colour so theme needs no edit
made a few edits but is improved https://github.com/M-jay84/M-BiTsy/commit/22e9acf009e73e3f2a20f0705b5508127e42dc32
local tracker — 2022-03-19 11:19:37 in Tutorials
in theory yes the announce has not got anything to do with TT

The client like qbit connects to announce and the announce sends data back to qbit.  The only interactions with TT is the first few lines which i post examples below
Things like config, sql detail, not used qnap or sure what it is lol but i would assume it would need sql & php to operate this way

we are looking for includes, $site_config etc but removing them the file becomes independent


<?php
// no errors allowed you should insert errors into database or text file
error_reporting(0); // error_reporting(E_ALL ^ E_NOTICE);
// no sql details
// require_once("backend/mysql.php");
// no config - search $site_config
// require_once("backend/config.php");
// no sql functions
// require_once("backend/mysql.class.php");

// replace sql connection with your details
$GLOBALS["DBconnector"] = @mysqli_connect('myhost', 'mydbusername', 'mysqlpass') or err('dbconn: mysqli_connect: ' . mysqli_connect_error());
@mysqli_select_db($GLOBALS["DBconnector"],'mysqldbname') or err('dbconn: mysqli_select_db: ' . mysqli_error($GLOBALS["DBconnector"]));

// remove all $site_config
$MEMBERSONLY = true; //$MEMBERSONLY = $site_config["MEMBERSONLY"];
$MEMBERSONLY_WAIT = false; //$MEMBERSONLY_WAIT = $site_config["MEMBERSONLY_WAIT"];


then SQL_Query_exec would need replacing with a default sql function like prepare or query or you could include the sql_class.php and leave the querys has there are
WARNING — 2022-03-17 03:48:35 in v3 Support
Yes just add , 'username'
define('_OWNERS', array('M-jay', 'darkie62', 'anotherstaff'));
WARNING — 2022-03-16 15:53:00 in v3 Support
1) in app/config/config.php add your username to access config
define('_OWNERS', array('M-jay'));


2) delete check.php from the public_html folder

3) to hide the full site from guest in admin only - settings switch Members Only to true (5 row down left side)

👍 thanks for posting, any little improvements like this its best to post so code can up updated - makes updating code much easier in future
Timed VIP — 2022-03-14 17:15:26 in v3 Support
It depends on how you want to do it, mine is linked to seedbonus
X seedbonus for 30 day vip
Small problem — 2022-03-14 17:00:02 in v3 Support
I don't use these but you can try
if ($torrent["silver"] == 1){


Replace with
if ($torrent["silver"] == 1 && $torrent["doubleupload"] != 2){


This means if silver and not double upload run last two updates. If double upload ignore silver.

If silver is more important it would be something like on this line - it depends which is preferred
if ( $torrent["doubleupload"] == 2 && $torrent["silver"] != 1
){

Good to know  😬

Can you post your download.php so I can check it, I'm assuming it's the verify user.
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