Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 17th August 2021, 12:31
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default TorrentBar For TorrentTrader
Tsted on TorrentTrader-2.08-FINAL.

HOW TO INSTALL:
Just unzip the file in attachment in your site root.

URLs working:
PREWVIEW:
Click the image to open in full size.

================================================== =========================

account.php

After this line:
Code:
<?php print("<b>".T_("IP").":</b> " . $CURUSER["ip"] . "\n"); ?><br />
Add this code:
Code:
<?php print("<img src='torrentbar/bar.php/".$CURUSER['id'].".png'>"); ?><br />
PREVIEW:
Click the image to open in full size.

================================================== =========================

account-details.php

After this line:
Code:
Forum Posts: <?php echo number_format($numforumposts); ?><br />
Add this code:
Code:
<?php echo "<img src='torrentbar/bar.php/".$id.".png'>"; ?><br />
PREVIEW:
Click the image to open in full size.

================================================== =========================
Attached Thumbnails
preview.png   preview2.png  
Attached Images
 
Attached Files
File Type: zip torrentbar.zip (21.0 KB, 10 views)

Last edited by hon; 17th August 2021 at 12:51.
Reply With Quote
  #2  
Old 17th August 2021, 13:01
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Thumbs down
its old time code not myqsli so how trys this on mysqli not work
Reply With Quote
  #3  
Old 17th August 2021, 13:08
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default
Quote:
Originally Posted by budgie View Post
its old time code not myqsli so how trys this on mysqli not work
@budgie:

on all posts today you are saying the same thing.

bot?
__________________
TorrentTrader4Ever

If you want help about TorrentTrader send me a PM.
Reply With Quote
  #4  
Old 17th August 2021, 13:12
papad's Avatar
papad papad is offline
Administrator
 
Join Date: Feb 2013
P2P
Posts: 146
Default
Quote:
Originally Posted by hon View Post
@budgie:

on all posts today you are saying the same thing.

bot?
No, he is not a bot hon, it's just something to expect.
Reply With Quote
  #5  
Old 17th August 2021, 13:15
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default
ok

look here this version of torrent trader working

https://www.bvlist.com/showthread.php?t=12410
__________________
TorrentTrader4Ever

If you want help about TorrentTrader send me a PM.
Reply With Quote
  #6  
Old 17th August 2021, 16:54
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Thumbs down
i beg to differ its not mysqli coding at all mysql

PHP 4.4 TESTED -- OK
PHP 5.1 TESTED -- OK
PHP 5.6 TESTED -- OK
PHP 7.1 TESTED -- OK
PHP 7.2 TESTED -- OK
PHP 7.3 TESTED -- OK

from down is mysqli

PHP 5.6 TESTED -- OK
PHP 7.1 TESTED -- OK
PHP 7.2 TESTED -- OK
PHP 7.3 TESTED -- OK

also its known in the cleanup this part not working on home torrents on mysqli and mysql

Code:
	//LOCAL TORRENTS - GET PEERS DATA AND UPDATE BROWSE STATS
	//DELETE OLD NON-ACTIVE PEERS
    $deadtime = get_date_time(gmtime() - $site_config['announce_interval']);
    SQL_Query_exec("DELETE FROM peers WHERE last_action < '$deadtime'");

	$torrents = array();
	$res = SQL_Query_exec("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");
	while ($row = mysql_fetch_assoc($res)) {
		if ($row["seeder"] == "yes")
			$key = "seeders";
		else
			$key = "leechers";
		$torrents[$row["torrent"]][$key] = $row["c"];
	}

	$res = SQL_Query_exec("SELECT torrent, COUNT(torrent) as c FROM comments WHERE torrent > 0 GROUP BY torrent");
	while ($row = mysql_fetch_assoc($res)) {
		$torrents[$row["torrent"]]["comments"] = $row["c"];
	}

	$fields = explode(":", "comments:leechers:seeders");
	$res = SQL_Query_exec("SELECT id, external, seeders, leechers, comments FROM torrents WHERE banned = 'no'");
	while ($row = mysql_fetch_assoc($res)) {
		$id = $row["id"];
		$torr = $torrents[$id];
		foreach ($fields as $field) {
			if (!isset($torr[$field]))
				$torr[$field] = 0;
		}
		$update = array();
		foreach ($fields as $field) {
			if ($row["external"] == "no" || $field == "comments") {
				if ($torr[$field] != $row[$field])
					$update[] = "$field = " . $torr[$field];
			}
		}
		if (count($update))
			SQL_Query_exec("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id");
	}
basically it telling the database the update is locking the torrent table up till clean up done there be no home nor seedbox working torrents
Reply With Quote
  #7  
Old 17th August 2021, 19:37
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default
Quote:
Originally Posted by budgie View Post
i beg to differ its not mysqli coding at all mysql

PHP 4.4 TESTED -- OK
PHP 5.1 TESTED -- OK
PHP 5.6 TESTED -- OK
PHP 7.1 TESTED -- OK
PHP 7.2 TESTED -- OK
PHP 7.3 TESTED -- OK

from down is mysqli

PHP 5.6 TESTED -- OK
PHP 7.1 TESTED -- OK
PHP 7.2 TESTED -- OK
PHP 7.3 TESTED -- OK

also its known in the cleanup this part not working on home torrents on mysqli and mysql

Code:
	//LOCAL TORRENTS - GET PEERS DATA AND UPDATE BROWSE STATS
	//DELETE OLD NON-ACTIVE PEERS
    $deadtime = get_date_time(gmtime() - $site_config['announce_interval']);
    SQL_Query_exec("DELETE FROM peers WHERE last_action < '$deadtime'");

	$torrents = array();
	$res = SQL_Query_exec("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");
	while ($row = mysql_fetch_assoc($res)) {
		if ($row["seeder"] == "yes")
			$key = "seeders";
		else
			$key = "leechers";
		$torrents[$row["torrent"]][$key] = $row["c"];
	}

	$res = SQL_Query_exec("SELECT torrent, COUNT(torrent) as c FROM comments WHERE torrent > 0 GROUP BY torrent");
	while ($row = mysql_fetch_assoc($res)) {
		$torrents[$row["torrent"]]["comments"] = $row["c"];
	}

	$fields = explode(":", "comments:leechers:seeders");
	$res = SQL_Query_exec("SELECT id, external, seeders, leechers, comments FROM torrents WHERE banned = 'no'");
	while ($row = mysql_fetch_assoc($res)) {
		$id = $row["id"];
		$torr = $torrents[$id];
		foreach ($fields as $field) {
			if (!isset($torr[$field]))
				$torr[$field] = 0;
		}
		$update = array();
		foreach ($fields as $field) {
			if ($row["external"] == "no" || $field == "comments") {
				if ($torr[$field] != $row[$field])
					$update[] = "$field = " . $torr[$field];
			}
		}
		if (count($update))
			SQL_Query_exec("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id");
	}
basically it telling the database the update is locking the torrent table up till clean up done there be no home nor seedbox working torrents

It's MySQL and not MySQLi but working on all php versions if you want I can send you and the MySQLi version but versions before php 5.6 won't work.
__________________
TorrentTrader4Ever

If you want help about TorrentTrader send me a PM.
Reply With Quote
  #8  
Old 17th August 2021, 19:45
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Default
yep send me it love to check it put
Reply With Quote
  #9  
Old 17th August 2021, 19:57
hon hon is offline
Senior Member
 
Join Date: Oct 2020
P2P
Posts: 66
Default
Quote:
Originally Posted by budgie View Post
yep send me it love to check it put
MySQLi File in attachment:)
Just replace MySQL.class.php and functions.php in backend folder

Bump:
Attached Files
File Type: php mysql.class.php (3.5 KB, 2 views)
File Type: php functions.php (46.1 KB, 2 views)
__________________
TorrentTrader4Ever

If you want help about TorrentTrader send me a PM.
Reply With Quote
  #10  
Old 17th August 2021, 20:04
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Thumbs down
Code:
<?php
//
//  TorrentTrader v2.x
//  MySQL wrapper
//  Author: TorrentialStorm
//
//    $LastChangedDate: 2012-08-11 11:34:43 +0100 (Sat, 11 Aug 2012) $
//
//    http://www.torrenttrader.org
##    Modified by hon and changed from MySQL to MySQLi
//
//

function &SQL_Query ($query) {
	return new SQL_Query ($query);
}

function &SQL_Query_exec ($query) {
	$sql = new SQL_Query ($query);
	return $sql->execute();
}

class SQL_Query {
	private $query = "";
	private $params = array();

	function &__construct ($query) {
		$this->query = $query;
		return $this;
	}

	function &p ($param) {
		if (is_numeric($param)) {
			$this->params[] = $param;
		} elseif (is_array($param)) {
			$this->params[] = implode(", ", array_map(array(&$this, "escape"), $param));
		} else {
			$this->params[] = $this->escape($param);
		}
		return $this;
	}

	function &p_name ($param) {
		$this->params[] = "`".$mysqli->real_escape_string($param)."`";
		return $this;
	}

	function escape ($s) {
		if (is_numeric($s))
			return $s;
		return "'".$mysqli->real_escape_string($s)."'";
	}

	function read () {
		$ret = "";
		if (count($this->params)) {
			reset($this->params);
			for ($i = 0; $i < strlen($this->query); $i++) {
				if ($this->query[$i] == "?") {
					list(, $val) = each($this->params);
					$ret .= $val;
				} else {
					$ret .= $this->query[$i];
				}
			}
			reset($this->params);
		} else {
			$ret = $this->query;
		}
		return $ret;
	}

	function &execute () {
		$query = $this->read();
		$res = $mysqli->query($query);

		if ($res || $mysqli->errno == 1062) {
			return $res;
		}
		$mysql_error = $mysqli->error;
		$mysql_errno = $mysqli->errno;

		// If debug_backtrace() is available, we can find exactly where the query was called from
		if (function_exists("debug_backtrace")) {
			$bt = debug_backtrace();

			$i = 1;

			if ($bt[$i]["function"] == "SQL_Query_exec_cached" || $bt[$i]["function"] == "get_row_count_cached" || $bt[$i]["function"] == "get_row_count")
				$i++;

			$line = $bt[$i]["line"];
			$file = str_replace(getcwd().DIRECTORY_SEPARATOR, "", $bt[$i]["file"]);
			$msg = "Database Error in $file on line $line: $mysql_error. Query was: $query.";
		} else {
			$file = str_replace(getcwd().DIRECTORY_SEPARATOR, "", $_SERVER["SCRIPT_FILENAME"]);
			$msg = "Database Error in $file: $mysql_error. Query was: $query";
		}
        
        $mysqli->query("INSERT INTO `sqlerr` (`txt`, `time`)
                     VALUES (".sqlesc($msg).", '".get_date_time()."')");

        if ( function_exists('show_error_msg') )
		     show_error_msg("Database Error", "Database Error. Please report this to an administrator.", 1);
	}
}

/* Example Usage:

// Note: Any values passed to p() or p_name() MUST NOT be escaped, this will be done internally.
// for p() arrays are also taken and imploded with , for use in IN(...)
// p_name() is for field/table names
// p() is for where conditions, insert/update values, etc...

$ids = range(1, 10);
//$res = SQL_Query("SELECT `id`, `username` FROM `users` WHERE ? IN (?) ORDER BY ? ASC")->p_name("id")->p($ids)->p_name("id")->execute();

$q = SQL_Query("SELECT `id`, `username` FROM `users` WHERE ? IN (?) ORDER BY ? ASC")->p_name("id")->p($ids)->p_name("id");

echo "Query: ".$q->read()."\n";
$res = $q->execute();

while ($row = $res->fetch_array()) {
	echo "$row[id] - $row[username]\n";
}

// Trigger a SQL error to test logging
SQL_Query("SELECT")->execute();
*/
?>
Its not mysqli needs PDO as from what i can see not very good at all and the rest of the files to go with this well all the code Lol
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 15:49. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.