Browse Source

Added linking to publish and delete on view post page.

pull/24/head
Teknikode 4 years ago
parent
commit
cbd1868127
1 changed files with 19 additions and 15 deletions
  1. 19
    15
      blog/view_post.php

+ 19
- 15
blog/view_post.php View File

@@ -31,11 +31,11 @@ if (isset($_GET['post']))
if ($author_id == $user->id || $user->admin)
{
$own_blog = true;
}
}
if ($published || $own_blog)
{
set_page_title($title);
?>
<div class="container">
@@ -54,14 +54,14 @@ if (isset($_GET['post']))
<div class="modal-body">
<input name="edit_blog_userid" id="edit_blog_userid" type="hidden" value="<?php echo $author_id; ?>" />
<input name="edit_blog_postid" id="edit_blog_postid" type="hidden" />
<div class="row">
<div class="form-group col-sm-12">
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_blog_title"><h4>Title</h4></label>
<input class="form-control" name="edit_blog_title" id="edit_blog_title" placeholder="generic click bait" title="enter a title for your post." type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_blog_post"><h4>Article</h4></label>
<textarea class="form-control" name="edit_blog_post" id="edit_blog_post" placeholder="I ate a burger today." title="enter any information you want to share with the world." data-provide="markdown" rows="10"></textarea>
</div>
@@ -144,16 +144,16 @@ if (isset($_GET['post']))
<label for="comment_post"><h4>Comment</h4></label>
<textarea class="form-control wmd-input" name="comment_post" id="comment_post" placeholder="Nice post!" title="enter what you think about the post." data-provide="markdown" rows="10"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="comment_submit">Publish</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>

<div class="modal fade" id="editComment" tabindex="-1" role="dialog" aria-labelledby="editCommentLabel" aria-hidden="true">
<div class="modal-dialog">
@@ -170,16 +170,16 @@ if (isset($_GET['post']))
<label for="edit_comment_post"><h4>Comment</h4></label>
<textarea class="form-control" name="edit_comment_post" id="edit_comment_post" placeholder="What an interesting article!" title="enter what you thought about the article." data-provide="markdown" rows="10"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="edit_comment_submit">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
@@ -196,6 +196,10 @@ if (isset($_GET['post']))
var new_post = converter.makeHtml(old_post);
$("#post_<?php echo $post_id; ?>").html(new_post);

linkPostDelete('.delete_post');
linkPostPublish('.publish_post');
linkPostUnpublish('.unpublish_post');

var posts = <?php echo $comments_per_load; ?>;
var start_post = 0;
var view_post_id = <?php echo $post_num; ?>;

Loading…
Cancel
Save