-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_upload.php
278 lines (150 loc) · 6.54 KB
/
video_upload.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
session_start();
$function_out = strcmp($_SESSION['usertype'], '1');
if(!isset($_SESSION['id']))
{
header('location: login.php');
exit;
}
else
{
if($function_out == 0)
{
header("location: home.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EventsWave</title>
<link rel="icon" href="assets/images/event_accepted_50px.png" type="image/icon type">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous"/>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/section.css">
<link rel="stylesheet" href="assets/css/posting.css">
<link rel="stylesheet" href="assets/css/right_col.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<link rel="stylesheet" href="assets/css/camara-upload.css">
<link rel="stylesheet" href="assets/css/links.css">
<link rel="stylesheet" href="notifast/notifast.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<nav class="navbar">
<div class="nav-wrapper">
<img src="assets/images/black_logo.png" class="brand-img" id="logo-img">
<div class="nav-items">
<a href="Events.php" style="text-decoration: none; color: #1c1f23"><i class="icon fas fa-flag fa-lg"></i></a>
<a href="shorts.php" style="text-decoration: none; color: #1c1f23"><i class="icon fas fa-video fa-lg"></i></a>
<i class="icon fas fa-calendar-alt fa-lg"></i>
<div class="icon user-profile">
<a href="my_Profile.php" ><i class="fas fa-user-circle fa-lg"></i></a>
</div>
</div>
</div>
</nav>
<br><br><br>
<!-- Using Bootstrap Grid System -->
<div class="container">
<div class="row">
<div class="col">
<div class="mb-5">
<form action="video_uploader.php" method="POST" enctype="multipart/form-data">
<div class="form-group">
<h1 class="profile-user-name" style="font-size: 2rem;font-weight: 300;">Publish Your Short Video</h1>
</div><br>
<div class="form-group">
<label for="caption">What On Your Mind : </label>
<!--<input type="text" class="form-control" id="caption" aria-describedby="caption-area" placeholder="caption here" onchange="get_caption();" name="caption">-->
<textarea type="text" class="form-control mt-2" id="caption" rows="4" placeholder="caption here" onchange="get_caption();" name="caption" maxlength="500"></textarea>
</div><br>
<div class="form-group">
<label for="tag-id">Hash Tags : </label>
<input type="text" class="form-control mt-2" id="tag-id" aria-describedby="caption-area" placeholder="Hash Tags" onchange="get_hash();" name="hash-tags" maxlength="50">
</div><br>
<div class="form-group" id="vid-group">
<label for="tag-id">Add video : </label>
<input id="max_id" type="hidden" name="MAX_FILE_SIZE" value="20971520" />
<input class="form-control mt-2" type="file" id="file" name="file" onchange="upload_check()" accept="video/*">
</div><br>
<div class="form-group">
<label for="tag-id">Add video Thumbnail : </label>
<input class="form-control mt-2" type="file" id="file_thumb" name="thumbnail" accept="image/png, image/gif, image/jpeg">
</div>
<br>
<div class="form-group">
<input type="submit" class="btn btn-primary" name="posting" value="Publish Video">
<button onclick="clearImage()" class="btn btn-primary">Clear Preview</button>
</div>
</form>
</div>
</div>
<div class="col d-none d-lg-block">
<h1 class="profile-user-name" style="font-size: 2rem;font-weight: 300;">Preview Post</h1><br>
<?php if(isset($_GET['error_message'])){ ?>
<?php
$message = $_GET['error_message'];
echo"<body onload='notification_function(`Error Message`, `$message`, `#da1857`);'</body>"
?>
<?php }?>
<?php if(isset($_GET['success_message'])){ ?>
<?php
$message = $_GET['success_message'];
echo"<body onload='notification_function(`Success Message`, `$message`, `#0F73FA`);'</body>"
?>
<?php }?>
<div class="post">
<div class="info">
<div class="user">
<div class="profile-pic"><img src="assets/images/temp_profile.webp"></div>
<p class="username">Preview Post</p>
</div>
<i class="fas fa-ellipsis-v options"></i>
</div>
<div class="ratio ratio-4x3">
<iframe src="" id="frame" title="YouTube video" allowfullscreen></iframe>
</div>
<div class="post-content">
<div class="reactions-wrapper">
<i class="icon fas fa-thumbs-up"></i>
<i class="icon fas fa-comment"></i>
</div>
<p class="description" id="caption-data">
<span>Caption : <br></span>
Description is a spoken or written account of a person, object, or event. It can also mean a type or class of people or things. Discription is not a word.
</p>
<p class="post-time" id="current-date">2022/11/5</p>
<p class="post-time" id="hash-tags" style="color: #3942e7;"><i>#hashtag #hashtags</i></p>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/preview-helper.js"> </script>
<script src="notifast/notifast.min.js"></script>
<script src="notifast/function.js"></script>
<script type="text/javascript">
document.getElementById("logo-img").onclick = function()
{
location.href = "home.php";
};
function upload_check()
{
const upl = document.getElementById("file");
const max = document.getElementById("max_id").value;
if(upl.files[0].size > max)
{
alert("File too big, Your File Must Be Under 20MB");
upl.value = "";
}
else{
preview();
}
};
</script>
</body>
</html>