-
Notifications
You must be signed in to change notification settings - Fork 0
/
addPost.php
79 lines (65 loc) · 2.8 KB
/
addPost.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
<?php
require_once 'core/init.php';
$title = "Creating new Post";
$user = new User();
if($user->hasPermission('banned')){
exit("you are banned");
}
if(!$user->isLoggedIn()){
Redirect::to('index.php');
exit('
<div id="container">
<div class="form-main">
<p class="coverStory">The purpose of Capture Progress is to provide a way for particular users that preform fitness related tasks to be able to share any progress online.</p>
<div class="red loginBar" > You need to login in or register</div>
<div class="form-div">
<a href="register.php" class="trans button grey"> Register</a>
<a href="login.php" class="trans mLeft button green greenB" type="submit">Log In</a>
</div>
</div>
</div>');
}
include 'includes/header.php';
echo "<div class='wrap'>";
include 'includes/nav.php';
echo "<div style='display:none' class='warning red'></div>";
?>
<div class="content">
<div class="contentCenter">
<div class="bar green">
<h1>New Post Form</h1>
</div>
<form id="ajaxRequest" data-name="insertPost.php" method="post" enctype="multipart/form-data">
<div class="form-div">
<label class="formLable" for="pTitle">Post Title</label>
<input class="feedback-input name" type="text" placeholder="Lost 5 Pounds in two weeks" name="pTitle" id="pTitle" value="" required>
<label class="formLable" for="desc">Post Description</label>
<textarea class="feedback-input summary" name="desc" placeholder="Lost 5 Pounds in two weeks, this is how it was done" id="desc" cols="30" rows="5"></textarea>
<label class="formLable" for="public">
<input type="checkbox" name="public" id="public" > Click on to make your post public ?
</label>
</div>
<div class="space"></div>
<div class="red loginBar "> You must add at least one image to a post!</div>
<div class="form-div-two">
<div class="space"></div>
<label class="formLable" for="titleOne">Image title one</label>
<input class="feedback-input image" type="text" name="titleOne" id="titleOne" required>
<input name="userfile[]" type="file" required/><br />
<div class="space"></div>
<label class="formLable" for="titleTwo"><br>The last two Images are Optional! <br><br>Image title two</label>
<input class="feedback-input image" type="text" name="titleTwo" id="titleTwo" >
<input name="userfile[]" type="file"/>
<div class="space"></div>
<label class="formLable" for="titleThree">Image title three</label>
<input class="feedback-input image" type="text" name="titleThree" id="titleThree" >
<input name="userfile[]" type="file" /><br />
<input class="button green greenB" type="submit" value="Create Post" />
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
</div>
</form>
</div>
</div>
</div>
</body>
</html>