-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog-edit-post.php
211 lines (195 loc) · 10.8 KB
/
blog-edit-post.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
require_once 'app/init.php';
if (!Auth::check())
redirect_to(App::url());
/**
*
* This is the edit blog page, the blog page id is retrieved through URL with 'blogpost_id'
*
*/
use Hazzard\Support\MessageBag;
$userID = Auth::user()->id;
if (isset($_GET['blogpostid']) && csrf_filter()) {
if (isset($_GET['blogpostid'])) {
$blogPostID = $_GET['blogpostid'];
}
else{
redirect_to(App::url());
}
}
$post_link = BlogContent::get($userID, $blogPostID, 'link', true);
$post_title = BlogContent::get($userID, $blogPostID, 'title', true);
$post_status = BlogContent::get($userID, $blogPostID, 'status', true);
$post_visability = BlogContent::get($userID, $blogPostID, 'visability', true);
$post_publish = BlogContent::get($userID, $blogPostID, 'publish_date', true);
$post_seo_checked = BlogContent::get($userID, $blogPostID, 'seo_checked', true);
$post_seo_status = BlogContent::get($userID, $blogPostID, 'seo_status', true);
$post_seo_title = BlogContent::get($userID, $blogPostID, 'seo_title', true);
$post_seo_description = BlogContent::get($userID, $blogPostID, 'seo_description', true);
$post_images = BlogContent::get($userID, $blogPostID, 'images', true);
$post_images_featured = BlogContent::get($userID, $blogPostID, 'images_featured', true);
$post_body = BlogContent::get($userID, $blogPostID, 'body', true);
$post_category = BlogContent::get($userID, $blogPostID, 'category', true);
include 'inc/builder/config.php';
include 'inc/builder/template_start.php';
include 'inc/builder/page_head.php';
?>
<!-- blog content -->
<div id="page-content">
<div class="row">
<div class="col-lg-8">
<!-- General Data Title -->
<!-- END General Data Title -->
<!-- General Data Content -->
<div class="form-group">
<div class="col-md-12 pull-right">
<h3>Add a New Blog Post</h3>
<input form="main" type="text" id="blog-title" name="title" class="form-control input-lg" placeholder="Enter title here" value="<?php if(!isset($post_title)) echo $post_title; ?>">
<p style="padding-left: 20px;margin-top: 10px;margin-bottom: 0px;">Link to blog post: <strong><?php if(!isset($post_link)) echo $post_link; ?></strong> <button type="button" class="btn btn-xs btn-default">Edit</button><button type="button" class="btn btn-xs btn-default">View blog</button></p>
</div>
</div>
<div class="col-md-12">
<div class="btn-group">
<button class="btn btn-primary"><i class="gi gi-flash"></i></button>
<button class="btn btn-primary"><i class="fa fa-arrow-left"></i> Backend Editor</button>
<button class="btn btn-primary">Frontend Editor <i class="fa fa-arrow-right"></i></button>
</div>
<br>
<br>
<button type="button" class="btn btn-sm btn-default"><i class="gi gi-camera"></i> Insert Media</button>
<div class="form-group">
<textarea form="main" name="body" id="body" class="ckeditor"></textarea>
</div>
</div>
<!-- END General Data Content -->
</div>
<div class="col-lg-4 pull-right">
<!-- Meta Data Block -->
<div class="block">
<!-- Meta Data Title -->
<div class="block-title">
<h2>Publish</h2>
</div>
<p><i class="gi gi-pin"></i> Status: <?php if(!isset($post_status)){ echo $post_status;}else{ echo "Draft";} ?> <a>Edit</a></p>
<p><i class="gi gi-eye_open"></i> Visability: <?php if(!isset($post_visability)){ echo $post_visability;}else{ echo "Not Published";} ?> <a>Edit</a></p>
<p><i class="gi gi-calendar"></i> Publish: <?php if(!isset($post_publish)){ echo $post_publish;}else{ echo "Publish Immediately";} ?> <a>Edit</a></p>
<p><i class="gi gi-vector_path_circle"></i> SEO: <?php if(!isset($post_seo_status)){ echo $post_seo_status;}else{ echo "Draft";} ?> <a>Check</a></p><p><i class="gi gi-vector_path_circle"></i> Category: <?php if(!isset($post_category)){ echo $post_category;}else{ echo "Default";} ?> <a>Edit</a></p>
<!-- END Meta Data Title -->
<!-- Meta Data Content -->
<form action="" method="post" class="form-horizontal form-bordered" id="main">
<div class="form-group form-actions">
<div class="col-md-9 col-md-offset-3">
<button type="button" class="btn btn-sm btn-info">Save</button>
<button type="button" class="btn btn-sm btn-warning">Preview</button>
<button type="submit" class="btn btn-sm btn-primary" name="addnew">Publish</button>
</div>
</div>
</form>
<!-- END Meta Data Content -->
</div>
<!-- Meta Data Block -->
<div class="block">
<!-- Meta Data Title -->
<div class="block-title">
<h2><strong>SEO</strong> blog Settings</h2>
</div>
<!-- END Meta Data Title -->
<div class="row">
<div class="col-md-12">
<!-- Meta Data Content -->
<div class="form-group">
<label class="col-md-3 control-label" for="eta-title">Meta Title</label>
<div class="col-md-9">
<input form="main" type="text" id="meta-title" name="meta_title" class="form-control" placeholder="Enter meta title.." value="<?php if(!isset($post_seo_title)) echo $post_seo_title; ?>">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="meta-description">Meta Description</label>
<div class="col-md-9">
<textarea id="meta-description" name="meta_description" class="form-control" rows="6" placeholder="Enter meta description.." value="<?php if(!isset($post_seo_description)) echo $post_seo_description; ?>"></textarea>
<div class="help-block">157 Characters Max Reccomended</div>
</div>
</div>
<!-- END Meta Data Content -->
<!-- END Meta Data Block --> </div>
</div>
</div>
<!-- Product Images Block -->
<div class="block">
<!-- Product Images Title -->
<div class="block-title">
<h2><i class="fa fa-picture-o"></i> <strong>Featured</strong> Images</h2>
</div>
<!-- END Product Images Title -->
<!-- Product Images Content -->
<div class="block-section">
<!-- Dropzone.js, You can check out https://github.com/enyo/dropzone/wiki for usage examples -->
<form action="blog_ecom_product_edit.php" class="dropzone"></form>
</div>
<table class="table table-bordered table-striped table-vcenter">
<tbody>
<tr>
<td style="width: 20%;">
<a href="img/placeholders/photos/photo11.jpg" data-toggle="lightbox-image">
<img src="img/placeholders/photos/photo11.jpg" alt="" class="img-responsive center-block" style="max-width: 110px;">
</a>
</td>
<td class="text-center">
<label class="switch switch-primary">
<input form="main" type="checkbox" checked><span></span>
</label>
Cover
</td>
<td class="text-center">
<a href="javascript:void(0)" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i> Delete</a>
</td>
</tr>
<tr>
<td>
<a href="img/placeholders/photos/photo13.jpg" data-toggle="lightbox-image">
<img src="img/placeholders/photos/photo13.jpg" alt="" class="img-responsive center-block" style="max-width: 110px;">
</a>
</td>
<td class="text-center">
<label class="switch switch-primary">
<input form="main" type="checkbox"><span></span>
</label>
Cover
</td>
<td class="text-center">
<a href="javascript:void(0)" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i> Delete</a>
</td>
</tr>
<tr>
<td>
<a href="img/placeholders/photos/photo9.jpg" data-toggle="lightbox-image">
<img src="img/placeholders/photos/photo9.jpg" alt="" class="img-responsive center-block" style="max-width: 110px;">
</a>
</td>
<td class="text-center">
<label class="switch switch-primary">
<input form="main" type="checkbox"><span></span>
</label>
Cover
</td>
<td class="text-center">
<a href="javascript:void(0)" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i> Delete</a>
</td>
</tr>
</tbody>
</table>
<!-- END Product Images Content -->
</div>
<!-- END Product Images Block -->
</div>
</div>
<!-- END Product Edit Content -->
</div>
<!-- END blog Content -->
<?php include 'inc/footer_website.php'; ?>
<!-- Remember to include excanvas for IE8 chart support -->
<!--[if IE 8]><script src="js/helpers/excanvas.min.js"></script><![endif]-->
<?php include 'inc/template_scripts.php'; ?>
<!-- ckeditor.js, load it only in the blog you would like to use CKEditor (it's a heavy plugin to include it with the others!) -->
<script src="js/helpers/ckeditor/ckeditor.js"></script>
<?php include 'inc/template_end.php'; ?>