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

"shadows, post: 68547, member: 20311":

A lightweight script which I wrote today (Works with modern and older browsers IE 6+). You can create a new .JS, .PHP, and .CSS file to separate those, but I was lazy to do so, so here goes all together.

To include more data, you can change the line: [ICODE]$response .= '<div class="results"><a href="/torrents-details.php?id=' . $i['id'] . '">' . $i['name'] . '</a></div>';[/ICODE]
The hard limit is that search query must have at least 4 characters (to avoid db stressing)

To do a quick test, create a new test.php file

<?php
include 'backend/functions.php';
dbconn();

// This is the PHP side ajax check
if (isset($_GET['ajax']) && $_GET['ajax'] === '1')
{
   if ($_SERVER['REQUEST_METHOD'] === 'POST')
   {
       $searchstr = strtolower(trim($_POST["query"]));
       $search = "MATCH (torrents.name) AGAINST ('".mysqli_real_escape_string($GLOBALS["DBconnector"],$searchstr)."' IN BOOLEAN MODE)";
       if (!empty($_POST["query"]) && strlen($_POST["query"]) >= 4)
       {
           // You can JOIN tables here to get more information about torrents. (But will affect performance)
           $stmt = SQL_Query_exec("SELECT * FROM torrents WHERE $search LIMIT 10");
           $row = mysqli_fetch_assoc($stmt);
       }
   }

   echo '<div class="ls_box">
<div style="text-align: center;border-bottom: 1px solid #eee;padding-bottom: 5px;">Found results for <span style="color: #e6750c; ">' . $_POST['query'] . '</span></div>';
   if ($row)
   {
       $response = '';
       foreach ($stmt as $i)
       {
           $response .= '<div class="results"><a href="/torrents-details.php?id=' . $i['id'] . '">' . $i['name'] . '</a></div>';
       }
   }
   else
   {
       $response = '<div class="results">No results found</div>';
   }
   echo $response;
   echo '</div>';
   die;
}

stdhead('ajax search');
begin_frame('ajax search');
?>

Search torrents: <input type="text" onkeyup="ajaxSearch(this.value)" name="query" />
<div id="ajaxSearchStatus"></div>

<style>
   .ls_box {
       position: absolute;
       background: #fff;
       width: 20%;
       border-bottom: 0;
       border-radius: 10px;
       padding: 10px;
       box-shadow: 0 1px 4px rgba(0,0,0,.1);
       font-weight: bold;
   }
   .results {
       border-bottom: 1px solid #eee;
       padding: 5px;
       word-wrap: break-word;
   }
   .results a {
       color: #111;
       text-decoration: none;
   }
   .results a:hover {
       color: #333;
   }
   .results:hover {
       background: #e6750c3b;
       border-right: 2px solid #e6750c;
   }
</style>

<script type="text/javascript">
   function ajaxSearch(str)
   {
       var xhttp;
       if (str.length < 4) {
           document.getElementById("ajaxSearchStatus").innerHTML= '';
           return false;
       }
       // Modern browser support
       if (window.XMLHttpRequest)
       {
           xhttp = new XMLHttpRequest();
       }
       // Old browser support (IE 6+)
       else
       {
           xhttp = new ActiveXObject("Microsoft.XMLHTTP");
       }
       var url = '?ajax=1';
       var params = 'query=' + str;
       xhttp.open("POST", url, true);

       // Send the proper header information along with the request
       xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

       // What to do with the response
       xhttp.onreadystatechange = function()
       {
           if (this.readyState === 4 && this.status === 200)
           {
               document.getElementById("ajaxSearchStatus").innerHTML = this.responseText;
           }
       };
       // Send the post fields
       xhttp.send(params);
       // Until data returned, show custom text
       document.getElementById("ajaxSearchStatus").innerHTML = '<div class="ls_box">Loading data...</div>';
   }
</script>
<?php
end_frame();
stdfoot();


Preview:


thanks you!

he finds nothing at home, thank you for your help.

<?php
require_once('backend/functions.php');
dbconn();

// This is the PHP side ajax check
if (isset($_GET['ajax']) && $_GET['ajax'] === '1')
{
   if ($_SERVER['REQUEST_METHOD'] === 'POST')
   {
       $searchstr = strtolower(trim($_POST["query"]));
       $search = "MATCH (torrents.name) AGAINST ('".mysqli_real_escape_string($GLOBALS["DBconnector"],$searchstr)."' IN BOOLEAN MODE)";
       if (!empty($_POST["query"]) && strlen($_POST["query"]) >= 4) //4 characters minum (to avoid db stressing)
       {
           // You can JOIN tables here to get more information about torrents. (But will affect performance)
           $stmt = SQL_Query_exec("SELECT * FROM torrents WHERE $search LIMIT 10");
           $row = mysqli_fetch_assoc($stmt);
       }
   }

   echo '<div class="ls_box">
<div style="text-align: center;border-bottom: 1px solid #B2B2B2;padding-bottom: 5px;color:#222;">Résultats trouvés pour <span style="color: blue; ">' . $_POST['query'] . '</span></div>';
   if ($row)
   {
       $response = '';
       foreach ($stmt as $x)
       {
           $response .= '<div class="results"><a href="/torrents-details.php?id=' . $x['id'] . '">' . $x['name'] . '</a></div>';
       }
   }
   else
   {
       $response = '<div class="results" style="cOlor:black;"><i>...Aucun Résultat Trouvé!</i></div>';
   }
   echo $response;
   echo '</div>';
   die;
}

stdhead('ajax search');
begin_frame('ajax search');
?>

Rechercher des torrents: <input type="text" onkeyup="ajaxSearch(this.value)" name="query" />
<div id="ajaxSearchStatus"></div>

<style>
   .ls_box {
       position: absolute;
       background: #fff;
       width: 20%;
       border-bottom: 0;
       border-radius: 10px;
       padding: 10px;
       box-shadow: 0 1px 4px rgba(0,0,0,.1);
       font-weight: bold;
   }
   .results {
       border-bottom: 1px solid #eee;
       padding: 5px;
       word-wrap: break-word;
   }
   .results a {
       color: #111;
       text-decoration: none;
   }
   .results a:hover {
       color: #333;
   }
   .results:hover {
       background: #e6750c3b;
       border-right: 2px solid #e6750c;
   }
</style>

<script type="text/javascript">
   function ajaxSearch(str)
   {
       var xhttp;
       if (str.length < 4) {
           document.getElementById("ajaxSearchStatus").innerHTML= '';
           return false;
       }
       // Modern browser support
       if (window.XMLHttpRequest)
       {
           xhttp = new XMLHttpRequest();
       }
       // Old browser support (IE 6+)
       else
       {
           xhttp = new ActiveXObject("Microsoft.XMLHTTP");
       }
       var url = '?ajax=1';
       var params = 'query=' + str;
       xhttp.open("POST", url, true);

       // Send the proper header information along with the request
       xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

       // What to do with the response
       xhttp.onreadystatechange = function()
       {
           if (this.readyState === 4 && this.status === 200)
           {
               document.getElementById("ajaxSearchStatus").innerHTML = this.responseText;
           }
       };
       // Send the post fields
       xhttp.send(params);
       // Until data returned, show custom text
       document.getElementById("ajaxSearchStatus").innerHTML = '<div class="ls_box">Chargement des données...</div>';
   }
</script>
<?php
end_frame();
stdfoot();


Hello
I install on account-details and on the torrent uploader when I choose another page it returns me on detail and does not take my choice of page

Thank you for your help.

[ATTACH type="full" alt="Capt3ure.PNG"]5537[/ATTACH]


// start id3
echo "<div id=id3 style=display:none;>";
   #begin_frame(T_("UPLOADED_TORRENTS"));
   //page numbers
   $page = (int) $_GET["page"];
   $perpage = 25;
   $where = "";
   if ($CURUSER['control_panel'] != "yes")
   $where = "AND anon='no'";
   $res = SQL_Query_exec("SELECT COUNT(*) FROM torrents WHERE owner='$id' $where");
   $row = mysqli_fetch_array($res);
   $count = $row[0];
   unset($where);

   $orderby = "ORDER BY id DESC";

   //get sql info
   if ($count) {
       list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "account-details.php?id=$id&amp;");
       $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.tube, torrents.tube2, torrents.sticky, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, torrents.anon, torrents.uplreq, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.announce FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE owner = $id $orderby $limit";
       $res = SQL_Query_exec($query);
   }else{
       unset($res);
   }

   if ($count) {
       print($pagertop);
       torrenttable($res);
       print($pagerbottom);
   }else {
       print("<b>".T_("UPLOADED_TORRENTS_ERROR")."</b><br />");
   }

   #end_frame();
}
echo "</div>";
// end id3
I don't want to be negative, but for trying to do what you want to do, is that there is far too much modification to the block and frame code for various reasons.
New login js — 2020-05-09 15:12:57 in M-BiTsy Support
It works, but I recommend that you create your own frame on the block.php file of your theme for which can be more fluid

A quick example [url='https://www.crazyspirits.com/test/account-login.php?returnto=%2Ftest%2F']here[/url]
(there will be adjustments to your attributes which must be readjusted)

That's the procedure::

Add your css folder to your theme and add lines to your header.php before the tag </head>

<!-- Css new look login-->
<link rel="stylesheet" href="<?php echo $site_config["SITEURL"]; ?>/themes/default/css/normalize.css">
<link rel="stylesheet" href="<?php echo $site_config["SITEURL"]; ?>/themes/default/css/style.css">



<!-- New look login -->
<script type="text/javascript" src="<?php echo $site_config["SITEURL"]; ?>/js/prefixfree.min.js"></script>


add prefixfree.min.js to your js folder at the root of the site
([color=rgb(209, 72, 65)]ATTENTION:[/color] change the name of your theme)


In block.php find your frame and add your attribute name fade-box:

//BEGIN FRAME
function begin_frame($caption = "-", $align = "justify"){
   global $THEME, $site_config;
 
   $blockId = 'f-' . sha1($caption);
   print("<div id='fade-box'><div class='myFrame'>
       <div class='myFrame-caption'>$caption<a style='float:right; clear:right;' href='#' class='showHide' id='$blockId'></a></div>
       <div class='myFrame-content'>
       <div class='slidingDiv$blockId'>");
}


//END FRAME
function end_frame() {
   global $THEME, $site_config;
   print("</div></div>
       <div class='myFrame-foot'></div>
     </div></div>
     <br />");
}
New login js — 2020-05-09 14:03:35 in M-BiTsy Support
"phoenix75, post: 68532, member: 1185":

this is new login js

ps:hello spiritblue could you improve it ?


Hello  phoenix 75
probably I can integrate it in BDD of ttv3 and in the theme
I will test all of this on my test server and I will get back to you with that
Session Mod [TTv3] — 2020-05-09 13:34:12 in v3 Mods Completed
"m-jay, post: 68460, member: 20288":

This mod is complete in that it does what it is intended to do  ?
Ive placed in progress because it might need some fine tuning now we use the database for sessions its more secure but also we can start playing with the data, this is where testing will help the cleanup for example you could wipe tables on cleanups.
The base mod has two session uid (user id) & pass (hashed password, id, ip, secret) again this is somewhere things can be added

Members can login with session which closes when browser close
[ATTACH type="full" alt="session.png"]5490[/ATTACH]

Members can click remember for session login cookie which last 1 month
[ATTACH type="full" alt="cookie.png"]5491[/ATTACH]

if anyone plays with this can you please share any work or examples

sql


create table sessions(
 id serial,
 sess_id text not null,
 _access integer,
 data text,
 primary key (id)
);


in account-login.php find


           $password = $_POST['password'];


add below


           $testing = $_POST['rememberme'];


find


           if (!$message){


replace that old code with this (just after show error)


           if (!$message){
               // Session Handler
               setsess($row["id"], $row["password"], $row["secret"]);
               if( isset($_POST['rememberme']) ){                
                   logincookie($row["id"], $row["password"], $row["secret"]);
                   setsess($row["id"], $row["password"], $row["secret"]);
               }
               header("Location: index.php");
              }else {
                 show_error_msg(T_("ACCESS_DENIED"), $message, 1);
              }


find


<tr><td align="center"><b><?php echo T_("PASSWORD"); ?>:</b> <input type="password" size="40" name="password" /></td></tr>


add below


       <tr><td align="center"><input type="checkbox" name="rememberme" value="rememberme" />&nbsp;Remember Me</td></tr>
 

in account-logout.php find


deconn();


add under


       // Remove cookies & sessions
       session_destroy();



in functions.php replace logincookie & logout cookie with

// Obtain / Create session Cookie Function
function logincookie($id, $password, $secret, $updatedb = 1, $expires = 0x7fffffff)
{
   // get sess_id
   $sid = session_id();
   // store only sess_id
   setcookie("PHPSESSID", $sid, time()+ 30*30*60*60, "/"); // one month
   // maybe add session in cleanup
   if ($updatedb) {
       SQL_Query_exec("UPDATE users SET last_login = '".get_date_time()."' WHERE id = $id");
   }
}

// Cookie Destruction function
function logoutcookie()
{
   // get sess_id
   $sid = session_id();
   // reset cookie to session
   setcookie("PHPSESSID", $sid, "0", "/");
}

function setsess($id, $password, $secret)
{
   // encrypt pass
   $hash = $id . $secret . $password . getip() . $secret;
   // set session handler
   $_SESSION['uid'] = $id;
   $_SESSION['pass'] = $hash;
}


find


function dbconn($autoclean = false){


add under

   // Session Handler
   require "classes/Session.php";

[/code]

now the userlogin function for auth

   // Check The Cookies and Sessions details
   if (!$_SESSION["pass"] || !is_numeric($_SESSION["uid"])) {     // todo
       logoutcookie();
       return;
   }

   //Get User Details And Permissions
   $res = SQL_Query_exec("SELECT * FROM users INNER JOIN groups ON users.class=groups.group_id WHERE id=$_SESSION[uid] AND users.enabled='yes' AND users.status = 'confirmed'");
   $row = mysqli_fetch_assoc($res);

   $hash = $row["id"] . $row["secret"] . $row["password"] . $ip . $row["secret"];
   if (!$row || !$_SESSION['pass'] == $hash){
           logoutcookie();
       return;
   
   } else {
   // success - need else to match hash & session above
   }


Session.php  (the class)

<?php
 class Session {
   private $pdo;

   public function connect() {
     global $site_config;
     // create a db connection
     $pdo = new PDO('mysql:host='.$site_config['mysql_host'].';dbname='.$site_config['mysql_db'], $site_config['mysql_user'], $site_config['mysql_pass']);
       return $pdo;
   }

   public function _open() {
     $this->pdo = Session::connect();
     if ($this->pdo) {
       return true;
     }
     else {
       return false;
     }
   } // end function _open()

   public function _close() {
     $this->pdo = null;
     return true;
   } // end function _close()

   public function _read($sess_id) {
     if (!$this->pdo) {
       $this->pdo = Session::connect();
     }
     $sql = "select data from sessions where sess_id=:sess_id";
     $statement = $this->pdo->prepare($sql);
     $statement->execute(array(':sess_id' => $sess_id));
     $num = $statement->rowCount();
     if ($num == 1) {
       $row = $statement->fetch(PDO::FETCH_ASSOC);
       $data = $row["data"];
       return $data;
     }
     else {
       return '';  //  return empty string if no data returned
     }
   } // end function _read()

   public function _write($sess_id,$data) {
     $access = time();
     $sql = "select * from sessions where sess_id=:sess_id";
     $statement = $this->pdo->prepare($sql);
     $statement->execute(array(':sess_id' => $sess_id));
     $num = $statement->rowCount();
     if ($num === 0) {
       $sql = "insert into sessions (sess_id, _access, data) values ".
         "(:sess_id,:access,:data)";
       $statement2 = $this->pdo->prepare($sql);
       $myArray = array();
       $myArray[':sess_id'] = $sess_id;
       $myArray[':access'] = $access;
       $myArray[':data'] = $data;
       $statement2->execute($myArray);
       if ($statement2 === false) {
         return false;
       }
       else {
         // new data stored
         return true;
       }
     } // end case of inserting new session data
     else {
       $sql = "update sessions set _access = :access, " .
         "data = :data where sess_id = :sess_id";
       $statement2 = $this->pdo->prepare($sql);
       $myArray = array();
       $myArray[':sess_id'] = $sess_id;
       $myArray[':access'] = $access;
       $myArray[':data'] = $data;
       $statement2->execute($myArray);
       if ($statement2 === false) {
         return false;
       }
       else {
         // data updated
         return true;
       }
     } // end case of updating existing record
   } // end function _write()

   public function _destroy($sess_id) {
     $sql= "delete from sessions where sess_id=:id";
     $statement = $this->pdo->prepare($sql);
     $statement->execute(array(':id' => $sess_id));
     if ($statement === true) {
       return true;
     }
     else {
       return false;
     }
   } // end function _destroy()

   public function _gc($max) {
     $old = time() - $max;
     $sql = "delete from sessions where _access < :old";
     $statement = $this->pdo->prepare($sql);
     $statement->execute(array(':old' => $old));
     if ($statement === true) {
       return true;
     }
     else {
       return false;
     }
   } // end function _gc
 }
 $sess = new Session();
 session_set_save_handler(
   array($sess,'_open'),
   array($sess,'_close'),
   array($sess,'_read'),
   array($sess,'_write'),
   array($sess,'_destroy'),
   array($sess,'_gc')
   );
 register_shutdown_function('session_write_close');
 /*
 // change php.ini
 ini_set('session.cookie_lifetime', 60 * 60 * 24 * 90); // 3months
 ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 90); // 3 months
 */
 // start
 session_start();
?>






   // Check The Cookies and Sessions details
   if (!$_SESSION["pass"] || !is_numeric($_SESSION["uid"])) {     // todo
       logoutcookie();
       return;
   }

   //Get User Details And Permissions
   $res = SQL_Query_exec("SELECT * FROM users INNER JOIN groups ON users.class=groups.group_id WHERE id=$_SESSION[uid] AND users.enabled='yes' AND users.status = 'confirmed'");
   $row = mysqli_fetch_assoc($res);

   $hash = $row["id"] . $row["secret"] . $row["password"] . $ip . $row["secret"];
   if (!$row || !$_SESSION['pass'] == $hash){
           logoutcookie();
       return;
   
   } else {
   // success - need else to match hash & session above
   }

First, thank you and then I would like to know
Or do you place this line ?
You had a lot of time to waste! ?
"STorrents2020, post: 68518, member: 20382":

just personal preference, the last mod I posted I’ve corrected all tags before post

ha ok! (y) ;)
no,  the beginning of your page with <? is written without php
for the file of the name of ajax_checkusername.php :)
[ATTACH type="full"]5499[/ATTACH]
Question:
why your page entry is not in ?
Example(ajax_checkusername.php):  <? php
ok thanks,
[ATTACH type="full" alt="Capture.PNG"]5498[/ATTACH]

[ATTACH type="full" alt="Capture2.PNG"]5497[/ATTACH]

first PDO that works for me with this config (y) ? ?

Version Mysql: 10.3.22-MariaDB-log-cll-lve
Version PHP: 7.3.17
I wanted a picture of the result
hi STorrents2020

first a big thank you for this hack and you can see the result on an image?

Thanks you!
thank you it works very well ? (y)
Cheat on download — 2020-05-02 11:40:15 in v3 Support
Hello
I would like to point out to all a major problem and not just on the td bdd but also on another tracker bdd on the web

let me explain:
he uses this program here
after download and complete at 1% you delete the annouce with ca passkey and you can complete when mem your download and there will be no ratio or torrent to complete on the tracker.

this system has been tested on sites like ethor.net, crazyspirits.com, yts.mx, torrent411.li, etc.
would you be able to create a code to prevent its?

thank you very much for your support
[READ] Banned Clients — 2020-05-01 18:34:23 in General Chat
Hi
install this to allow you to have the correct client code to ban (y)

[url='https://www.torrenttrader.xyz/index.php?threads/show-torrent-clients-in-acp-ttv3.9743/']HERE[/url]
"shadows, post: 68160, member: 20311":

jackett is a very powerful application and is maintained daily by their staff
[URL unfurl="true"]https://github.com/Jackett/Jackett[/url]

Users make scripts which will automate access to your torrent site, but yes it will eat your resources if  you do not protect your site against it.

PS: I use jackett and contribute to it.

thanks, but I had to change the server even if installing them still had error 508

thank you for your reply ? (y)
Hi

For those who have the male with the blink tag and you are looking for a simple solution that works well  ?

Add to your themes.css of your theme (s) :

/* Flash text by spiritblue */
#flash{
   animation: Test 3s infinite;  /* Speed in seconds */
}
@keyframes Test{
   0%{opacity: 1;}
   50%{opacity: 0;}
   100%{opacity: 1;}
}


Link of your attributes (id) :
<div id="flash"> TESTING </div>


[color=rgb(44, 130, 201)]Here ![/color][color=rgb(44, 130, 201)] hope you find it useful just like me[/color][color=rgb(44, 130, 201)]  (y)[/color]
Big thanks ! ?
"STorrents2020, post: 68344, member: 20382":

Pay attention to the error. Confirm your database details. Do you have mysql_pdo installed? I should of added checks...

ok,  pm;)

this mod should not be in this selection
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: 10

  • Online

  • Total online: 4
  • Members: 1
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728