From 04d8c567a7074e481722f3740b121a4b87c8f966 Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Sat, 7 Feb 2015 17:37:44 +0700 Subject: [PATCH] Update htmly.php Add Featured Image & Embed Video --- system/htmly.php | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/system/htmly.php b/system/htmly.php index 8241bfd..c05c01e 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -334,6 +334,8 @@ post('/:year/:month/:name/edit', function () { $proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $title = from($_REQUEST, 'title'); + $fi = from($_REQUEST, 'fi'); + $vid = from($_REQUEST, 'vid'); $tag = from($_REQUEST, 'tag'); $url = from($_REQUEST, 'url'); $content = from($_REQUEST, 'content'); @@ -351,7 +353,7 @@ post('/:year/:month/:name/edit', function () { if(empty($url)) { $url = $title; } - edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime); + edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $fi, $vid); } else { $message['error'] = ''; if (empty($title)) { @@ -373,6 +375,8 @@ post('/:year/:month/:name/edit', function () { 'error' => '', 'oldfile' => $oldfile, 'postTitle' => $title, + 'postFi' => $fi, + 'postVid' => $vid, 'postTag' => $tag, 'postUrl' => $url, 'postContent' => $content, @@ -875,6 +879,8 @@ post('/add/post', function () { $proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $title = from($_REQUEST, 'title'); + $fi = from($_REQUEST, 'fi'); + $vid = from($_REQUEST, 'vid'); $tag = from($_REQUEST, 'tag'); $url = from($_REQUEST, 'url'); $content = from($_REQUEST, 'content'); @@ -882,10 +888,10 @@ post('/add/post', function () { $user = $_SESSION[config("site.url")]['user']; if ($proper && !empty($title) && !empty($tag) && !empty($content)) { if (!empty($url)) { - add_post($title, $tag, $url, $content, $user, $description); + add_post($title, $tag, $url, $content, $user, $description, $fi, $vid); } else { $url = $title; - add_post($title, $tag, $url, $content, $user, $description); + add_post($title, $tag, $url, $content, $user, $description, $fi, $vid); } } else { $message['error'] = ''; @@ -906,6 +912,8 @@ post('/add/post', function () { 'head_contents' => head_contents('Add post - ' . blog_title(), blog_description(), site_url()), 'error' => '', 'postTitle' => $title, + 'postFi' => $fi, + 'postVid' => $vid, 'postTag' => $tag, 'postUrl' => $url, 'postContent' => $content, @@ -933,6 +941,24 @@ get('/add/page', function () { } }); +// Add the static page +get('/add/page', function () { + + if (login()) { + + config('views.root', 'system/admin/views'); + + render('add-page', array( + 'head_contents' => head_contents('Add page - ' . blog_title(), blog_description(), site_url()), + 'bodyclass' => 'addpage', + 'breadcrumb' => '' . config('breadcrumb.home') . ' » Add page' + )); + } else { + $login = site_url() . 'login'; + header("location: $login"); + } +}); + // Get submitted static page data post('/add/page', function () {