mirror of
https://github.com/p08dev/Bloggr.git
synced 2026-06-17 12:43:56 +02:00
Added Picnic CSS
Fixed spelling errors
This commit is contained in:
56
index.php
56
index.php
@ -5,60 +5,24 @@ $posts = $auth->getAllPosts();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<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>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
|
||||
</head>
|
||||
<?php
|
||||
$title = "Home";
|
||||
require_once(__DIR__."/inc/head.php");
|
||||
?>
|
||||
<body>
|
||||
<?php
|
||||
if ($auth->hasRole([ \Bloggr\Roles::ADMIN ])) {
|
||||
?>
|
||||
<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 require_once(__DIR__."/inc/nav.php"); ?>
|
||||
<section class="main">
|
||||
<h2>Posts</h2>
|
||||
<?php
|
||||
if ($posts) {
|
||||
foreach($posts as $post) {
|
||||
?>
|
||||
<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>
|
||||
Text:
|
||||
<?= substr($post['text'], 0, 512) ?><?= (substr($post['text'], 0, 512) !== $post['text']) ? '... <br><a href="/post.php?view='.$post["id"].'">Weiterlesen...</a>' : '' ?>
|
||||
</p>
|
||||
<p>Author: <?= $post['user'] ?></p>
|
||||
<p><small>von <?= $post['user'] ?> am <?= date('H:i d.m.Y', $post['created_at']) ?></p>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
@ -66,6 +30,6 @@ $posts = $auth->getAllPosts();
|
||||
echo 'Noch kein Beitrag vorhanden. :(';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user