@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | <?php $__user_h = new user_helper($__db); ?> |
| 9 | 9 | <?php $__db_h = new db_helper(); ?> |
| 10 | 10 | <?php $__time_h = new time_helper(); ?> |
| 11 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 11 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 12 | 12 | <?php |
| 13 | 13 | $__server->page_embeds->page_title = "SubRocks - Upload Video"; |
| 14 | 14 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | <b>Category</b> <br> |
| 97 | 97 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
| 98 | 98 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
| 99 | - <?php foreach($categories as $categoryTag) { ?> |
|
| 99 | + <?php foreach ($categories as $categoryTag) { ?> |
|
| 100 | 100 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
| 101 | 101 | <?php } ?> |
| 102 | 102 | </select><br><br> |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | <?php $__user_h = new user_helper($__db); ?> |
| 8 | 8 | <?php $__db_h = new db_helper(); ?> |
| 9 | 9 | <?php $__time_h = new time_helper(); ?> |
| 10 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 10 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 11 | 11 | <?php |
| 12 | 12 | $__server->page_embeds->page_title = "SubRocks - Subscriptions"; |
| 13 | 13 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | ?> |
| 164 | 164 | |
| 165 | 165 | <div class="my_videos_ajax"> |
| 166 | - <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
| 166 | + <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
| 167 | 167 | <div style="width: 33%;display: inline-block;"> |
| 168 | 168 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>"> |
| 169 | 169 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;"> |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
| 14 | 14 | $__server->page_embeds->page_url = "https://subrock.rocks/"; |
| 15 | 15 | ?> |
| 16 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 16 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 17 | 17 | <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?> |
| 18 | 18 | <!DOCTYPE html> |
| 19 | 19 | <html dir="ltr"> |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | <b>Category</b> <br> |
| 178 | 178 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
| 179 | 179 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
| 180 | - <?php foreach($categories as $categoryTag) { ?> |
|
| 180 | + <?php foreach ($categories as $categoryTag) { ?> |
|
| 181 | 181 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
| 182 | 182 | <?php } ?> |
| 183 | 183 | </select><br><br> |
@@ -18,17 +18,17 @@ |
||
| 18 | 18 | "username" => str_replace("@", "", $_SESSION['siteusername']), |
| 19 | 19 | // "avatar_url" => "https://subrock.rocks/dynamic/pfp/", |
| 20 | 20 | "tts" => false, |
| 21 | -], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); |
|
| 21 | +], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
|
| 22 | 22 | |
| 23 | -$ch = curl_init( $webhookurl ); |
|
| 24 | -curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); |
|
| 25 | -curl_setopt( $ch, CURLOPT_POST, 1); |
|
| 26 | -curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data); |
|
| 27 | -curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); |
|
| 28 | -curl_setopt( $ch, CURLOPT_HEADER, 0); |
|
| 29 | -curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 23 | +$ch = curl_init($webhookurl); |
|
| 24 | +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); |
|
| 25 | +curl_setopt($ch, CURLOPT_POST, 1); |
|
| 26 | +curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); |
|
| 27 | +curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
|
| 28 | +curl_setopt($ch, CURLOPT_HEADER, 0); |
|
| 29 | +curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 30 | 30 | |
| 31 | -$response = curl_exec( $ch ); |
|
| 32 | -curl_close( $ch ); |
|
| 31 | +$response = curl_exec($ch); |
|
| 32 | +curl_close($ch); |
|
| 33 | 33 | header('Location: ' . $_SERVER['HTTP_REFERER'] . '&success=Successfully reported this video.'); |
| 34 | 34 | ?> |
| 35 | 35 | \ No newline at end of file |
@@ -17,15 +17,15 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $results_per_page = 12; |
| 19 | 19 | $number_of_result = $request->search_amount; |
| 20 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 20 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 21 | 21 | |
| 22 | - if (!isset ($_GET['page']) ) { |
|
| 22 | + if (!isset ($_GET['page'])) { |
|
| 23 | 23 | $page = 1; |
| 24 | 24 | } else { |
| 25 | - $page = (int)$_GET['page']; |
|
| 25 | + $page = (int) $_GET['page']; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 28 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 29 | 29 | |
| 30 | 30 | $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 31 | 31 | $stmt6->bindParam(":search", $request->like_search_term); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | <div id="results-main-content"> |
| 220 | 220 | <ol id="search-results"> |
| 221 | 221 | <?php |
| 222 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 222 | + while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 223 | 223 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
| 224 | 224 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 225 | 225 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | </div> |
| 254 | 254 | </li> |
| 255 | 255 | <?php } ?> |
| 256 | - <?php if($request->search_amount == 0) |
|
| 256 | + <?php if ($request->search_amount == 0) |
|
| 257 | 257 | echo "Your search query has brought no results.<br><br>"; |
| 258 | 258 | ?> |
| 259 | 259 | </ol> |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | </div> |
| 268 | 268 | <div id="search-footer-box" class="searchFooterBox"> |
| 269 | 269 | <div class="yt-uix-pager" role="navigation"> |
| 270 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
| 270 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
| 271 | 271 | <a href="/results?search_query=<?php echo $request->search_term; ?>&page=<?php echo $page; ?>"> |
| 272 | 272 | <button class="yt-uix-button yt-uix-button-default"><?php echo $page; ?></button> |
| 273 | 273 | </a> |
@@ -14,17 +14,17 @@ discard block |
||
| 14 | 14 | "action" => "l" /* fallback */ |
| 15 | 15 | ]; |
| 16 | 16 | |
| 17 | -if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) |
|
| 17 | +if (!isset($_SESSION['siteusername']) || !isset($_GET['id'])) |
|
| 18 | 18 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
| 19 | 19 | |
| 20 | -if(isset($_GET['a']) && $_GET['a'] == "-1") |
|
| 20 | +if (isset($_GET['a']) && $_GET['a'] == "-1") |
|
| 21 | 21 | $request->action = "d"; |
| 22 | 22 | |
| 23 | 23 | $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'"); |
| 24 | 24 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 25 | 25 | $stmt->bindParam(":reciever", $request->comment_id); |
| 26 | 26 | $stmt->execute(); |
| 27 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 27 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 28 | 28 | $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever"); |
| 29 | 29 | $stmt->execute(array( |
| 30 | 30 | ':username' => $_SESSION['siteusername'], |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 38 | 38 | $stmt->bindParam(":reciever", $request->comment_id); |
| 39 | 39 | $stmt->execute(); |
| 40 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 40 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 41 | 41 | $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever"); |
| 42 | 42 | $stmt->execute(array( |
| 43 | 43 | ':username' => $_SESSION['siteusername'], |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if($request->action == "l") { |
|
| 49 | +if ($request->action == "l") { |
|
| 50 | 50 | $stmt = $__db->prepare("INSERT INTO comment_likes (sender, reciever, type) VALUES (:sender, :reciever, 'l')"); |
| 51 | 51 | $stmt->bindParam(":sender", $_SESSION['siteusername']); |
| 52 | 52 | $stmt->bindParam(":reciever", $request->comment_id); |
@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | <?php |
| 15 | 15 | $_video = $__video_h->fetch_video_rid($_SESSION['current_video']); |
| 16 | 16 | |
| 17 | -if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 17 | +if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 18 | 18 | $error = array(); |
| 19 | 19 | |
| 20 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 20 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 24 | 24 | |
| 25 | - if(!isset($error['message'])) { |
|
| 25 | + if (!isset($error['message'])) { |
|
| 26 | 26 | $text = $_POST['comment']; |
| 27 | 27 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 28 | 28 | $stmt->bindParam(":v", $_SESSION['current_video']); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | header("Content-type: text/xml"); |
| 39 | 39 | // ugly solution |
| 40 | -if(!isset($error['status'])) { |
|
| 40 | +if (!isset($error['status'])) { |
|
| 41 | 41 | $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="420" data-score="0"><div class="comment-body"><div class="content-container"><div class="content"><div class="comment-text" dir="ltr"><p>' . $__video_h->shorten_description($_POST['comment'], 2048, true) . '</p></div><p class="metadata"><span class="author "><a href="/user/' . htmlspecialchars($_SESSION['siteusername']) . '" class="yt-uix-sessionlink yt-user-name " data-sessionlink="' . htmlspecialchars($_SESSION['siteusername']) . '" dir="ltr">' . htmlspecialchars($_SESSION['siteusername']) . '</a></span><span class="time" dir="ltr"><span dir="ltr">just now<span></span></span></span></p></div><div class="comment-actions"><span class="yt-uix-button-group"><button type="button" class="start comment-action-vote-up comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Up" data-action="vote-up" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-up" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Up"><span class="yt-valign-trick"></span></span></button><button type="button" class="end comment-action-vote-down comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Down" data-action="vote-down" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-down" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Down"><span class="yt-valign-trick"></span></span></button></span><span class="yt-uix-button-group"><!--<button type="button" class="start comment-action yt-uix-button yt-uix-button-default" onclick=";return false;" data-action="reply" role="button"><span class="yt-uix-button-content">Reply </span></button>--><button type="button" class="end flip yt-uix-button yt-uix-button-default yt-uix-button-empty" onclick=";return false;" data-button-has-sibling-menu="true" role="button" aria-pressed="false" aria-expanded="false" aria-haspopup="true" aria-activedescendant=""><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""><div class=" yt-uix-button-menu yt-uix-button-menu-default" style="display: none;"><ul><li class="comment-action" data-action="share"><span class="yt-uix-button-menu-item">Share</span></li><li class="comment-action-remove comment-action" data-action="remove"><span class="yt-uix-button-menu-item">Remove</span></li><li class="comment-action" data-action="flag"><span class="yt-uix-button-menu-item">Flag for spam</span></li><li class="comment-action-block comment-action" data-action="block"><span class="yt-uix-button-menu-item">Block User</span></li><li class="comment-action-unblock comment-action" data-action="unblock"><span class="yt-uix-button-menu-item">Unblock User</span></li></ul></div></button></span></div></div></div></li>]]></html_content><return_code><![CDATA[0]]></return_code></root>'; |
| 42 | 42 | } else { |
| 43 | 43 | $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"></div><div class="yt-alert-buttons"></div><div class="yt-alert-content" role="alert"><span class="yt-alert-vertical-trick"></span><div class="yt-alert-message">You are under a cooldown!</div></div></div>]]></html_content><return_code><![CDATA[0]]></return_code></root>'; |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | 14 | <?php |
| 15 | - if(isset($_SESSION['siteusername'])) |
|
| 15 | + if (isset($_SESSION['siteusername'])) |
|
| 16 | 16 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
| 17 | 17 | |
| 18 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 18 | + if (!$__user_h->user_exists($_GET['n'])) |
|
| 19 | 19 | header("Location: /?userdoesntexist"); |
| 20 | 20 | |
| 21 | 21 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -68,28 +68,28 @@ discard block |
||
| 68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
| 69 | 69 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 70 | 70 | |
| 71 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 78 | + if (isset($_SESSION['siteusername'])) |
|
| 79 | 79 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 80 | 80 | |
| 81 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 81 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 82 | 82 | $error = array(); |
| 83 | 83 | |
| 84 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 84 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 87 | 87 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 88 | 88 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 89 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 89 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | - if(!isset($error['message'])) { |
|
| 92 | + if (!isset($error['message'])) { |
|
| 93 | 93 | $text = $_POST['comment']; |
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | 95 | $stmt->bindParam(":id", $_user['username']); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 101 | 101 | |
| 102 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 102 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 103 | 103 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 134 | 134 | <style> |
| 135 | 135 | #content-container { |
| 136 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 136 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 137 | 137 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
| 138 | 138 | background-repeat: repeat; |
| 139 | 139 | background-position: center top; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 150 | 150 | <div id="content-container"> |
| 151 | 151 | <!-- begin content --> |
| 152 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 152 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 153 | 153 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 154 | 154 | <?php } ?> |
| 155 | 155 | <div id="content"> |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 205 | 205 | </div> |
| 206 | 206 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 207 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 207 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 208 | 208 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 209 | 209 | <button |
| 210 | 210 | href="#" |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | title="" |
| 213 | 213 | id="subscribe-button" |
| 214 | 214 | type="button" |
| 215 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 215 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 216 | 216 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 217 | 217 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 218 | 218 | <span class="subscribed-label">Subscribed</span> |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | </div> |
| 279 | 279 | </div> |
| 280 | 280 | </div> |
| 281 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 281 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 282 | 282 | <div id="branded-page-body"> |
| 283 | 283 | <div class="channel-tab-content channel-layout-full-width"> |
| 284 | 284 | <div class="tab-content-body"> |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); |
| 313 | 313 | $stmt->bindParam(":username", $_user['username']); |
| 314 | 314 | $stmt->execute(); |
| 315 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 315 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 316 | 316 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 317 | 317 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 318 | 318 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | <?php $__user_u = new user_update($__db); ?> |
| 9 | 9 | <?php $__db_h = new db_helper(); ?> |
| 10 | 10 | <?php $__time_h = new time_helper(); ?> |
| 11 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 11 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 12 | 12 | <?php |
| 13 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 13 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 14 | 14 | $error = array(); |
| 15 | 15 | |
| 16 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
| 17 | - if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
| 18 | - if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
| 19 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 20 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; } |
|
| 16 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
| 17 | + if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
| 18 | + if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
| 19 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 20 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; } |
|
| 21 | 21 | |
| 22 | - if(!isset($error['message'])) { |
|
| 22 | + if (!isset($error['message'])) { |
|
| 23 | 23 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
| 24 | 24 | $result = ''; |
| 25 | 25 | for ($i = 0; $i < 11; $i++) |
@@ -188,15 +188,15 @@ discard block |
||
| 188 | 188 | $stmt->execute(); |
| 189 | 189 | |
| 190 | 190 | $number_of_result = $stmt->rowCount(); |
| 191 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 191 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 192 | 192 | |
| 193 | - if (!isset ($_GET['page']) ) { |
|
| 193 | + if (!isset ($_GET['page'])) { |
|
| 194 | 194 | $page = 1; |
| 195 | 195 | } else { |
| 196 | - $page = (int)$_GET['page']; |
|
| 196 | + $page = (int) $_GET['page']; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 199 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 200 | 200 | ?> |
| 201 | 201 | <?php |
| 202 | 202 | $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | </tr> |
| 242 | 242 | |
| 243 | 243 | <?php |
| 244 | - while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 244 | + while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 245 | 245 | $playlist['videos'] = json_decode($playlist['videos']); |
| 246 | - if($__video_h->video_exists(@$playlist['videos'][0])) { |
|
| 247 | - if(count($playlist['videos']) != 0) { |
|
| 246 | + if ($__video_h->video_exists(@$playlist['videos'][0])) { |
|
| 247 | + if (count($playlist['videos']) != 0) { |
|
| 248 | 248 | $video = $__video_h->fetch_video_rid($playlist['videos'][0]); |
| 249 | 249 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
| 250 | 250 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | </div> |
| 327 | 327 | </center> |
| 328 | 328 | |
| 329 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
| 329 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
| 330 | 330 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
| 331 | 331 | <?php } ?> |
| 332 | 332 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | </script> |
| 373 | 373 | |
| 374 | 374 | <?php |
| 375 | - if($stmt6->rowCount() == 0) { echo " |
|
| 375 | + if ($stmt6->rowCount() == 0) { echo " |
|
| 376 | 376 | <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br> |
| 377 | 377 | "; |
| 378 | 378 | } ?> |