@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | -if(!isset($_SESSION['siteusername'])) |
|
11 | +if (!isset($_SESSION['siteusername'])) |
|
12 | 12 | header('Location: ' . $_SERVER['HTTP_REFERER'] . '&error=You have to be logged in to report videos.'); |
13 | 13 | |
14 | 14 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | "username" => str_replace("@", "", $_SESSION['siteusername']), |
22 | 22 | // "avatar_url" => "https://subrock.rocks/dynamic/pfp/", |
23 | 23 | "tts" => false, |
24 | -], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); |
|
24 | +], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
|
25 | 25 | |
26 | -$ch = curl_init( $webhookurl ); |
|
27 | -curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); |
|
28 | -curl_setopt( $ch, CURLOPT_POST, 1); |
|
29 | -curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data); |
|
30 | -curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); |
|
31 | -curl_setopt( $ch, CURLOPT_HEADER, 0); |
|
32 | -curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); |
|
26 | +$ch = curl_init($webhookurl); |
|
27 | +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); |
|
28 | +curl_setopt($ch, CURLOPT_POST, 1); |
|
29 | +curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); |
|
30 | +curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
|
31 | +curl_setopt($ch, CURLOPT_HEADER, 0); |
|
32 | +curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
33 | 33 | |
34 | -$response = curl_exec( $ch ); |
|
35 | -curl_close( $ch ); |
|
34 | +$response = curl_exec($ch); |
|
35 | +curl_close($ch); |
|
36 | 36 | header('Location: ' . $_SERVER['HTTP_REFERER'] . '&success=Successfully reported this video.'); |
37 | 37 | ?> |
38 | 38 | \ No newline at end of file |
@@ -8,8 +8,9 @@ |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | -if(!isset($_SESSION['siteusername'])) |
|
11 | +if(!isset($_SESSION['siteusername'])) { |
|
12 | 12 | header('Location: ' . $_SERVER['HTTP_REFERER'] . '&error=You have to be logged in to report videos.'); |
13 | +} |
|
13 | 14 | |
14 | 15 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
15 | 16 | $webhookurl = $__server->discord_webhook; |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
11 | + $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | 15 | ?> |
16 | 16 | <!DOCTYPE html> |
17 | 17 | <html> |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | </div> |
62 | 62 | <div class="guide"> |
63 | 63 | <?php |
64 | - if(isset($_SESSION['siteusername'])) { |
|
65 | - ?> |
|
64 | + if(isset($_SESSION['siteusername'])) { |
|
65 | + ?> |
|
66 | 66 | <div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata"> |
67 | 67 | <a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel |
68 | 68 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a> |
@@ -225,16 +225,16 @@ discard block |
||
225 | 225 | </p> |
226 | 226 | <ul> |
227 | 227 | <?php |
228 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
|
229 | - $stmt->execute(); |
|
230 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
231 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
232 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
233 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
234 | - $video['author'] = htmlspecialchars($video['author']); |
|
235 | - $video['title'] = htmlspecialchars($video['title']); |
|
236 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
237 | - ?> |
|
228 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
|
229 | + $stmt->execute(); |
|
230 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
231 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
232 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
233 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
234 | + $video['author'] = htmlspecialchars($video['author']); |
|
235 | + $video['title'] = htmlspecialchars($video['title']); |
|
236 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
237 | + ?> |
|
238 | 238 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
239 | 239 | <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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
240 | 240 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -248,16 +248,16 @@ discard block |
||
248 | 248 | </h3> |
249 | 249 | <ul> |
250 | 250 | <?php |
251 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
|
252 | - $stmt->execute(); |
|
253 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
254 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
255 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
256 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
257 | - $video['author'] = htmlspecialchars($video['author']); |
|
258 | - $video['title'] = htmlspecialchars($video['title']); |
|
259 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
260 | - ?> |
|
251 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
|
252 | + $stmt->execute(); |
|
253 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
254 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
255 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
256 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
257 | + $video['author'] = htmlspecialchars($video['author']); |
|
258 | + $video['title'] = htmlspecialchars($video['title']); |
|
259 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
260 | + ?> |
|
261 | 261 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
263 | 263 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -281,16 +281,16 @@ discard block |
||
281 | 281 | <div class="feed-page"> |
282 | 282 | <ul> |
283 | 283 | <?php |
284 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
|
285 | - $stmt->execute(); |
|
286 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
287 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
288 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
289 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
290 | - $video['author'] = htmlspecialchars($video['author']); |
|
291 | - $video['title'] = htmlspecialchars($video['title']); |
|
292 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
293 | - ?> |
|
284 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
|
285 | + $stmt->execute(); |
|
286 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
287 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
288 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
289 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
290 | + $video['author'] = htmlspecialchars($video['author']); |
|
291 | + $video['title'] = htmlspecialchars($video['title']); |
|
292 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
293 | + ?> |
|
294 | 294 | <li> |
295 | 295 | <div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw"> |
296 | 296 | <div class="feed-author-bubble-container"> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | <div id="content"> |
43 | 43 | <div class="guide-layout-container enable-fancy-subscribe-button"> |
44 | 44 | <div class="guide-container"> |
45 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
45 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
46 | 46 | <div id="guide-builder-promo"> |
47 | 47 | <h2> |
48 | 48 | Sign in to add channels to your homepage |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | </div> |
62 | 62 | <div class="guide"> |
63 | 63 | <?php |
64 | - if(isset($_SESSION['siteusername'])) { |
|
64 | + if (isset($_SESSION['siteusername'])) { |
|
65 | 65 | ?> |
66 | 66 | <div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata"> |
67 | 67 | <a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | </span> |
173 | 173 | </a> |
174 | 174 | </li> |
175 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
176 | - <?php foreach($__server->featured_channels as $channel) { ?> |
|
175 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
176 | + <?php foreach ($__server->featured_channels as $channel) { ?> |
|
177 | 177 | <li class="guide-item-container "> |
178 | 178 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
179 | 179 | <span class="thumb"> <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $stmt = $__db->prepare("SELECT * FROM subscribers WHERE sender = :username ORDER BY id DESC LIMIT 20"); |
189 | 189 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
190 | 190 | $stmt->execute(); |
191 | - while($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
191 | + while ($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
192 | 192 | <li class="guide-item-container "> |
193 | 193 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
194 | 194 | <span class="thumb"> <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <?php |
228 | 228 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
229 | 229 | $stmt->execute(); |
230 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
230 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
231 | 231 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
232 | 232 | $video['duration'] = $__time_h->timestamp($video['duration']); |
233 | 233 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | <?php |
251 | 251 | $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
252 | 252 | $stmt->execute(); |
253 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
253 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
254 | 254 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
255 | 255 | $video['duration'] = $__time_h->timestamp($video['duration']); |
256 | 256 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | <?php |
284 | 284 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
285 | 285 | $stmt->execute(); |
286 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
286 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
287 | 287 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
288 | 288 | $video['duration'] = $__time_h->timestamp($video['duration']); |
289 | 289 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |