Ejemplo n.º 1
0
<?php

include_once '../includes/core/init.inc.php';
//Include necessary files
$layout_context = "public";
include "../includes/layouts/header.php";
utility::find_selected_content(true);
if ($current_page && isset($_POST['author'])) {
    comment::create_comment();
}
?>


<div id="content-wrap">
	
	<?php 
include "../includes/layouts/public_navigation.php";
?>
	
	<div id = "main">
		
	<?php 
if ($current_page) {
    ?>
		<?php 
    $comment_set = comment::find_coments_by_page($current_page['id']);
    ?>
		<div class="view-content">
			<h1> <?php 
    echo htmlentities($current_page["menu_name"]);
    ?>
Ejemplo n.º 2
0
     }
     break;
 case 'page':
     if (isset($_POST['page_id']) && $_POST['page_id'] != 0) {
         //update
         post::update_page($_POST['title'], htmlentities($_POST["content_code"]), $_POST["status"], $_POST['page_id']);
         header('Location: index.php?p=edit_page&id=' . $_POST["page_id"]);
     } else {
         //insert
         $post_id = post::create_page($_POST["title"], $_POST["status"], htmlentities($_POST["content_code"]));
         header('Location: index.php?p=edit_page&id=' . $post_id);
     }
     break;
 case 'comment':
     //létrehozunk egy új commentet
     comment::create_comment(nl2br($_POST["com_content"]), $_POST["post_id"]);
     header("Location: index.php?p=view_post&id=" . $_POST["post_id"]);
     break;
 case 'media':
     //új kép feltöltése
     if (!empty($_FILES['image'])) {
         $upload = Upload::factory('easyaccessblog/' . $user->get_user_name() . '/uploads');
         $upload->file($_FILES['image']);
         //var_dump($_FILES);
         $validation = new validation();
         $upload->callbacks($validation, array('check_name_length'));
         $results = $upload->upload();
         $media_id = media::create_media($results);
         header("Location: index.php?p=images");
         //var_dump($results);
     }