Browse Source

Merge pull request #431 from sean1138/master

label for must = input id by @sean1138
pull/405/merge
Dan 4 years ago
committed by GitHub
parent
commit
c9e0e3fdd7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 399 additions and 349 deletions
  1. +48
    -47
      system/admin/admin.php
  2. +53
    -49
      system/admin/views/add-content.html.php
  3. +20
    -13
      system/admin/views/add-page.html.php
  4. +1
    -1
      system/admin/views/config.html.php
  5. +54
    -48
      system/admin/views/edit-content.html.php
  6. +15
    -10
      system/admin/views/edit-page.html.php
  7. +3
    -1
      system/admin/views/popular-posts.html.php
  8. +3
    -1
      system/admin/views/posts-list.html.php
  9. +3
    -1
      system/admin/views/user-draft.html.php
  10. +3
    -1
      system/admin/views/user-posts.html.php
  11. +175
    -171
      system/includes/functions.php
  12. +21
    -6
      system/resources/css/toolbar.css

+ 48
- 47
system/admin/admin.php View File

@ -58,7 +58,7 @@ function session($user, $pass)
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');
} else {
return $str = '<li>Your username and password mismatch.</li>';
return $str = '<li>Your username and password mismatch.</li>';
}
} else if (old_password_verify($pass, $user_enc, $user_pass)) {
update_user($user, $pass, $user_role);
@ -104,46 +104,46 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
$tagmd = "\n<!--tag " . $post_tagmd . " tag-->";
} else {
$tagmd = "";
}
}
if ($media!== null) {
$post_media = "\n<!--" .$type. " " . $post_media . " " .$type. "-->";
} else {
$post_media = "";
}
}
$post_content = "<!--t " . $post_title . " t-->" . $post_description . $tagmd . $post_media . "\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {
if (get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) {
$dir = 'content/' . $user . '/blog/' . $category. '/'.$type. '/';
} else {
$dir = 'content/' . $user . '/blog/' . $category. '/draft/';
}
if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true));
} else {
mkdir($dir, 0775, true);
file_put_contents($dir . $filename, print_r($post_content, true));
}
save_tag_i18n($post_tag, $post_tagmd);
rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename, $category, $type);
if (empty($draft)) {
$redirect = site_url() . 'admin/mine';
} else {
$redirect = site_url() . 'admin/draft';
}
header("Location: $redirect");
}
}
@ -154,7 +154,7 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul
$oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-H-i-s', strtotime($date));
if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate;
}
@ -177,47 +177,47 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul
$tagmd = "\n<!--tag " . $post_tagmd . " tag-->";
} else {
$tagmd = "";
}
}
if ($media !== null) {
$post_media = "\n<!--" . $type . " " . $post_media. " " . $type . "-->";
} else {
$post_media = "";
}
}
$post_content = "<!--t " . $post_title . " t-->" . $post_description . $tagmd . $post_media . "\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {
if (get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/' . $dir[2] . '/' . $category . '/' . $type . '/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/' . $dir[2] . '/' . $category . '/draft/';
if($dir[4] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
if (is_dir($dirBlog)) {
} else {
mkdir($dirBlog, 0775, true);
mkdir($dirBlog, 0775, true);
}
if (is_dir($dirDraft)) {
} else {
mkdir($dirDraft, 0775, true);
mkdir($dirDraft, 0775, true);
}
file_put_contents($filename, print_r($post_content, true));
unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
if ($dir[3] === $category) {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) {
@ -227,37 +227,37 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul
file_put_contents($newfile, print_r($post_content, true));
}
} else {
$dirBlog = $dir[0] . '/' . $dir[1] . '/' . $dir[2] . '/' . $category . '/' . $type. '/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/' . $dir[2] . '/' . $category . '/draft/';
if($dir[4] == 'draft') {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
if (is_dir($dirBlog)) {
} else {
mkdir($dirBlog, 0775, true);
mkdir($dirBlog, 0775, true);
}
if (is_dir($dirDraft)) {
} else {
mkdir($dirDraft, 0775, true);
mkdir($dirDraft, 0775, true);
}
file_put_contents($filename, print_r($post_content, true));
unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if(!empty($publishDraft)) {
$dt = $olddate;
$t = str_replace('-', '', $dt);
$t = str_replace('-', '', $dt);
$time = new DateTime($t);
$timestamp = $time->format("Y-m-d");
} else {
@ -267,19 +267,19 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul
$time = new DateTime($t);
$timestamp = $time->format("Y-m-d");
}
// The post date
$postdate = strtotime($timestamp);
// The post URL
if (config('permalink.type') == 'post') {
$posturl = site_url() . 'post/' . $post_url;
} else {
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
}
save_tag_i18n($post_tag, $post_tagmd);
rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile, $category, $type);
if ($destination == 'post') {
@ -375,7 +375,7 @@ function add_sub_page($title, $url, $content, $static, $description = null)
function edit_page($title, $url, $content, $oldfile, $destination = null, $description = null, $static = null)
{
$dir = substr($oldfile, 0, strrpos($oldfile, '/'));
$post_title = safe_html($title);
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
$description = safe_html($description);
@ -410,7 +410,7 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr
} else {
$posturl = site_url() . $post_url;
}
rebuilt_cache('all');
clear_page_cache($post_url);
if ($destination == 'post') {
@ -471,7 +471,7 @@ function edit_category($title, $url, $content, $oldfile, $destination = null, $d
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_content)) {
if (get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
@ -482,9 +482,9 @@ function edit_category($title, $url, $content, $oldfile, $destination = null, $d
rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true));
}
rename_category_folder($post_url, $oldfile);
rebuilt_cache('all');
if ($destination == 'post') {
header("Location: $posturl");
@ -681,7 +681,7 @@ function get_user_posts()
echo '<tr class="head"><th>' . i18n('Title') . '</th><th>' . i18n('Published') . '</th>';
if (config("views.counter") == "true")
echo '<th>Views</th>';
echo '<th>' . i18n('Tag') . '</th><th>' . i18n('Operations') . '</th></tr>';
echo '<th>' . i18n('Category') . '</th><th>' . i18n('Tags') . '</th><th>' . i18n('Operations') . '</th></tr>';
$i = 0;
$len = count($posts);
foreach ($posts as $p) {
@ -698,6 +698,7 @@ function get_user_posts()
echo '<td>' . format_date($p->date) . '</td>';
if (config("views.counter") == "true")
echo '<td>' . $p->views . '</td>';
echo '<td>' . $p->category . '</td>';
echo '<td>' . $p->tag . '</td>';
echo '<td><a href="' . $p->url . '/edit?destination=admin">' . i18n('Edit') . '</a> <a href="' . $p->url . '/delete?destination=admin">' . i18n('Delete') . '</a></td>';
echo '</tr>';
@ -815,7 +816,7 @@ function clear_post_cache($post_date, $post_tag, $post_url, $filename, $category
if (file_exists($p)) {
unlink($p);
}
// Delete post permalink
$pp = 'cache/page/' . $b . 'post#' . $post_url . '.cache';
if (file_exists($pp)) {
@ -873,7 +874,7 @@ function clear_post_cache($post_date, $post_tag, $post_url, $filename, $category
foreach (glob('cache/page/' . $b . 'search#*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
// Delete category
$cc = 'cache/page/' . $b . 'category#' . $category . '.cache';
if (file_exists($cc)) {
@ -882,7 +883,7 @@ function clear_post_cache($post_date, $post_tag, $post_url, $filename, $category
foreach (glob('cache/page/' . $b . 'category#' . $category . '~*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
// Delete type
$tp = 'cache/page/' . $b . 'type#' . $type . '.cache';
if (file_exists($tp)) {


+ 53
- 49
system/admin/views/add-content.html.php View File

@ -1,10 +1,10 @@
<?php
<?php
$type = $type;
if ($type != 'is_post' && $type != 'is_image' && $type != 'is_video' && $type != 'is_audio' && $type != 'is_link' && $type != 'is_quote') {
$add = site_url() . 'admin/content';
header("location: $add");
header("location: $add");
}
$desc = get_category_info(null);
@ -12,7 +12,7 @@ $desc = get_category_info(null);
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
@ -27,77 +27,81 @@ $desc = get_category_info(null);
<div class="wmd-panel">
<form method="POST">
<?php echo i18n('Title');?> <span class="required">*</span>
<br>
<input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/>
<br><br>
<?php echo i18n('Category');?> <span class="required">*</span>
<br>
<select name="category">
<label for="pTitle"><?php echo i18n('Title');?> <span class="required">*</span></label>
<br />
<input autofocus type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" id="pTitle" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/>
<br /><br />
<label for="pCategory"><?php echo i18n('Category');?> <span class="required">*</span></label>
<br />
<select id="pCategory" name="category">
<option value="uncategorized"><?php echo i18n("Uncategorized");?></option>
<?php foreach ($desc as $d):?>
<option value="<?php echo $d->md;?>"><?php echo $d->title;?></option>
<?php endforeach;?>
</select>
<br><br>
Tag <span class="required">*</span>
<br>
<input type="text" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" name="tag" value="<?php if (isset($postTag)) { echo $postTag; } ?>"/>
<br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/>
<br>
</select>
<br /><br />
<label for="pTag">Tag <span class="required">*</span></label>
<br />
<input type="text" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" id="pTag" name="tag" value="<?php if (isset($postTag)) { echo $postTag; } ?>"/>
<br /><br />
<label for="pURL">Url (optional)</label>
<br />
<input type="text" class="text" id="pURL" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/>
<br />
<span class="help">If the url leave empty we will use the post title.</span>
<br><br>
<?php echo i18n('Meta_description');?> (optional)<br>
<textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br><br>
<br /><br />
<label for="pMeta"><?php echo i18n('Meta_description');?> (optional)</label>
<br />
<textarea id="pMeta" name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br /><br />
<?php if ($type == 'is_audio'):?>
Featured Audio <span class="required">*</span> (SoundCloud Only)
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" name="audio"><?php if (isset($postAudio)) { echo $postAudio;} ?></textarea>
<label for="pAudio">Featured Audio <span class="required">*</span> (SoundCloud Only)</label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" id="pAudio" name="audio"><?php if (isset($postAudio)) { echo $postAudio;} ?></textarea>
<input type="hidden" name="is_audio" value="is_audio">
<br>
<br />
<?php endif;?>
<?php if ($type == 'is_video'):?>
Featured Video <span class="required">*</span> (Youtube Only)
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" name="video"><?php if (isset($postVideo)) { echo $postVideo;} ?></textarea>
<label for="pVideo">Featured Video <span class="required">*</span> (Youtube Only)</label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" id="pVideo" name="video"><?php if (isset($postVideo)) { echo $postVideo;} ?></textarea>
<input type="hidden" name="is_video" value="is_video">
<br>
<br />
<?php endif;?>
<?php if ($type == 'is_image'):?>
Featured Image <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" name="image"><?php if (isset($postImage)) { echo $postImage;} ?></textarea>
<label for="pImage">Featured Image <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" id="pImage" name="image"><?php if (isset($postImage)) { echo $postImage;} ?></textarea>
<input type="hidden" name="is_image" value="is_image">
<br>
<br />
<?php endif;?>
<?php if ($type == 'is_quote'):?>
Featured Quote <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" name="quote"><?php if (isset($postQuote)) { echo $postQuote;} ?></textarea>
<label for="pQuote">Featured Quote <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" id="pQuote" name="quote"><?php if (isset($postQuote)) { echo $postQuote;} ?></textarea>
<input type="hidden" name="is_quote" value="is_quote">
<br>
<br />
<?php endif;?>
<?php if ($type == 'is_link'):?>
Featured Link <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" name="link"><?php if (isset($postLink)) { echo $postLink;} ?></textarea>
<label for="pLink">Featured Link <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" id="pLink" name="link"><?php if (isset($postLink)) { echo $postLink;} ?></textarea>
<input type="hidden" name="is_link" value="is_link">
<br>
<br />
<?php endif;?>
<?php if ($type == 'is_post'):?>
<input type="hidden" name="is_post" value="is_post">
<?php endif;?>
<label for="wmd-input">Content</label>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error'; } } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea>
<br/>
<br />
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="publish" class="submit" value="<?php echo i18n('Publish');?>"/> <input type="submit" name="draft" class="draft" value="<?php echo i18n('Save_as_draft');?>"/>
</form>


+ 20
- 13
system/admin/views/add-page.html.php View File

@ -1,5 +1,5 @@
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
@ -14,21 +14,28 @@
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span>
<br>
<input type="text" class="text <?php if (isset($postTitle)) {if (empty($postTitle)) {echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) {echo $postTitle;} ?>"/>
<br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) {echo $postUrl;} ?>"/>
<br>
<label for="pTitle">Title <span class="required">*</span></label>
<br />
<input type="text" class="text <?php if (isset($postTitle)) {if (empty($postTitle)) {echo 'error';}} ?>" id="pTitle" name="title" value="<?php if (isset($postTitle)) {echo $postTitle;} ?>"/>
<br /><br />
<?php if ($type == 'is_page') :?>
<label for="pURL">Url (optional)</label>
<br />
<input type="text" class="text" id="pURL" name="url" value="<?php if (isset($postUrl)) {echo $postUrl;} ?>"/>
<br />
<span class="help">If the url leave empty we will use the page title.</span>
<br><br>
Meta Description (optional)
<br>
<textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) {echo $p->description;} ?></textarea>
<br><br>
<br /><br />
<label for="pMeta">Meta Description (optional)</label>
<br />
<textarea id="pMeta" name="description" rows="3" cols="20"><?php if (isset($p->description)) {echo $p->description;} ?></textarea>
<br /><br />
<?php endif;?>
<label for="wmd-input">Content</label>
<?php if ($type == 'is_page') :?>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<?php endif;?>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {if (empty($postContent)) {echo 'error';}} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) {echo $postContent;} ?></textarea>
<br/>
<br />
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($type == 'is_page') :?>
<input type="submit" name="submit" class="submit" value="Publish"/>


+ 1
- 1
system/admin/views/config.html.php View File

@ -41,7 +41,7 @@
foreach ($array as $key => $value) {
echo '<tr>';
echo '<td><label for="' . $key . '">' . $key . '</label></td>';
echo '<td><input type="text" name="-config-' . $key . '" value="' . valueMaker($value) . '"></td>';
echo '<td><input type="text" id="' . $key . '" name="-config-' . $key . '" value="' . valueMaker($value) . '"></td>';
echo '</tr>';
}
?>


+ 54
- 48
system/admin/views/edit-content.html.php View File

@ -56,7 +56,7 @@ if (config('permalink.type') == 'post') {
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
@ -71,78 +71,84 @@ if (config('permalink.type') == 'post') {
<div class="wmd-panel">
<form method="POST">
<?php echo i18n('Title');?> <span class="required">*</span>
<br>
<input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';} } ?>" value="<?php echo $oldtitle ?>"/>
<br><br>
<?php echo i18n('Category');?> <span class="required">*</span>
<br>
<select name="category">
<label for="pTitle"><?php echo i18n('Title');?> <span class="required">*</span></label>
<br />
<input autofocus type="text" id="pTitle" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';} } ?>" value="<?php echo $oldtitle ?>"/>
<br /><br />
<label for="pCategory"><?php echo i18n('Category');?> <span class="required">*</span></label>
<br />
<select id="pCategory" name="category">
<option value="uncategorized"><?php echo i18n("Uncategorized");?></option>
<?php foreach ($desc as $d):?>
<option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option>
<?php endforeach;?>
</select>
<br><br>
Tag <span class="required">*</span><br>
<input type="text" name="tag" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error'; } } ?>" value="<?php echo $oldtag ?>"/><br><br>
Url (optional)<br>
<input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/>
<br>
</select>
<br /><br />
<label for="pTag">Tag <span class="required">*</span></label>
<br />
<input type="text" id="pTag" name="tag" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error'; } } ?>" value="<?php echo $oldtag ?>"/><br /><br />
<label for="pURL">Url (optional)</label>
<br />
<input type="text" id="pURL" name="url" class="text" value="<?php echo $oldmd ?>"/>
<br />
<span class="help">If the url leave empty we will use the post title.</span>
<br><br>
Year, Month, Day<br>
<input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>">
<br>
Hour, Minute, Second<br>
<input step="1" type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>">
<br><br>
Meta Description (optional)<br>
<textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description; } else { echo $olddescription;} ?></textarea>
<br><br>
<br /><br />
<label for="pDate">Year, Month, Day</label>
<br />
<input type="date" id="pDate" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>">
<br />
<label for="pTime">Hour, Minute, Second</label>
<br />
<input step="1" type="time" id="pTime" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>">
<br /><br />
<label for="pMeta">Meta Description (optional)</label>
<br />
<textarea id="pMeta" name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description; } else { echo $olddescription;} ?></textarea>
<br /><br />
<?php if ($type == 'is_audio'):?>
Featured Audio <span class="required">*</span> (SoundCloud Only)
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" name="audio"><?php echo $oldaudio; ?></textarea>
<label for="pAudio">Featured Audio <span class="required">*</span> (SoundCloud Only)</label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" id="pAudio" name="audio"><?php echo $oldaudio; ?></textarea>
<input type="hidden" name="is_audio" value="is_audio">
<?php endif;?>
<?php if ($type == 'is_video'):?>
Featured Video <span class="required">*</span> (Youtube Only)
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" name="video"><?php echo $oldvideo ?></textarea>
<label for="pVideo">Featured Video <span class="required">*</span> (Youtube Only)</label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" id="pVideo" name="video"><?php echo $oldvideo ?></textarea>
<input type="hidden" name="is_video" value="is_video">
<?php endif;?>
<?php if ($type == 'is_image'):?>
Featured Image <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" name="image"><?php echo $oldimage; ?></textarea>
<label for="pImage">Featured Image <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" id="pImage" name="image"><?php echo $oldimage; ?></textarea>
<input type="hidden" name="is_image" value="is_image">
<?php endif;?>
<?php if ($type == 'is_quote'):?>
Featured Quote <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" name="quote"><?php echo $oldquote ?></textarea>
<label for="pQuote">Featured Quote <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" id="pQuote" name="quote"><?php echo $oldquote ?></textarea>
<input type="hidden" name="is_quote" value="is_quote">
<?php endif;?>
<?php if ($type == 'is_link'):?>
Featured Link <span class="required">*</span>
<br>
<textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" name="link"><?php echo $oldlink ?></textarea>
<label for="pLink">Featured Link <span class="required">*</span></label>
<br />
<textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" id="pLink" name="link"><?php echo $oldlink ?></textarea>
<input type="hidden" name="is_link" value="is_link">
<?php endif;?>
<?php if ($type == 'is_post'):?>
<input type="hidden" name="is_post" value="is_post">
<?php endif;?>
<br>
<br />
<label for="wmd-input">Content</label>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error'; } } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea>
<br>
<br />
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[4] == 'draft') { ?>


+ 15
- 10
system/admin/views/edit-page.html.php View File

@ -64,7 +64,7 @@ if ($type == 'is_frontpage') {
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
<script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
@ -79,20 +79,25 @@ if ($type == 'is_frontpage') {
<div class="wmd-panel">
<form method="POST">
<?php echo i18n('Title');?> <span class="required">*</span>
<br>
<input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error'; } } ?>" value="<?php echo $oldtitle ?>"/><br><br>
<label for="pTitle"><?php echo i18n('Title');?> <span class="required">*</span></label>
<br />
<input type="text" id="pTitle" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error'; } } ?>" value="<?php echo $oldtitle ?>"/><br /><br />
<?php if($type != 'is_frontpage' && $type != 'is_profile') { ?>
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/>
<br>
<label for="pURL">Url (optional)</label>
<br />
<input type="text" id="pURL" name="url" class="text" value="<?php echo $oldmd ?>"/>
<br />
<span class="help">If the url leave empty we will use the page title.</span>
<br><br>
<?php echo i18n('Meta_description');?> (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description;} else {echo $olddescription;}?></textarea>
<br><br>
<br /><br />
<label for="pMeta"><?php echo i18n('Meta_description');?> (optional)</label>
<br />
<textarea id="pMeta" name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description;} else {echo $olddescription;}?></textarea>
<br /><br />
<?php } ?>
<label for="wmd-input">Content</label>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {if (empty($postContent)) {echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea>
<br>
<br />
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if($type == 'is_frontpage' || $type == 'is_profile') { ?>
<input type="submit" name="submit" class="submit" value="Save"/>


+ 3
- 1
system/admin/views/popular-posts.html.php View File

@ -6,7 +6,8 @@
<th><?php echo i18n('Published');?></th><?php if (config("views.counter") == "true"): ?>
<th><?php echo i18n('Views');?></th><?php endif; ?>
<th><?php echo i18n('Author');?></th>
<th><?php echo i18n('Tag');?></th>
<th><?php echo i18n('Category');?></th>
<th><?php echo i18n('Tags');?></th>
<th><?php echo i18n('Operations');?></th>
</tr>
<?php $i = 0;
@ -28,6 +29,7 @@
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><a target="_blank" href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></td>
<td><?php echo $p->category ?></td>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/posts">Edit</a> <a
href="<?php echo $p->url ?>/delete?destination=admin/posts">Delete</a></td>


+ 3
- 1
system/admin/views/posts-list.html.php View File

@ -6,7 +6,8 @@
<th><?php echo i18n('Published');?></th><?php if (config("views.counter") == "true"): ?>
<th>Views</th><?php endif; ?>
<th><?php echo i18n('Author');?></th>
<th><?php echo i18n('Tag');?></th>
<th><?php echo i18n('Category');?></th>
<th><?php echo i18n('Tags');?></th>
<th><?php echo i18n('Operations');?></th>
</tr>
<?php $i = 0;
@ -28,6 +29,7 @@
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><a target="_blank" href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></td>
<td><?php echo $p->category ?></td>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/posts"><?php echo i18n('Edit');?></a> <a
href="<?php echo $p->url ?>/delete?destination=admin/posts"><?php echo i18n('Delete');?></a></td>


+ 3
- 1
system/admin/views/user-draft.html.php View File

@ -4,7 +4,8 @@
<tr class="head">
<th><?php echo i18n('Title');?></th>
<th><?php echo i18n('Created');?></th>
<th><?php echo i18n('Tag');?></th>
<th><?php echo i18n('Category');?></th>
<th><?php echo i18n('Tags');?></th>
<th><?php echo i18n('Operations');?></th>
</tr>
<?php $i = 0;
@ -23,6 +24,7 @@
<tr class="<?php echo $class ?>">
<td><?php echo $p->title ?></td>
<td><?php echo format_date($p->date) ?></td>
<td><?php echo strip_tags($p->category) ?></td>
<td><?php echo strip_tags($p->tag) ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/draft"><?php echo i18n('Edit');?></a> <a href="<?php echo $p->url ?>/delete?destination=admin/draft"><?php echo i18n('Delete');?></a></td>
</tr>


+ 3
- 1
system/admin/views/user-posts.html.php View File

@ -7,7 +7,8 @@
<?php if (config("views.counter") == "true"): ?>
<th>Views</th>
<?php endif; ?>
<th><?php echo i18n('Tag');?></th>
<th><?php echo i18n('Category');?></th>
<th><?php echo i18n('Tags');?></th>
<th><?php echo i18n('Operations');?></th>
</tr>
<?php $i = 0;
@ -29,6 +30,7 @@
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td>
<?php endif; ?>
<td><?php echo $p->category ?></td>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/mine">Edit</a> <a href="<?php echo $p->url ?>/delete?destination=admin/mine"><?php echo i18n('Delete');?></a></td>
</tr>


+ 175
- 171
system/includes/functions.php
File diff suppressed because it is too large
View File


+ 21
- 6
system/resources/css/toolbar.css View File

@ -2,6 +2,22 @@ body {
padding-top: 30px
}
.admin-front .tb-admin,
.all-posts .tb-posts,
.admin-popular .tb-popular,
.admin-mine .tb-mine,
.admin-draft .tb-draft,
.admin-content .tb-addcontent,
.admin-categories .tb-categories,
.edit-profile .tb-editprofile,
.admin-import .tb-import,
.admin-backup .tb-backup,
.admin-config .tb-config,
.admin-clear-cache .tb-clearcache,
.admin-update .tb-update {
background:#400;
}
#toolbar {
background: #666;
box-shadow: 0 5px 15px #000;
@ -23,16 +39,16 @@ body {
#toolbar ul {
margin: 0;
padding-top: 5px;
padding-bottom: 5px;
padding: 0;
padding-left: 30px;
float: left
}
#toolbar ul li, #toolbar ul li a {
float: left;
display:inline-block;
list-style: none;
margin: 0
margin: 0;
height: 30px;
line-height: 30px;
}
#toolbar a {
@ -41,7 +57,6 @@ body {
text-decoration: none;
border-radius: 10px;
padding: 0 10px;
line-height: 1.6
}
@media all and (max-width: 550px) {


Loading…
Cancel
Save