@@ -10,9 +10,9 @@ |
||
10 | 10 | class video_helper { |
11 | 11 | public $__db; |
12 | 12 | |
13 | - public function __construct($conn){ |
|
13 | + public function __construct($conn){ |
|
14 | 14 | $this->__db = $conn; |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | 17 | function fetch_video_views(string $id) { |
18 | 18 | $stmt = $this->__db->prepare("SELECT * FROM views WHERE videoid = ?"); |
@@ -25,9 +25,9 @@ |
||
25 | 25 | |
26 | 26 | // sorry pdo doesnt cworkd i cant get it 2 work |
27 | 27 | $__db = new mysqli($__server->db_properties->db_host, |
28 | - $__server->db_properties->db_user, |
|
29 | - $__server->db_properties->db_password, |
|
30 | - $__server->db_properties->db_database); |
|
28 | + $__server->db_properties->db_user, |
|
29 | + $__server->db_properties->db_password, |
|
30 | + $__server->db_properties->db_database); |
|
31 | 31 | |
32 | 32 | if(!$__db->connect_error) { |
33 | 33 | $__server->db_properties->db_connected = true; |
@@ -138,17 +138,17 @@ discard block |
||
138 | 138 | </div> |
139 | 139 | <div class="browse-item-row ytg-box"> |
140 | 140 | <?php |
141 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
142 | - $stmt->execute(); |
|
143 | - $result = $stmt->get_result(); |
|
144 | - while($video = $result->fetch_assoc()) { |
|
145 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
146 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
147 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
148 | - $video['author'] = htmlspecialchars($video['author']); |
|
149 | - $video['title'] = htmlspecialchars($video['title']); |
|
150 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
151 | - ?> |
|
141 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
142 | + $stmt->execute(); |
|
143 | + $result = $stmt->get_result(); |
|
144 | + while($video = $result->fetch_assoc()) { |
|
145 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
146 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
147 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
148 | + $video['author'] = htmlspecialchars($video['author']); |
|
149 | + $video['title'] = htmlspecialchars($video['title']); |
|
150 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
151 | + ?> |
|
152 | 152 | <div class="browse-item yt-tile-default "> |
153 | 153 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
154 | 154 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -174,17 +174,17 @@ discard block |
||
174 | 174 | </div> |
175 | 175 | <div class="browse-item-row ytg-box"> |
176 | 176 | <?php |
177 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
178 | - $stmt->execute(); |
|
179 | - $result = $stmt->get_result(); |
|
180 | - while($video = $result->fetch_assoc()) { |
|
181 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
182 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
183 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
184 | - $video['author'] = htmlspecialchars($video['author']); |
|
185 | - $video['title'] = htmlspecialchars($video['title']); |
|
186 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
187 | - ?> |
|
177 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
178 | + $stmt->execute(); |
|
179 | + $result = $stmt->get_result(); |
|
180 | + while($video = $result->fetch_assoc()) { |
|
181 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
182 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
183 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
184 | + $video['author'] = htmlspecialchars($video['author']); |
|
185 | + $video['title'] = htmlspecialchars($video['title']); |
|
186 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
187 | + ?> |
|
188 | 188 | <div class="browse-item yt-tile-default "> |
189 | 189 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
190 | 190 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -210,17 +210,17 @@ discard block |
||
210 | 210 | </div> |
211 | 211 | <div class="browse-item-row ytg-box"> |
212 | 212 | <?php |
213 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
214 | - $stmt->execute(); |
|
215 | - $result = $stmt->get_result(); |
|
216 | - while($video = $result->fetch_assoc()) { |
|
217 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
218 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
219 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
220 | - $video['author'] = htmlspecialchars($video['author']); |
|
221 | - $video['title'] = htmlspecialchars($video['title']); |
|
222 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
223 | - ?> |
|
213 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
214 | + $stmt->execute(); |
|
215 | + $result = $stmt->get_result(); |
|
216 | + while($video = $result->fetch_assoc()) { |
|
217 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
218 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
219 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
220 | + $video['author'] = htmlspecialchars($video['author']); |
|
221 | + $video['title'] = htmlspecialchars($video['title']); |
|
222 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
223 | + ?> |
|
224 | 224 | <div class="browse-item yt-tile-default "> |
225 | 225 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
226 | 226 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -246,17 +246,17 @@ discard block |
||
246 | 246 | </div> |
247 | 247 | <div class="browse-item-row ytg-box"> |
248 | 248 | <?php |
249 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
250 | - $stmt->execute(); |
|
251 | - $result = $stmt->get_result(); |
|
252 | - while($video = $result->fetch_assoc()) { |
|
253 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
254 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
255 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
256 | - $video['author'] = htmlspecialchars($video['author']); |
|
257 | - $video['title'] = htmlspecialchars($video['title']); |
|
258 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
259 | - ?> |
|
249 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
250 | + $stmt->execute(); |
|
251 | + $result = $stmt->get_result(); |
|
252 | + while($video = $result->fetch_assoc()) { |
|
253 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
254 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
255 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
256 | + $video['author'] = htmlspecialchars($video['author']); |
|
257 | + $video['title'] = htmlspecialchars($video['title']); |
|
258 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
259 | + ?> |
|
260 | 260 | <div class="browse-item yt-tile-default "> |
261 | 261 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
262 | 262 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -282,17 +282,17 @@ discard block |
||
282 | 282 | </div> |
283 | 283 | <div class="browse-item-row ytg-box"> |
284 | 284 | <?php |
285 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
286 | - $stmt->execute(); |
|
287 | - $result = $stmt->get_result(); |
|
288 | - while($video = $result->fetch_assoc()) { |
|
289 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
290 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
291 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
292 | - $video['author'] = htmlspecialchars($video['author']); |
|
293 | - $video['title'] = htmlspecialchars($video['title']); |
|
294 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
295 | - ?> |
|
285 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
286 | + $stmt->execute(); |
|
287 | + $result = $stmt->get_result(); |
|
288 | + while($video = $result->fetch_assoc()) { |
|
289 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
290 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
291 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
292 | + $video['author'] = htmlspecialchars($video['author']); |
|
293 | + $video['title'] = htmlspecialchars($video['title']); |
|
294 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
295 | + ?> |
|
296 | 296 | <div class="browse-item yt-tile-default "> |
297 | 297 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
298 | 298 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -199,32 +199,32 @@ |
||
199 | 199 | |
200 | 200 | <?php |
201 | 201 | while($video = $result6->fetch_assoc()) { |
202 | - if($__video_h->video_exists($video['reciever'])) { |
|
203 | - $_video = $__video_h->fetch_video_rid($video['reciever']); |
|
204 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
205 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
206 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
207 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
208 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
209 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
210 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
211 | - |
|
212 | - if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
213 | - $status = "Corrupted"; |
|
214 | - } else if($_video['visibility'] == "v") { |
|
215 | - $status = "Approved"; |
|
216 | - } else if($_video['visibility'] == "n") { |
|
217 | - $status = "Approved"; |
|
218 | - } else if($_video['visibility'] == "o") { |
|
219 | - $status = "Disapproved"; |
|
220 | - } else { |
|
221 | - $status = "Unknown"; |
|
222 | - } |
|
202 | + if($__video_h->video_exists($video['reciever'])) { |
|
203 | + $_video = $__video_h->fetch_video_rid($video['reciever']); |
|
204 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
205 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
206 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
207 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
208 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
209 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
210 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
211 | + |
|
212 | + if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
213 | + $status = "Corrupted"; |
|
214 | + } else if($_video['visibility'] == "v") { |
|
215 | + $status = "Approved"; |
|
216 | + } else if($_video['visibility'] == "n") { |
|
217 | + $status = "Approved"; |
|
218 | + } else if($_video['visibility'] == "o") { |
|
219 | + $status = "Disapproved"; |
|
220 | + } else { |
|
221 | + $status = "Unknown"; |
|
222 | + } |
|
223 | 223 | |
224 | - if($_video['commenting'] == "a") |
|
225 | - $_video['commentstatus'] = "Commenting allowed"; |
|
226 | - else |
|
227 | - $_video['commentstatus'] = "Commenting disallowed"; |
|
224 | + if($_video['commenting'] == "a") |
|
225 | + $_video['commentstatus'] = "Commenting allowed"; |
|
226 | + else |
|
227 | + $_video['commentstatus'] = "Commenting disallowed"; |
|
228 | 228 | ?> |
229 | 229 | <tr style="margin-top: 5px;" id="videoslist"> |
230 | 230 | <td class="video-manager-left"> |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $stmt->execute(); |
96 | 96 | $result = $stmt->get_result(); |
97 | 97 | } |
98 | - ?> |
|
98 | + ?> |
|
99 | 99 | {'paging': null, 'feed_html': ` |
100 | 100 | <div class=\'feed-header no-metadata\'> |
101 | 101 | <div class=\'feed-header-thumb\'> |