-
Notifications
You must be signed in to change notification settings - Fork 5
/
new-post.php
102 lines (96 loc) · 3.61 KB
/
new-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
<?php
require_once('funs.php');
session_start();
check_session();
$session_name = $_SESSION['username'];
$row = array();
$row = get_member_data($session_name);
$id = $row['id'];
$name = $row['name'];
$role = $row['role'];
$pic = $row['pic'];
$last_login = $row['last_login'];
$last_login = date('jS M Y H:i', strtotime($last_login));
$total_members = get_all_status();
$core_members = get_vip_status();
$total_sessions = total_sessions();
$completed_sessions = completed_sessions();
starter($id,$name,$role,$pic,$last_login,$total_members,$core_members,$total_sessions,$completed_sessions);
?>
<div class="row">
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-home" aria-hidden="true"></i></a></li>
<li><a href="blog-home.php">Blog</a></li>
<li class="active">New Post</li>
</ol>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">New Blog Post</h1>
</div>
</div><!--/.row-->
<div class="row">
<div class="error">
<?php new_post(); ?>
</div>
<div class="col-lg-12">
<form class="form-signin" method="post" action="">
<div class="col-lg-4">
<label for="postTitle">Post Title</label>
<input type="text" name="postTitle" placeholder="Post Title" class="form-control" required autofocus>
<br>
<label for="description">Post Description</label>
<textarea name="description" rows="7" cols="60" maxlength="250" placeholder="Post Description" id="description" class="form-control space" required></textarea>
<br>
<label for="content">Select Post Category</label><br>
<select class="form-control" name="cats">
<option name="Uncategorised" value="Uncategorised">Uncategorised</option>
<option name="Technology" value="Technology">Technology</option>
<option name="Lifestyle" value="Lifestyle">Lifestyle</option>
<option name="News" value="News">News</option>
<option name="Education" value="Education">Education</option>
<option name="Nature" value="Nature">Nature</option>
<option name="Health" value="Health">Health</option>
<option name="Programming" value="Programming">Programming</option>
</select>
</div>
<div class="col-lg-8">
<label for="content">Post Content</label>
<textarea name="content" placeholder="Post Content" id="content" class="form-control space" required></textarea>
<div class="text-center">
<button class="btn btn-lg btn-primary" name="publish" type="submit" id="publish">Publish Post</button>
</div>
</div>
</form>
</div>
</div><!--/.row-->
<script>
$(document).ready(function() {
$('#content').summernote({
height: 450,
onImageUpload:function(files, editor, welEditable) {
sendFile(files[0], editor, welEditable);
}
});
function sendFile(file, editor, welEditable) {
data = new FormData();
data.append("file",file);
$.ajax({
data: data,
type: "POST",
url: 'summer-upload.php',
cache: false,
contentType: false,
processData: false,
success: function(url) {
$('#content').summernote('editor.insertImage',url);
}
});
}
});
</script>
<!-- include summernote css/js-->
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.js"></script>
<?php
at_bottom();