seria/public/_header.php
2022-07-03 23:44:11 +00:00

52 lines
2.4 KiB
PHP

<?php
if($_SERVER['SCRIPT_FILENAME'] === __FILE__)
die('no');
if(empty($tPageTitle))
$tPageTitle = SERIA_FLASHII . ' Tracker';
else
$tPageTitle = $tPageTitle . ' :: ' . SERIA_FLASHII . ' Tracker';
$isLoggedIn = $sUserInfo->isLoggedIn();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title><?=$tPageTitle;?></title>
<link href="/seria.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div class="wrapper">
<nav class="header">
<?php
if($isLoggedIn):
$hTransferCount = $sUserInfo->getActiveTransferCounts();
$hTransferRatio = $sUserInfo->calculateRatio();
?>
<div class="header-stats">
<a href="/profile.php?name=<?=$sUserInfo->getName();?>"><?=$sUserInfo->getName();?></a>
&nbsp;&#183;&nbsp; <a href="/history.php">R:&nbsp; <span style="color: <?=seria_ratio_colour($hTransferRatio);?>;"><?=number_format($hTransferRatio, 3);?></span></a>
&nbsp;&#183;&nbsp; <a href="/history.php?filter=uploaded"><span style="color: green;">U:</span>&nbsp; <?=byte_symbol($sUserInfo->getBytesUploaded());?></a>
&nbsp;&#183;&nbsp; <a href="/history.php?filter=downloaded"><span style="color: red;">D:</span>&nbsp; <?=byte_symbol($sUserInfo->getBytesDownloaded());?></a>
&nbsp;&#183;&nbsp; <a href="/history.php?filter=uploading"><span style="color: green;">&#8593;</span>&nbsp; <?=number_format($hTransferCount->user_uploading);?></a>
&nbsp;&#183;&nbsp; <a href="/history.php?filter=downloading"><span style="color: red;">&#8595;</span>&nbsp; <?=number_format($hTransferCount->user_downloading);?></a>
</div>
<?php endif; ?>
<div class="header-logo"><a href="/"><?=SERIA_FLASHII;?> Tracker</a></div>
<div class="header-menu">
<?php if(!$isLoggedIn): ?>
<a href="<?=SERIA_CAUTH_LOGIN;?>">Log in</a>
<?php else: ?>
<a href="/settings.php">Settings</a>
<?php endif; ?>
<a href="/available.php">Available Downloads</a>
<?php if($sUserInfo->canCreateTorrents()): ?>
<a href="/create.php">Create Torrent</a>
<?php endif; ?>
<?php if($sUserInfo->canApproveTorrents()): ?>
<a href="/pending.php">Pending Torrents</a>
<?php endif; ?>
</div>
</nav>
<div class="wrapper-body">