Browse Source

Update htmly.php

Add Featured Image & Embed Video
pull/140/head
Mohamad Fahmi 10 years ago
parent
commit
04d8c567a7
1 changed files with 29 additions and 3 deletions
  1. +29
    -3
      system/htmly.php

+ 29
- 3
system/htmly.php View File

@ -334,6 +334,8 @@ post('/:year/:month/:name/edit', function () {
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
$title = from($_REQUEST, 'title'); $title = from($_REQUEST, 'title');
$fi = from($_REQUEST, 'fi');
$vid = from($_REQUEST, 'vid');
$tag = from($_REQUEST, 'tag'); $tag = from($_REQUEST, 'tag');
$url = from($_REQUEST, 'url'); $url = from($_REQUEST, 'url');
$content = from($_REQUEST, 'content'); $content = from($_REQUEST, 'content');
@ -351,7 +353,7 @@ post('/:year/:month/:name/edit', function () {
if(empty($url)) { if(empty($url)) {
$url = $title; $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 { } else {
$message['error'] = ''; $message['error'] = '';
if (empty($title)) { if (empty($title)) {
@ -373,6 +375,8 @@ post('/:year/:month/:name/edit', function () {
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'oldfile' => $oldfile, 'oldfile' => $oldfile,
'postTitle' => $title, 'postTitle' => $title,
'postFi' => $fi,
'postVid' => $vid,
'postTag' => $tag, 'postTag' => $tag,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
@ -875,6 +879,8 @@ post('/add/post', function () {
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
$title = from($_REQUEST, 'title'); $title = from($_REQUEST, 'title');
$fi = from($_REQUEST, 'fi');
$vid = from($_REQUEST, 'vid');
$tag = from($_REQUEST, 'tag'); $tag = from($_REQUEST, 'tag');
$url = from($_REQUEST, 'url'); $url = from($_REQUEST, 'url');
$content = from($_REQUEST, 'content'); $content = from($_REQUEST, 'content');
@ -882,10 +888,10 @@ post('/add/post', function () {
$user = $_SESSION[config("site.url")]['user']; $user = $_SESSION[config("site.url")]['user'];
if ($proper && !empty($title) && !empty($tag) && !empty($content)) { if ($proper && !empty($title) && !empty($tag) && !empty($content)) {
if (!empty($url)) { if (!empty($url)) {
add_post($title, $tag, $url, $content, $user, $description);
add_post($title, $tag, $url, $content, $user, $description, $fi, $vid);
} else { } else {
$url = $title; $url = $title;
add_post($title, $tag, $url, $content, $user, $description);
add_post($title, $tag, $url, $content, $user, $description, $fi, $vid);
} }
} else { } else {
$message['error'] = ''; $message['error'] = '';
@ -906,6 +912,8 @@ post('/add/post', function () {
'head_contents' => head_contents('Add post - ' . blog_title(), blog_description(), site_url()), 'head_contents' => head_contents('Add post - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'postTitle' => $title, 'postTitle' => $title,
'postFi' => $fi,
'postVid' => $vid,
'postTag' => $tag, 'postTag' => $tag,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, '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' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Add page'
));
} else {
$login = site_url() . 'login';
header("location: $login");
}
});
// Get submitted static page data // Get submitted static page data
post('/add/page', function () { post('/add/page', function () {


Loading…
Cancel
Save