mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 03:56:21 +05:30
Update htmly.php
Add Featured Image & Embed Video
This commit is contained in:
parent
032ec207c6
commit
04d8c567a7
1 changed files with 29 additions and 3 deletions
|
|
@ -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' => '<ul>' . $message['error'] . '</ul>',
|
||||
'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' => '<ul>' . $message['error'] . '</ul>',
|
||||
'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' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add page'
|
||||
));
|
||||
} else {
|
||||
$login = site_url() . 'login';
|
||||
header("location: $login");
|
||||
}
|
||||
});
|
||||
|
||||
// Get submitted static page data
|
||||
post('/add/page', function () {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue