Beispiel #1
0
<?php

require "../includes/conf.inc.php";
require "../includes/functions.inc.php";
$postId = intval($_GET['id']);
$post = post::view($postId, 1);
if ($post == false) {
    die($e);
}
$comments = comment::getComments($postId);
if ($comments == false) {
    die($e);
}
if ($comments != 'empty') {
    $seeOlder = comment::checkOldComments($postId);
    if ($seeOlder == false) {
        $seeOlder = '';
    }
}
/*$likeObj = new like();
	$likeResult = $likeObj->getLikes($postId);
	if($likeResult == false){
		die($e);
	}

	if(isset($_SESSION['userLogin'])){
		$checkLike = $likeObj->checkLike($postId,$_SESSION['userId']);
		if($checkLike == false){
			die($e);
		} else if($checkLike == "liked"){
			$likeStatus = 'Unlike';
Beispiel #2
0
require "../../includes/conf.inc.php";
require "../../includes/functions.inc.php";
if (!isset($_SESSION['login'])) {
    $_SESSION['error'] = 2;
    header("location: ../login.php");
} else {
    $adminId = $_SESSION['adminId'];
    $admin = get_admin_info($adminId);
    if ($admin['roleId'] == 1) {
        header("location: ../posts/");
    }
    if (!isset($_GET['id'])) {
        header("location: ../posts/");
    } else {
        $id = intval($_GET['id']);
        $post = post::view($id, 2);
        if ($post == 'empty') {
            header("location: ../posts/");
        }
    }
}
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1" />
	<title>Plus Two Notes | Post Editor</title>
	<?php 
require "../includes/links.php";
?>