-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
49 lines (49 loc) · 2.67 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title>BloggIT</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://cdn.tiny.cloud/1/1c0d1gc0geamwj5ml8hw7f2rvbt0xhm048ats35qeai4bt3m/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: '#content',
plugins: 'link image code',
toolbar: 'undo redo | bold italic underline | alignleft aligncenter alignright | image link',
height: 400
});
function toggleMenu() {
var menuBar = document.querySelector('#menu-bar');
menuBar.classList.toggle('show');
}
</script>
</head>
<body>
<div class="w3-container w3-teal" id="heading">
<button class="w3-teal w3-button" id="menu-button" onclick="toggleMenu()"><i class="fa fa-bars"></i></button>
<h1>Bloggit</h1>
</div>
<div class="w3-bar w3-teal" id="menu-bar">
<?php if(isset($_SESSION["username"])){
echo "<a href='home.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Home</a>";
echo "<a href='create_post.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Create Post</a>";
echo "<a href='manage_posts.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Manage Posts</a>";
echo "<a href='profile.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Profile</a>";
echo "<a href='logout.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Logout</a>";
$current_page = basename($_SERVER['PHP_SELF']);
if ($current_page === 'home.php') {
echo "<form class='w3-bar-item w3-right' action='search.php' style='margin: 0px; padding: 0px' method='GET'>";
echo "<input type='text' name='q' id='q' class='w3-bar-item w3-input' style='margin: 0px' placeholder='Search for any post...' required>";
echo "<input type='submit' class='w3-bar-item w3-button w3-teal' value='Search' style='margin: 0.5px'>";
echo "</form>";
}
}
else{
echo "<a href='home.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Home</a>";
echo "<a href='index.php' class='w3-bar-item w3-button w3-mobile w3-left-align' style='margin-top: 1.5px'>Login</a>";
}
?>
</div>