%NAVBAR%ized all the pages. I hope, there are no errors.

master
BodgeMaster 2020-02-26 19:03:55 +01:00
parent d715c205d3
commit 6a8493c863
10 changed files with 20 additions and 133 deletions

View File

@ -2,6 +2,7 @@
//todo: fix automatic log out when opening "Boards"
session_start();
%NO_CHEAP_SESSION_STEALING%
$navbar="boards";
?>
<!DOCTYPE html>
<html>
@ -12,24 +13,7 @@ session_start();
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<!--<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>-->
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
<br />
%NAVBAR%
<div class="container">
<div class="item-1">
<h1><center>ThreadR Boards</center></h1>

View File

@ -1,6 +1,7 @@
<?php
session_start();
%NO_CHEAP_SESSION_STEALING%
$navbar="home";
?>
<!DOCTYPE html>
<html>

View File

@ -1,6 +1,7 @@
<?php
session_start();
//todo: force log out any user if logged in on this page
$navbar = "login";
?>
<!DOCTYPE html>
<html>
@ -11,24 +12,7 @@ session_start();
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li><a href="%CONTENT_DIR%/">%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<!--<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>-->
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
%NAVBAR%
<br />
<div class="container">
<div class="item-1">

View File

@ -5,6 +5,7 @@ if (ini_get("session.use_cookies")) {
setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
}
session_destroy();
$navbar = "logout";
?>
<!DOCTYPE html>
<html>
@ -15,22 +16,7 @@ session_destroy();
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
%NAVBAR%
<br />
<div class="container">
<div class="item-1">

View File

@ -2,6 +2,7 @@
//todo: fix automatic log out when opening "News"
session_start();
%NO_CHEAP_SESSION_STEALING%
$navbar = "news";
?>
<!DOCTYPE html>
<html>
@ -12,23 +13,7 @@ session_start();
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a class="active" href="%CONTENT_DIR%/news/">News</a></li>
<!--<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>-->
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
%NAVBAR%
<br />
<div class="container">
<div class="item-1">

View File

@ -7,6 +7,8 @@ $statement = $pdo->prepare('SELECT name FROM users WHERE id = :user_id;'); // to
$result = $statement->execute(array('user_id' => $_SESSION['user_id']));
$dbentry = $statement->fetch();
$username = $dbentry['name'];
$navbar = "profile";
?>
@ -19,24 +21,7 @@ $username = $dbentry['name'];
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li><a class="active" href="%CONTENT_DIR%/profile/">Profile</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
<br />
%NAVBAR%
<div class="container">
<div class="item-1">
<center><h1>ThreadR</h1></center>

View File

@ -1,6 +1,7 @@
<?php
session_start();
%NO_CHEAP_SESSION_STEALING%
$navbar = "signup";
?>
<!DOCTYPE html>
<html>
@ -12,14 +13,7 @@ session_start();
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
<br />
%NAVBAR%
<div class="container">
<div class="item-1">
<h1><center>Create your ThreadR account</center></h1>

View File

@ -26,6 +26,7 @@
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
//$statement = $pdo->prepare('');
$navbar = "verify-email";
?>
<!DOCTYPE html>
<html>
@ -36,24 +37,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<!-- <li><a class="dropdown">
<button class="dropbtn">News
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div> -->
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
<br />
%NAVBAR%
<div class="container">
<div class="item-1">
<h1>

View File

@ -1,2 +0,0 @@
<?php $navbar="home" ?>
%NAVBAR%

View File

@ -9,6 +9,9 @@ $statement = $pdo->prepare('SELECT name FROM users WHERE id = :user_id;'); // to
$result = $statement->execute(array('user_id' => $_SESSION['user_id']));
$dbentry = $statement->fetch();
$username = $dbentry['name'];
$navbar = "home";
//ToDo: differentiate between home and userhome (or auto-redirect)
?>
<!DOCTYPE html>
<html>
@ -19,24 +22,7 @@ $username = $dbentry['name'];
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li>%HOME_LINK%</li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<div class="dropdown">
<button class="dropbtn">Boards
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="%CONTENT_DIR%/boards/">Board 1</a>
<a href="#">Board 2</a>
<a href="#">Board 3</a>
</div>
</div>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li><a href="%CONTENT_DIR%/profile/">Profile</a></li>
<li class="right">%LOGIN_LINK%</li>
</ul>
<br />
%NAVBAR%
<div class="container">
<div class="item-1">
<center><h1>ThreadR</h1></center>