Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #11  
Old 28th May 2019, 19:42
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
I am so curious, how did you get the ratio without doing a separate query or a join? Man, tell me. I just gotta know.
Reply With Quote
  #12  
Old 28th May 2019, 20:28
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
so Will someone post code
Reply With Quote
  #13  
Old 28th May 2019, 21:15
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Actually I did. But if you want, you can PM me and I'll walk you through it.

Ok, so I misread the initial post and answered something completely different. I know right, like you have never done that. And before you start, Napon was sorta correct, although he didn't say/show how to do it.

Anyway, here's what you need:

If in browse.php your query does not include it already, you need to get seeders and leechers. Something like this:
browse.php
Code:
$query = "SELECT id, search_text, category, leechers, seeders, bump, release_group, subs, name, times_completed, size, added, poster, descr, type, free, freetorrent, silver, comments, numfiles, filename, anonymous, sticky, nuked, vip, nukereason, newgenre, description, owner, username, youtube, checked_by, IF(nfo <> '', 1, 0) as nfoav," . "IF(num_ratings < {$TBDEV['minvotes']}, NULL, ROUND(rating_sum / num_ratings, 1)) AS rating FROM torrents {$where} {$orderby} {$pager['limit']}";
Then in torrenttable_functions.php if you do not already display those columns, add them like:
torrenttable_functions.php
Code:
<td class='colhead' align='right'>{$lang["torrenttable_seeders"]}</td>
<td class='colhead' align='right'>{$lang["torrenttable_leechers"]}</td>
and then display the data:
Code:
        if ($row["seeders"]) {
            if ($variant == "index") {
                if ($row["leechers"]) $ratio = $row["seeders"] / $row["leechers"];
                else $ratio = 1;
                $What_Script_P = (XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=' );
                $htmlout.= "<td align='right'><b><a href='$What_Script_P"."$id#seeders'><font color='" . get_slr_color($ratio) . "'>" . (int)$row["seeders"] . "</font></a></b></td>\n";
            } else {
                $What_Script_P = (XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=' );
                $htmlout.= "<td align='right'><b><a class='" . linkcolor($row["seeders"]) . "' href='$What_Script_P"."$id#seeders'>" . (int)$row["seeders"] . "</a></b></td>\n";
            }
        } else {
            $htmlout.= "<td align='right'><span class='" . linkcolor($row["seeders"]) . "'>" . (int)$row["seeders"] . "</span></td>\n";
        }
        if ($row["leechers"]) {
            $What_Script_P = (XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=' );
            if ($variant == "index") $htmlout.= "<td align='right'><b><a href='$What_Script_P"."$id#leechers'>" . number_format($row["leechers"]) . "</a></b></td>\n";
            else $htmlout.= "<td align='right'><b><a class='" . linkcolor($row["leechers"]) . "' href='$What_Script_P"."$id#leechers'>" . (int)$row["leechers"] . "</a></b></td>\n";
        } else $htmlout.= "<td align='right'>0</td>\n";
        if ($variant == "index") {
            $htmlout.= "<td align='center'>" . (isset($row["username"]) ? (($row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id']) ? "<i>" . $lang['torrenttable_anon'] . "</i>" : "<a href='userdeta$
        }
This is directly from U-232-V4.

Let the flaming commence.....

Last edited by darkalchemy; 28th May 2019 at 22:18.
Reply With Quote
The Following User Says Thank You to darkalchemy For This Useful Post:
nicukent (26th May 2023)
  #14  
Old 29th May 2019, 21:09
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
This I have just need colors look onemore time a Picture

Click the image to open in full size.
Reply With Quote
  #15  
Old 30th May 2019, 19:50
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
yep looking good on the fonts you add
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 13:24. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.