finish plugin: sticky promotion

This commit is contained in:
xiaomlove
2022-06-08 14:15:59 +08:00
parent 44c750234a
commit 09f6e5b274
62 changed files with 954 additions and 178 deletions

View File

@@ -357,18 +357,14 @@ function docleanup($forceAll = 0, $printProgress = false) {
//4.update count of seeders, leechers, comments for torrents
$torrents = array();
/**
* move to announce request to do this
* @since 1.7.4
*/
// $res = sql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder") or sqlerr(__FILE__, __LINE__);
// while ($row = mysql_fetch_assoc($res)) {
// if ($row["seeder"] == "yes")
// $key = "seeders";
// else
// $key = "leechers";
// $torrents[$row["torrent"]][$key] = $row["c"];
// }
$res = sql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder") or sqlerr(__FILE__, __LINE__);
while ($row = mysql_fetch_assoc($res)) {
if ($row["seeder"] == "yes")
$key = "seeders";
else
$key = "leechers";
$torrents[$row["torrent"]][$key] = $row["c"];
}
$res = sql_query("SELECT torrent, COUNT(*) AS c FROM comments GROUP BY torrent") or sqlerr(__FILE__, __LINE__);
while ($row = mysql_fetch_assoc($res)) {