Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=87)
-   -   Most_Active_Mod (http://www.bvlist.com/showthread.php?t=12601)

hax0r 19th September 2022 10:58

Most_Active_Mod
 
Code:

if($CURUSER)
if (!$site_config["MEMBERSONLY"] || $CURUSER) {
        begin_block(T_("MOST_ACTIVE"));

        $where = "WHERE banned = 'no' AND visible = 'yes'";
        //uncomment the following line to exclude external torrents
        //$where = "WHERE external !='yes' AND banned ='no' AND visible = 'yes'"

        $expires = 600; // Cache time in seconds
        if (($rows = $TTCache->Get("mostactivetorrents_block", $expires)) === false) {
                $res = SQL_Query_exec("SELECT id, name, seeders, leechers FROM torrents ".sqlesc($where)." ORDER BY seeders + leechers DESC, seeders DESC, added ASC LIMIT 10");

                $rows = array();
                while ($row = mysqli_fetch_assoc($res))
                        $rows[] = $row;

                $TTCache->Set("mostactivetorrents_block", $rows, $expires);
        }

        if ($rows) {
                foreach ($rows as $row) {
                                $char1 = 18; //cut length
                                $smallname = htmlspecialchars(CutName($row["name"], $char1));
                                echo "$smallname - [S: " . number_format($row["seeders"]) . " - L: " . number_format($row["leechers"]) . "]\n";
                }

} else {
        print("
".T_("NOTHING_FOUND")."
\n");
}
end_block();
}
?>

/[Font size=48pt]/ Sqlesc added just incase required[/font]:gum:


All times are GMT +2. The time now is 00:47.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.