switched to functions for the header/footer importing, it makes more sense imo

This commit is contained in:
hayden 2019-06-29 19:54:26 -05:00
parent 702edc411a
commit 36444b0e85
5 changed files with 44 additions and 41 deletions

View File

@ -1,4 +1,9 @@
<!-- this is such a lonely file... -->
<?php
function display_footer() {
?>
</div>
</body>
</html>
<?php
}
?>

View File

@ -1,4 +1,5 @@
<?php
function display_header($title = "~chan") {
// Load in display variables
$title = $title ?? '~chan';
@ -59,3 +60,6 @@ if (($_SESSION['logged_in'] ?? 0) == 1) {
</span>
</div>
<div class="main">
<?php
}
?>

View File

@ -1,6 +1,9 @@
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
require($path . '/core/header.php');
require_once($path . '/core/header.php');
require_once($path . '/core/footer.php');
display_header();
?>
<div style="
@ -12,6 +15,5 @@ require($path . '/core/header.php');
hello there!
</div>
<?php
require($path . '/core/footer.php');
# the end...
display_footer();
?>

View File

@ -1,14 +1,10 @@
<?php
// if a login was submitted
if($_SERVER['REQUEST_METHOD'] == 'POST') {
}
$title = "~chan - login";
$path = $_SERVER['DOCUMENT_ROOT'];
include($path . '/core/header.php');
?>
require_once($path . '/core/header.php');
require_once($path . '/core/footer.php');
display_header("~chan - login");
?>
<div style="
margin: auto;
width: 300px;
@ -34,6 +30,5 @@ include($path . '/core/header.php');
</div>
<?php
include($path . '/core/footer.php');
# the end...
display_footer();
?>

View File

@ -1,12 +1,9 @@
<?php
// page vars
$title = "~chan - register";
// imports
$path = $_SERVER['DOCUMENT_ROOT'];
require($path . '/core/header.php');
require($path . '/core/security.php');
require($path . '/core/database.php');
require_once($path . '/core/header.php');
require_once($path . '/core/footer.php');
require_once($path . '/core/security.php');
require_once($path . '/core/database.php');
//TODO: email / invite registration
@ -75,6 +72,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
//TODO: Tell the user they have been registered
}
display_header("~chan - register");
?>
<div style="
margin: auto;
@ -130,6 +128,5 @@ if(isset($_GET['login_failed'])) {
</form>
</div>
<?php
require($path . '/core/footer.php');
# the end...
display_footer();
?>