<?php

use controllers\BlogsController;
use controllers\UsersController;
use controllers\PostsController;
$user = new UsersController();
$user->render();
$user_error = $user->getError();
$me = $user->getMe();
$blog = new BlogsController();
$blog->render();
$blog_error = $blog->getError();
$blogs = $blog->getBlogs();
$edit_blog = $blog->getBlog();
$post = new PostsController();
$post->render();
$post_error = $post->getError();
$posts = $post->getPosts();
$one = $post->getPost();
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="description" content="blog description" />
	<title>blog title</title>
	<link media="all" type="text/css" rel="stylesheet" href="media/css/bootstrap.min.css" />
	<link media="all" type="text/css" rel="stylesheet" href="media/css/bootstrap-theme.min.css" />
	<link media="all" type="text/css" rel="stylesheet" href="media/css/mui.min.css" />
	<link media="all" type="text/css" rel="stylesheet" href="media/css/style.css" />
	<script src="media/js/jquery-2.1.4.min.js"></script>
Beispiel #2
0
session_start();
require '../autoload.php';
use controllers\BlogsController;
use controllers\PostsController;
use controllers\CommentsController;
use controllers\CategoriesController;
use controllers\MailsController;
use controllers\UsersController;
if (isset($_GET['blog'])) {
    $limit = isset($_GET['limit']) && (is_int($_GET['limit']) || is_numeric($_GET['limit'])) ? $_GET['limit'] : 10;
    $o = new BlogsController();
    $blog = $o->getBlogBySlug($_GET['blog'], $limit);
}
if (isset($_GET['post'])) {
    $o = new PostsController();
    $post = $o->readPost($_GET['post'], 1);
}
if (isset($_GET['comments'])) {
    $o = new CommentsController();
    $comments = $o->getCommentsByPostId($_GET['comments']);
}
if (isset($_GET['categories'])) {
    $o = new CategoriesController();
    $categories = $o->get();
}
if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['post_id']) && isset($_POST['send']) && $_POST['send'] == 'comment') {
    $o = new CommentsController();
    echo $o->create($_POST['post_id'], $_POST['content'], $_POST['title'], $_POST["note"]);
}
if (isset($_POST['vote']) && isset($_POST['comment_id']) && isset($_POST['send']) && $_POST['send'] == 'vote') {