|
#11
|
|||
|
|||
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.
|
#12
|
||||
|
||||
so Will someone post code
|
#13
|
|||
|
|||
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']}"; torrenttable_functions.php Code:
<td class='colhead' align='right'>{$lang["torrenttable_seeders"]}</td> <td class='colhead' align='right'>{$lang["torrenttable_leechers"]}</td> 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$ } Let the flaming commence..... Last edited by darkalchemy; 28th May 2019 at 22:18. |
The Following User Says Thank You to darkalchemy For This Useful Post: | ||
nicukent (26th May 2023)
|
#14
|
||||
|
||||
|
#15
|
|||
|
|||
yep looking good on the fonts you add
|
|
|