tildechan/core/header.php

66 lines
1.4 KiB
PHP

<?php
function display_header($title = "~chan") {
// Load in display variables
$title = $title ?? '~chan';
// Start handing session stuff
session_start();
?>
<!--
# - # - # - # - # - # - # - # - # - # - # - # - # - # - #
# #
# tildechan #
# - #
# by ~stilbruch #
# - #
# https://github.com/TheStilbruch/tildechan #
# #
# - # - # - # - # - # - # - # - # - # - # - # - # - # - #
-->
<html>
<head>
<link rel="stylesheet" href="/css/main.css">
<title><?php echo $title; ?></title>
</head>
<body>
<!-- master board list -->
<div class="box">
<span>
<b>boards:</b> (
<a href="/b/">b</a>
/
<a href="/g/">g</a>
/
<a href="/m/">m</a>
/
<a href="/v/">v</a>
)
</span>
<span>
<b>links:</b> (
<a href="/">home</a>
)
</span>
<span>
<b>profile:</b> (
<?php
if (($_SESSION['logged_in'] ?? 0) == 1) {
// I just decided to echo everything out here since the <?php ?\> syntax was ugly
echo "<a href=\"/profile.php\">profile</a>";
echo " / ";
echo "<a href=\"logout.php\">log out</a>";
echo " )";
} else {
echo "<a href=\"/register.php\">register</a>";
echo " / ";
echo "<a href=\"/login.php\">login</a>";
echo " )";
}
?>
</span>
</div>
<div class="main">
<?php
}
?>