bigly-chat/docs/stats.php
2025-02-05 01:30:47 -05:00

52 lines
1,001 B
PHP
Executable file

<?php
require(__DIR__ . "/../libs/page.php");
require(__DIR__ . "/../libs/form.php");
require(__DIR__ . "/../libs/comment.php");
function cmp($a, $b)
{
if ($a == $b) {
return 0;
}
return ($a > $b) ? -1 : 1;
}
page_header();
?>
<div>
<a class="form-button" href="?username=<?php echo $username ?>">Local</a>
<a class="form-button" href="?">Global</a>
</div>
<?php
function get_handler()
{
$api = file_get_contents("https://nbg.dervland.net/node/top?ref=" . $_GET['username']);
$pr = json_decode($api);
foreach ($pr as $usern => $rr) { ?>
<div class='comment'>
<div class="avatar">
<img src="/pfp/<?php echo $usern ?>.png" class="avatar-img">
<div>
<div><b>
<a class="link" href="/user.php?id=<?php echo $usern ?>">
<?php echo $usern ?>
</a>
</b>
</div>
</div>
</div>
<div><b>Power</b>: <?php echo $rr ?></div>
</div>
<?php }
}
get_handler();
?>
<?php
page_footer();
?>