17th August 2021, 19:37
|
Senior Member
|
|
Join Date: Oct 2020
Posts: 66
|
|
Quote:
Originally Posted by budgie
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.
|