Skip to content

Commit

Permalink
feat(站点数据): 增加断种率数据
Browse files Browse the repository at this point in the history
  • Loading branch information
tongyifan committed Jul 11, 2019
1 parent bb71cff commit b5cde50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ function srt($a, $b)
$Cache->add_whole_row();
$torrents = number_format(get_row_count("torrents"));
$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));
if ($torrents == 0) {
$dead_rate = 0;
} else {
$dead_rate = round($dead / $torrents * 100, 1);
}
$seeders = get_row_count("peers", "WHERE seeder='yes'");
$leechers = get_row_count("peers", "WHERE seeder='no'");
if ($leechers == 0)
Expand All @@ -532,7 +537,7 @@ function srt($a, $b)
<tr>
<?php
twotd($lang_index ['row_torrents'], $torrents);
twotd($lang_index ['row_dead_torrents'], $dead);
twotd($lang_index ['row_dead_torrents'], $dead . "({$dead_rate}%)");
?>
</tr>
<tr>
Expand Down

0 comments on commit b5cde50

Please sign in to comment.