Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev
Reply
  #11  
Old 28-05-19, 19:42
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 87
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.
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
  #12  
Old 28-05-19, 20:28
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 112
Default
so Will someone post code
Reply With Quote
  #13  
Old 28-05-19, 21:15
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 87
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.....
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.

Last edited by darkalchemy; 28-05-19 at 22:18.
Reply With Quote
  #14  
Old 29-05-19, 21:09
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 112
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 30-05-19, 19:50
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 389
Default
yep looking good on the fonts you add
__________________
https://uploadfiles.io/lgekz
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 20:44. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.