mirror of
https://github.com/p08dev/Bloggr.git
synced 2026-06-17 04:33:56 +02:00
Added Picnic CSS
Fixed spelling errors
This commit is contained in:
343
css/main.css
343
css/main.css
@ -1,340 +1,9 @@
|
|||||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
section.main {
|
||||||
/* Document
|
text-align: left;
|
||||||
========================================================================== */
|
width: 90%;
|
||||||
/**
|
max-width: 960px;
|
||||||
* 1. Correct the line height in all browsers.
|
margin: 0 auto;
|
||||||
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
padding: 80px 0 0;
|
||||||
*/
|
|
||||||
html {
|
|
||||||
line-height: 1.15;
|
|
||||||
/* 1 */
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sections
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* Remove the margin in all browsers.
|
|
||||||
*/
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Render the `main` element consistently in IE.
|
|
||||||
*/
|
|
||||||
main {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Correct the font size and margin on `h1` elements within `section` and
|
|
||||||
* `article` contexts in Chrome, Firefox, and Safari.
|
|
||||||
*/
|
|
||||||
h1 {
|
|
||||||
font-size: 2em;
|
|
||||||
margin: 0.67em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Grouping content
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* 1. Add the correct box sizing in Firefox.
|
|
||||||
* 2. Show the overflow in Edge and IE.
|
|
||||||
*/
|
|
||||||
hr {
|
|
||||||
box-sizing: content-box;
|
|
||||||
/* 1 */
|
|
||||||
height: 0;
|
|
||||||
/* 1 */
|
|
||||||
overflow: visible;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
||||||
* 2. Correct the odd `em` font sizing in all browsers.
|
|
||||||
*/
|
|
||||||
pre {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
/* 1 */
|
|
||||||
font-size: 1em;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Text-level semantics
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* Remove the gray background on active links in IE 10.
|
|
||||||
*/
|
|
||||||
a {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Remove the bottom border in Chrome 57-
|
|
||||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
||||||
*/
|
|
||||||
abbr[title] {
|
|
||||||
border-bottom: none;
|
|
||||||
/* 1 */
|
|
||||||
text-decoration: underline;
|
|
||||||
/* 2 */
|
|
||||||
text-decoration: underline dotted;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
||||||
*/
|
|
||||||
b,
|
|
||||||
strong {
|
|
||||||
font-weight: bolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
||||||
* 2. Correct the odd `em` font sizing in all browsers.
|
|
||||||
*/
|
|
||||||
code,
|
|
||||||
kbd,
|
|
||||||
samp {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
/* 1 */
|
|
||||||
font-size: 1em;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the correct font size in all browsers.
|
|
||||||
*/
|
|
||||||
small {
|
|
||||||
font-size: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
||||||
* all browsers.
|
|
||||||
*/
|
|
||||||
sub,
|
|
||||||
sup {
|
|
||||||
font-size: 75%;
|
|
||||||
line-height: 0;
|
|
||||||
position: relative;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub {
|
|
||||||
bottom: -0.25em;
|
|
||||||
}
|
|
||||||
|
|
||||||
sup {
|
|
||||||
top: -0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Embedded content
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* Remove the border on images inside links in IE 10.
|
|
||||||
*/
|
|
||||||
img {
|
|
||||||
border-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Forms
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* 1. Change the font styles in all browsers.
|
|
||||||
* 2. Remove the margin in Firefox and Safari.
|
|
||||||
*/
|
|
||||||
button,
|
|
||||||
input,
|
|
||||||
optgroup,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
font-family: inherit;
|
|
||||||
/* 1 */
|
|
||||||
font-size: 100%;
|
|
||||||
/* 1 */
|
|
||||||
line-height: 1.15;
|
|
||||||
/* 1 */
|
|
||||||
margin: 0;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the overflow in IE.
|
|
||||||
* 1. Show the overflow in Edge.
|
|
||||||
*/
|
|
||||||
button,
|
|
||||||
input {
|
|
||||||
/* 1 */
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
||||||
* 1. Remove the inheritance of text transform in Firefox.
|
|
||||||
*/
|
|
||||||
button,
|
|
||||||
select {
|
|
||||||
/* 1 */
|
|
||||||
text-transform: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Correct the inability to style clickable types in iOS and Safari.
|
|
||||||
*/
|
|
||||||
button,
|
|
||||||
[type=button],
|
|
||||||
[type=reset],
|
|
||||||
[type=submit] {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the inner border and padding in Firefox.
|
|
||||||
*/
|
|
||||||
button::-moz-focus-inner,
|
|
||||||
[type=button]::-moz-focus-inner,
|
|
||||||
[type=reset]::-moz-focus-inner,
|
|
||||||
[type=submit]::-moz-focus-inner {
|
|
||||||
border-style: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restore the focus styles unset by the previous rule.
|
|
||||||
*/
|
|
||||||
button:-moz-focusring,
|
|
||||||
[type=button]:-moz-focusring,
|
|
||||||
[type=reset]:-moz-focusring,
|
|
||||||
[type=submit]:-moz-focusring {
|
|
||||||
outline: 1px dotted ButtonText;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Correct the padding in Firefox.
|
|
||||||
*/
|
|
||||||
fieldset {
|
|
||||||
padding: 0.35em 0.75em 0.625em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Correct the text wrapping in Edge and IE.
|
|
||||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
||||||
* 3. Remove the padding so developers are not caught out when they zero out
|
|
||||||
* `fieldset` elements in all browsers.
|
|
||||||
*/
|
|
||||||
legend {
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* 1 */
|
|
||||||
color: inherit;
|
|
||||||
/* 2 */
|
|
||||||
display: table;
|
|
||||||
/* 1 */
|
|
||||||
max-width: 100%;
|
|
||||||
/* 1 */
|
|
||||||
padding: 0;
|
|
||||||
/* 3 */
|
|
||||||
white-space: normal;
|
|
||||||
/* 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
||||||
*/
|
|
||||||
progress {
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the default vertical scrollbar in IE 10+.
|
|
||||||
*/
|
|
||||||
textarea {
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Add the correct box sizing in IE 10.
|
|
||||||
* 2. Remove the padding in IE 10.
|
|
||||||
*/
|
|
||||||
[type=checkbox],
|
|
||||||
[type=radio] {
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* 1 */
|
|
||||||
padding: 0;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
||||||
*/
|
|
||||||
[type=number]::-webkit-inner-spin-button,
|
|
||||||
[type=number]::-webkit-outer-spin-button {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Correct the odd appearance in Chrome and Safari.
|
|
||||||
* 2. Correct the outline style in Safari.
|
|
||||||
*/
|
|
||||||
[type=search] {
|
|
||||||
-webkit-appearance: textfield;
|
|
||||||
/* 1 */
|
|
||||||
outline-offset: -2px;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the inner padding in Chrome and Safari on macOS.
|
|
||||||
*/
|
|
||||||
[type=search]::-webkit-search-decoration {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
||||||
* 2. Change font properties to `inherit` in Safari.
|
|
||||||
*/
|
|
||||||
::-webkit-file-upload-button {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
/* 1 */
|
|
||||||
font: inherit;
|
|
||||||
/* 2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Interactive
|
|
||||||
========================================================================== */
|
|
||||||
/*
|
|
||||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
||||||
*/
|
|
||||||
details {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add the correct display in all browsers.
|
|
||||||
*/
|
|
||||||
summary {
|
|
||||||
display: list-item;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Misc
|
|
||||||
========================================================================== */
|
|
||||||
/**
|
|
||||||
* Add the correct display in IE 10+.
|
|
||||||
*/
|
|
||||||
template {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the correct display in IE 10.
|
|
||||||
*/
|
|
||||||
[hidden] {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*# sourceMappingURL=main.css.map */
|
/*# sourceMappingURL=main.css.map */
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
{"version":3,"sourceRoot":"","sources":["../scss/_normalize.scss"],"names":[],"mappings":"AAAA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AAKC;EACC;AAAmB;EACnB;AAAgC;;;AAGlC;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;EACA;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAAA;AAKA;EACE;AAAyB;EACzB;AAAW;EACX;AAAmB;;;AAGrB;AAAA;AAAA;AAAA;AAKA;EACE;AAAmC;EACnC;AAAgB;;;AAGlB;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;AAAqB;EACrB;AAA4B;EAC5B;AAAmC;;;AAGrC;AAAA;AAAA;AAIA;AAAA;EAEE;;;AAGF;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;EAGE;AAAmC;EACnC;AAAgB;;;AAGlB;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;EAKE;AAAsB;EACtB;AAAiB;EACjB;AAAmB;EACnB;AAAW;;;AAGb;AAAA;AAAA;AAAA;AAKA;AAAA;AACQ;EACN;;;AAGF;AAAA;AAAA;AAAA;AAKA;AAAA;AACS;EACP;;;AAGF;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;EAIE;;;AAGF;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;EAIE;EACA;;;AAGF;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;EAIE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;EACE;AAAwB;EACxB;AAAgB;EAChB;AAAgB;EAChB;AAAiB;EACjB;AAAY;EACZ;AAAqB;;;AAGvB;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;AAAA;EAEE;AAAwB;EACxB;AAAY;;;AAGd;AAAA;AAAA;AAIA;AAAA;EAEE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;AAA+B;EAC/B;AAAsB;;;AAGxB;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;AAA4B;EAC5B;AAAe;;;AAGjB;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE","file":"main.css"}
|
{"version":3,"sourceRoot":"","sources":["../scss/main.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA","file":"main.css"}
|
||||||
2
css/picnic.min.css
vendored
Normal file
2
css/picnic.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
10
inc/head.php
Normal file
10
inc/head.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
echo '
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>'.$title.' - '. ((defined("SITE_TITLE")) ? SITE_TITLE : "A Bloggr Site").'</title>
|
||||||
|
<link rel="stylesheet" href="/css/picnic.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
|
</head>';
|
||||||
39
inc/nav.php
Normal file
39
inc/nav.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
<nav class="demo">
|
||||||
|
<a href="/" class="brand">
|
||||||
|
<span><?= ((defined("SITE_TITLE")) ? SITE_TITLE : "A Bloggr Site") ?></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- responsive-->
|
||||||
|
<input id="bmenub" type="checkbox" class="show">
|
||||||
|
<label for="bmenub" class="burger pseudo button">≡</label>
|
||||||
|
|
||||||
|
<div class="menu">
|
||||||
|
<?php
|
||||||
|
if ($auth->hasRole([ \Bloggr\Roles::ADMIN ])){
|
||||||
|
?>
|
||||||
|
<a href="/users.php" class="pseudo button">Benutzer</a>
|
||||||
|
<a href="/post.php?new" class="pseudo button">Neuer Post</a>
|
||||||
|
<?php
|
||||||
|
} elseif($auth->hasRole([ \Bloggr\Roles::AUTHOR ])) {
|
||||||
|
?>
|
||||||
|
<a href="/settings.php" class="pseudo button">Einstellungen</a>
|
||||||
|
<a href="/logout.php" class="button">Logout</a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
if (!$auth->isLoggedIn()){
|
||||||
|
?>
|
||||||
|
<a href="/login.php" class="pseudo button">Login</a>
|
||||||
|
<a href="/register.php" class="button">Registrieren</a>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<a href="/settings.php" class="pseudo button">Einstellungen</a>
|
||||||
|
<a href="/logout.php" class="button">Logout</a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
56
index.php
56
index.php
@ -5,60 +5,24 @@ $posts = $auth->getAllPosts();
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<?php
|
||||||
<meta charset="UTF-8">
|
$title = "Home";
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
?>
|
||||||
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
if ($auth->hasRole([ \Bloggr\Roles::ADMIN ])) {
|
<section class="main">
|
||||||
?>
|
<h2>Posts</h2>
|
||||||
<p>
|
|
||||||
<a href="/users.php">Users</a>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
if ($auth->hasRole([ \Bloggr\Roles::ADMIN, \Bloggr\Roles::AUTHOR ])) {
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<a href="/post.php?new">Neuer Beitrag</a>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
if (!$auth->isLoggedIn()) {
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<a href="/login.php">Login</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="/register.php">Registrieren</a>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<a href="/settings.php">Einstellungen</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="/logout.php">Logout</a>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div>
|
|
||||||
<?php
|
<?php
|
||||||
if ($posts) {
|
if ($posts) {
|
||||||
foreach($posts as $post) {
|
foreach($posts as $post) {
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<h2>Titel: <a href="/post.php?view=<?= $post['id'] ?>"><?= $post['title'] ?></a></h2>
|
<h2><a href="/post.php?view=<?= $post['id'] ?>"><?= $post['title'] ?></a></h2>
|
||||||
<p>
|
<p>
|
||||||
Text:
|
|
||||||
<?= substr($post['text'], 0, 512) ?><?= (substr($post['text'], 0, 512) !== $post['text']) ? '... <br><a href="/post.php?view='.$post["id"].'">Weiterlesen...</a>' : '' ?>
|
<?= substr($post['text'], 0, 512) ?><?= (substr($post['text'], 0, 512) !== $post['text']) ? '... <br><a href="/post.php?view='.$post["id"].'">Weiterlesen...</a>' : '' ?>
|
||||||
</p>
|
</p>
|
||||||
<p>Author: <?= $post['user'] ?></p>
|
<p><small>von <?= $post['user'] ?> am <?= date('H:i d.m.Y', $post['created_at']) ?></p>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -66,6 +30,6 @@ $posts = $auth->getAllPosts();
|
|||||||
echo 'Noch kein Beitrag vorhanden. :(';
|
echo 'Noch kein Beitrag vorhanden. :(';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ if(!($request_uri == "/setup")) {
|
|||||||
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
|
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
|
||||||
$auth = new \Bloggr\Auth($pdo);
|
$auth = new \Bloggr\Auth($pdo);
|
||||||
|
|
||||||
if ($auth->isLoggedIn()) {
|
// if ($auth->isLoggedIn()) {
|
||||||
echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
|
// echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
18
login.php
18
login.php
@ -16,15 +16,13 @@ if (isset($_POST['login'])) {
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<?php
|
||||||
<meta charset="utf-8">
|
$title = "Login";
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<title>Login - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
|
<section class="main">
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -42,8 +40,8 @@ if (isset($_POST['login'])) {
|
|||||||
<input type="text" name="user" id="user" value="<?= (isset($_POST['user'])) ? htmlspecialchars($_POST['user']) : ''; ?>">
|
<input type="text" name="user" id="user" value="<?= (isset($_POST['user'])) ? htmlspecialchars($_POST['user']) : ''; ?>">
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" name="password" id="password"">
|
<input type="password" name="password" id="password"">
|
||||||
<input type="submit" name="login" value="login" class="float-right">
|
<input type="submit" name="login" value="Login" class="float-right">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
37
post.php
37
post.php
@ -70,16 +70,14 @@ if ($action == 'edit') {
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<?php
|
||||||
<meta charset="utf-8">
|
$title = "Neuer Beitrag";
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<title>Neuer Beitrag - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
<a href="/">Home</a>
|
<section class="main">
|
||||||
|
<a href="/">Zurück</a>
|
||||||
<?php
|
<?php
|
||||||
foreach ($errors as $key=>$value):
|
foreach ($errors as $key=>$value):
|
||||||
?>
|
?>
|
||||||
@ -93,18 +91,21 @@ if ($action == 'edit') {
|
|||||||
echo '<span style="color: green;">Post bearbeitet!</span><br>';
|
echo '<span style="color: green;">Post bearbeitet!</span><br>';
|
||||||
}
|
}
|
||||||
if ($action == 'view'):
|
if ($action == 'view'):
|
||||||
if ($auth->canEditPost($data["id"]) == true) echo '<a href="post.php?edit='.$data["id"].'">Edit Post</a>';
|
|
||||||
?>
|
?>
|
||||||
<h2>Titel: <?= $data['title'] ?></h2>
|
<h2><?= $data['title'] ?></h2>
|
||||||
<p>Text: <?= nl2br($data['text']) ?></p>
|
<p><?= nl2br($data['text']) ?></p>
|
||||||
<p>Author: <?= $data['user'] ?></p>
|
<p><small>von <?= $data['user'] ?> am <?= date('H:i d.m.Y', $data['created_at']) ?><br>
|
||||||
<?php
|
<?php
|
||||||
if($data['updated_by']):
|
if($data['updated_by']):
|
||||||
?>
|
?>
|
||||||
<p>Last edit at <?= date('H:i d.m.Y',$data['updated_at']).' from '.$data['updated_by'] ?></p>
|
Zuletzt bearbeitet: <?= date('H:i d.m.Y',$data['updated_at']).' von '.$data['updated_by'] ?>
|
||||||
|
</small>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
echo '</p>';
|
||||||
|
if ($auth->canEditPost($data["id"]) == true) echo '<a href="post.php?edit='.$data["id"].'">Edit Post</a>';
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
if ($auth->isLoggedIn()) {
|
if ($auth->isLoggedIn()) {
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
@ -115,12 +116,12 @@ if ($action == 'edit') {
|
|||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
echo '<h3>Kommentare</h3>';
|
||||||
if(is_array($result_comments)) {
|
if(is_array($result_comments)) {
|
||||||
foreach($result_comments as $comment) {
|
foreach($result_comments as $comment) {
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<b><?= $comment['user']; ?></b> - <?= date('H:i d.m.Y',$comment['created_at']) ?><br>
|
<b><?= $comment['user']; ?></b> am <?= date('H:i d.m.Y',$comment['created_at']) ?><br>
|
||||||
<?= $comment['comment']; ?>
|
<?= $comment['comment']; ?>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
@ -155,6 +156,6 @@ if ($action == 'edit') {
|
|||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
16
register.php
16
register.php
@ -21,15 +21,13 @@ if (isset($_POST['register'])) {
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<?php
|
||||||
<meta charset="utf-8">
|
$title = "Account erstellen";
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<title>Register - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
|
<section class="main">
|
||||||
<h2>Register</h2>
|
<h2>Register</h2>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -58,6 +56,6 @@ if (isset($_POST['register'])) {
|
|||||||
<input type="submit" name="register" value="Registrieren">
|
<input type="submit" name="register" value="Registrieren">
|
||||||
</form>
|
</form>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1 +1,7 @@
|
|||||||
@import "_normalize.scss";
|
section.main {
|
||||||
|
text-align: left;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 960px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 80px 0 0;
|
||||||
|
}
|
||||||
16
settings.php
16
settings.php
@ -26,15 +26,13 @@ if(isset($_POST['update'])) {
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<?php
|
||||||
<meta charset="UTF-8">
|
$title = "Einstellungen";
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
?>
|
||||||
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
<a href="/">Home</a>
|
<section class="main">
|
||||||
<h2>Change Password</h2>
|
<h2>Change Password</h2>
|
||||||
<?php
|
<?php
|
||||||
foreach ($errors as $key=>$value):
|
foreach ($errors as $key=>$value):
|
||||||
@ -58,6 +56,6 @@ if(isset($_POST['update'])) {
|
|||||||
<input type="password" name="rpassword" id="rpassword"><br>
|
<input type="password" name="rpassword" id="rpassword"><br>
|
||||||
<input type="submit" name="update" value="Update">
|
<input type="submit" name="update" value="Update">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -95,6 +95,8 @@ if (isset($_POST['check'])) {
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>Setup - Bloggr</title>
|
<title>Setup - Bloggr</title>
|
||||||
|
<link rel="stylesheet" href="/css/picnic.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
18
users.php
18
users.php
@ -27,19 +27,17 @@ $users = $auth->getAllUsers();
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<?php
|
||||||
<meta charset="UTF-8">
|
$title = "Benutzer";
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
require_once(__DIR__."/inc/head.php");
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
?>
|
||||||
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<?php require_once(__DIR__."/inc/nav.php"); ?>
|
||||||
<a href="/">Home</a>
|
<section class="main">
|
||||||
|
<?= ($view) ? '<a href="/users.php">Zurück</a>' : '' ?>
|
||||||
<h2>Users</h2>
|
<h2>Users</h2>
|
||||||
<?php
|
<?php
|
||||||
if($view) {
|
if($view) {
|
||||||
echo '<a href="/users.php">Back</a><br>';
|
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($users as $key => $value) {
|
foreach ($users as $key => $value) {
|
||||||
if($value['id'] == $view) {
|
if($value['id'] == $view) {
|
||||||
@ -69,6 +67,6 @@ $users = $auth->getAllUsers();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user