@@ -12,19 +12,19 @@ discard block |
||
| 12 | 12 | <?php $__user_u = new user_update($__db); ?> |
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 15 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 16 | 16 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 17 | 17 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 18 | 18 | <?php |
| 19 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 19 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 20 | 20 | $error = array(); |
| 21 | 21 | |
| 22 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 23 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 24 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 25 | - 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; } |
|
| 22 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 23 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 24 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 25 | + 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; } |
|
| 26 | 26 | |
| 27 | - if(!isset($error['message'])) { |
|
| 27 | + if (!isset($error['message'])) { |
|
| 28 | 28 | $text = $_POST['comment']; |
| 29 | 29 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 30 | 30 | $stmt->bindParam(":v", $_GET['v']); |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 66 | 66 | </script> |
| 67 | 67 | <?php |
| 68 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 68 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 69 | 69 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
| 70 | 70 | |
| 71 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 72 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 71 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 72 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | 73 | |
| 74 | 74 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
| 75 | 75 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
| 76 | 76 | |
| 77 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 77 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 78 | 78 | $_video['likeswidth'] = 50; |
| 79 | 79 | $_video['dislikeswidth'] = 50; |
| 80 | 80 | } else { |
| 81 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 81 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
| 82 | 82 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | </div> |
| 113 | 113 | <div id="instream_google_companion_ad_div"></div> |
| 114 | 114 | </div> |
| 115 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 115 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 116 | 116 | <div id="watch-owner-container"> |
| 117 | 117 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 118 | 118 | <ul class="yt-nav-aside"> |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | title="" |
| 148 | 148 | id="subscribe-button" |
| 149 | 149 | type="button" |
| 150 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 150 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 151 | 151 | role="button"> |
| 152 | 152 | <span class="yt-uix-button-icon-wrapper"> |
| 153 | 153 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | <button onclick=";window.location.href=this.getAttribute('href');return false;" |
| 226 | 226 | title="I like this" |
| 227 | 227 | type="button" |
| 228 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 228 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 229 | 229 | id="watch-like" |
| 230 | 230 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 231 | 231 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | type="button" |
| 240 | 240 | style="margin-left: -2px;" |
| 241 | 241 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 242 | - class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 242 | + class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 243 | 243 | id="watch-unlike" |
| 244 | 244 | role="button"> |
| 245 | 245 | <span class="yt-uix-button-icon-wrapper"> |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | not implemented ismnf |
| 258 | 258 | </div> |
| 259 | 259 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 260 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 260 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 261 | 261 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 262 | 262 | <div class="yt-alert-icon"> |
| 263 | 263 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | <?php } else { ?> |
| 274 | 274 | <h3>Be friends with the creator</h3> |
| 275 | 275 | |
| 276 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 276 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 277 | 277 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 278 | 278 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 279 | 279 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | </span><br><br> |
| 288 | 288 | <?php } ?> |
| 289 | 289 | |
| 290 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 291 | - <?php if($_video['friended'] == false) { ?> |
|
| 290 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 291 | + <?php if ($_video['friended'] == false) { ?> |
|
| 292 | 292 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Send a friend request</a> |
| 293 | 293 | <?php } else { ?> |
| 294 | 294 | Your friend request is pending. |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | <?php } ?> |
| 299 | 299 | <hr><br> |
| 300 | 300 | <h3>Add to Favorites</h3> |
| 301 | - <?php if($_video['favorited'] == false) { ?> |
|
| 301 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 302 | 302 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 303 | 303 | <?php } else { ?> |
| 304 | 304 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -309,10 +309,10 @@ discard block |
||
| 309 | 309 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 310 | 310 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 311 | 311 | $stmt->execute(); |
| 312 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 312 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 313 | 313 | $buffer = json_decode($playlist['videos']); |
| 314 | 314 | @$rid = $buffer[0]; |
| 315 | - if(!empty($rid)) { |
|
| 315 | + if (!empty($rid)) { |
|
| 316 | 316 | @$video = $__video_h->fetch_video_rid($rid); |
| 317 | 317 | } else { |
| 318 | 318 | $video['thumbnail'] = ""; |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | $stmt->execute(); |
| 591 | 591 | ?> |
| 592 | 592 | |
| 593 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 593 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 594 | 594 | <div class="comments-section"> |
| 595 | 595 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 596 | 596 | see all |
@@ -598,8 +598,8 @@ discard block |
||
| 598 | 598 | <h4>Video Responses</h4> |
| 599 | 599 | <ul class="video-list"> |
| 600 | 600 | <?php |
| 601 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 602 | - if($__video_h->video_exists($video['video'])) { |
|
| 601 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 602 | + if ($__video_h->video_exists($video['video'])) { |
|
| 603 | 603 | $video = $__video_h->fetch_video_rid($video['video']); |
| 604 | 604 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 605 | 605 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -630,19 +630,19 @@ discard block |
||
| 630 | 630 | </h4> |
| 631 | 631 | </div> |
| 632 | 632 | </div> |
| 633 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 633 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 634 | 634 | <div class="comments-post-container clearfix"> |
| 635 | 635 | <div class="comments-post-alert"> |
| 636 | 636 | <a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span> |
| 637 | 637 | </div> |
| 638 | 638 | </div> |
| 639 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 639 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 640 | 640 | <div class="comments-post-container clearfix"> |
| 641 | 641 | <div class="comments-post-alert"> |
| 642 | 642 | This video has comemnting disabled! |
| 643 | 643 | </div> |
| 644 | 644 | </div> |
| 645 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 645 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 646 | 646 | <div class="comments-post-container clearfix"> |
| 647 | 647 | <div class="comments-post-alert"> |
| 648 | 648 | This user has blocked you! |
@@ -696,15 +696,15 @@ discard block |
||
| 696 | 696 | $stmt->execute(); |
| 697 | 697 | |
| 698 | 698 | $number_of_result = $stmt->rowCount(); |
| 699 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 699 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 700 | 700 | |
| 701 | - if (!isset ($_GET['page']) ) { |
|
| 701 | + if (!isset ($_GET['page'])) { |
|
| 702 | 702 | $page = 1; |
| 703 | 703 | } else { |
| 704 | - $page = (int)$_GET['page']; |
|
| 704 | + $page = (int) $_GET['page']; |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 707 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 708 | 708 | |
| 709 | 709 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 710 | 710 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | $stmt->bindParam(":pper", $results_per_page); |
| 713 | 713 | $stmt->execute(); |
| 714 | 714 | |
| 715 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 715 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 716 | 716 | ?> |
| 717 | 717 | |
| 718 | 718 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | <?php |
| 795 | 795 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
| 796 | 796 | $stmt->execute(); |
| 797 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 797 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 798 | 798 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 799 | 799 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 800 | 800 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -25,33 +25,33 @@ discard block |
||
| 25 | 25 | 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; } |
| 26 | 26 | |
| 27 | 27 | if(!isset($error['message'])) { |
| 28 | - $text = $_POST['comment']; |
|
| 28 | + $text = $_POST['comment']; |
|
| 29 | 29 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 30 | 30 | $stmt->bindParam(":v", $_GET['v']); |
| 31 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 32 | - $stmt->bindParam(":comment", $text); |
|
| 31 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 32 | + $stmt->bindParam(":comment", $text); |
|
| 33 | 33 | $stmt->execute(); |
| 34 | 34 | |
| 35 | - $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 36 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 35 | + $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 36 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - /* |
|
| 40 | + /* |
|
| 41 | 41 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
| 42 | 42 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
| 43 | 43 | Work on this tomorrow or some shit idk lol |
| 44 | 44 | */ |
| 45 | 45 | |
| 46 | - /* |
|
| 46 | + /* |
|
| 47 | 47 | USE THE GOD DAMN __CONFIG MORE -- idiot |
| 48 | 48 | Work on this tomorrow or some shit |
| 49 | 49 | */ |
| 50 | 50 | |
| 51 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 52 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 53 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 54 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 51 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 52 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 53 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 54 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 55 | 55 | ?> |
| 56 | 56 | <!DOCTYPE html> |
| 57 | 57 | <html> |
@@ -81,29 +81,29 @@ discard block |
||
| 81 | 81 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 82 | 82 | </script> |
| 83 | 83 | <?php |
| 84 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 85 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 84 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 85 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 86 | 86 | |
| 87 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 88 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 87 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 88 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 89 | 89 | |
| 90 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 91 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 90 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 91 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 92 | 92 | |
| 93 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 94 | - $_video['likeswidth'] = 50; |
|
| 95 | - $_video['dislikeswidth'] = 50; |
|
| 96 | - } else { |
|
| 97 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 98 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 99 | - } |
|
| 93 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 94 | + $_video['likeswidth'] = 50; |
|
| 95 | + $_video['dislikeswidth'] = 50; |
|
| 96 | + } else { |
|
| 97 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 98 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 102 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 103 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 104 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 105 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 106 | - ?> |
|
| 101 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 102 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 103 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 104 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 105 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 106 | + ?> |
|
| 107 | 107 | </head> |
| 108 | 108 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 109 | 109 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -322,21 +322,21 @@ discard block |
||
| 322 | 322 | <hr><br> |
| 323 | 323 | <h3>Add to a Playlist</h3> |
| 324 | 324 | <?php |
| 325 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 326 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 327 | - $stmt->execute(); |
|
| 328 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 329 | - $buffer = json_decode($playlist['videos']); |
|
| 330 | - @$rid = $buffer[0]; |
|
| 331 | - if(!empty($rid)) { |
|
| 332 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 333 | - } else { |
|
| 334 | - $video['thumbnail'] = ""; |
|
| 335 | - $video['duration'] = 0; |
|
| 336 | - } |
|
| 325 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 326 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 327 | + $stmt->execute(); |
|
| 328 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 329 | + $buffer = json_decode($playlist['videos']); |
|
| 330 | + @$rid = $buffer[0]; |
|
| 331 | + if(!empty($rid)) { |
|
| 332 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 333 | + } else { |
|
| 334 | + $video['thumbnail'] = ""; |
|
| 335 | + $video['duration'] = 0; |
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - $videos = count($buffer); |
|
| 339 | - ?> |
|
| 338 | + $videos = count($buffer); |
|
| 339 | + ?> |
|
| 340 | 340 | <a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a> |
| 341 | 341 | <?php } ?> |
| 342 | 342 | <?php } ?> |
@@ -601,10 +601,10 @@ discard block |
||
| 601 | 601 | </div> |
| 602 | 602 | </div> |
| 603 | 603 | <?php |
| 604 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 605 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 606 | - $stmt->execute(); |
|
| 607 | - ?> |
|
| 604 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 605 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 606 | + $stmt->execute(); |
|
| 607 | + ?> |
|
| 608 | 608 | |
| 609 | 609 | <?php if($stmt->rowCount() != 0) { ?> |
| 610 | 610 | <div class="comments-section"> |
@@ -614,16 +614,16 @@ discard block |
||
| 614 | 614 | <h4>Video Responses</h4> |
| 615 | 615 | <ul class="video-list"> |
| 616 | 616 | <?php |
| 617 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 618 | - if($__video_h->video_exists($video['video'])) { |
|
| 619 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 620 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 621 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 622 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 623 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 624 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 625 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 626 | - ?> |
|
| 617 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 618 | + if($__video_h->video_exists($video['video'])) { |
|
| 619 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 620 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 621 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 622 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 623 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 624 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 625 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 626 | + ?> |
|
| 627 | 627 | <li class="video-list-item yt-tile-default"> |
| 628 | 628 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&feature=watch_response"><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="//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> |
| 629 | 629 | <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="cjls0QsHOBE" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -705,31 +705,31 @@ discard block |
||
| 705 | 705 | </div> |
| 706 | 706 | <ul class="comment-list" id="live_comments"> |
| 707 | 707 | <?php |
| 708 | - $results_per_page = 20; |
|
| 708 | + $results_per_page = 20; |
|
| 709 | 709 | |
| 710 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 711 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 712 | - $stmt->execute(); |
|
| 710 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 711 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 712 | + $stmt->execute(); |
|
| 713 | 713 | |
| 714 | - $number_of_result = $stmt->rowCount(); |
|
| 715 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 714 | + $number_of_result = $stmt->rowCount(); |
|
| 715 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 716 | 716 | |
| 717 | - if (!isset ($_GET['page']) ) { |
|
| 718 | - $page = 1; |
|
| 719 | - } else { |
|
| 720 | - $page = (int)$_GET['page']; |
|
| 721 | - } |
|
| 717 | + if (!isset ($_GET['page']) ) { |
|
| 718 | + $page = 1; |
|
| 719 | + } else { |
|
| 720 | + $page = (int)$_GET['page']; |
|
| 721 | + } |
|
| 722 | 722 | |
| 723 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 723 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 724 | 724 | |
| 725 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 726 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 727 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 728 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 729 | - $stmt->execute(); |
|
| 725 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 726 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 727 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 728 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 729 | + $stmt->execute(); |
|
| 730 | 730 | |
| 731 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 732 | - ?> |
|
| 731 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 732 | + ?> |
|
| 733 | 733 | |
| 734 | 734 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
| 735 | 735 | <div class="comment-body"> |
@@ -808,16 +808,16 @@ discard block |
||
| 808 | 808 | <ul id="watch-related" class="video-list"> |
| 809 | 809 | <div id="ppv-container" class="hid"></div> |
| 810 | 810 | <?php |
| 811 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 812 | - $stmt->execute(); |
|
| 813 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 814 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 815 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 816 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 817 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 818 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 819 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 820 | - ?> |
|
| 811 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 812 | + $stmt->execute(); |
|
| 813 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 814 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 815 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 816 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 817 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 818 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 819 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 820 | + ?> |
|
| 821 | 821 | <li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&<?php echo htmlspecialchars($_video['author']); ?>&feature=relmfu"><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="//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> |
| 822 | 822 | <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="gyAaIKF6tSQ" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
| 823 | 823 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | |
| 27 | 27 | $stmt = $__db->prepare("DELETE FROM favorite_video WHERE sender = :sender AND reciever = :reciever"); |
| 28 | 28 | $stmt->execute(array( |
| 29 | - ':sender' => $_SESSION['siteusername'], |
|
| 30 | - ':reciever' => $name, |
|
| 29 | + ':sender' => $_SESSION['siteusername'], |
|
| 30 | + ':reciever' => $name, |
|
| 31 | 31 | )); |
| 32 | 32 | |
| 33 | 33 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $stmt->bindParam(":reciever", $name); |
| 20 | 20 | $stmt->execute(); |
| 21 | 21 | |
| 22 | -if($stmt->rowCount() == 1) { |
|
| 22 | +if ($stmt->rowCount() == 1) { |
|
| 23 | 23 | $_SESSION['error']->message = "You have already favorited this video."; |
| 24 | 24 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
| 25 | 25 | die(); |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | 18 | |
| 19 | 19 | if(!$__user_h->user_exists($_GET['n'])) |
| 20 | 20 | header("Location: /?userdoesntexist"); |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - function addhttp($url) { |
|
| 31 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 32 | - $url = "http://" . $url; |
|
| 33 | - } |
|
| 34 | - return $url; |
|
| 35 | - } |
|
| 30 | + function addhttp($url) { |
|
| 31 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 32 | + $url = "http://" . $url; |
|
| 33 | + } |
|
| 34 | + return $url; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | 37 | function check_valid_colorhex($colorCode) { |
| 38 | 38 | // If user accidentally passed along the # sign, strip it off |
| 39 | 39 | $colorCode = ltrim($colorCode, '#'); |
| 40 | 40 | |
| 41 | 41 | if ( |
| 42 | - ctype_xdigit($colorCode) && |
|
| 42 | + ctype_xdigit($colorCode) && |
|
| 43 | 43 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
| 44 | - return true; |
|
| 44 | + return true; |
|
| 45 | 45 | |
| 46 | 46 | else return false; |
| 47 | 47 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
| 67 | 67 | |
| 68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
| 69 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 69 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 70 | 70 | |
| 71 | 71 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
| 72 | 72 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 76 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | + if(isset($_SESSION['siteusername'])) |
|
| 79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 80 | 80 | |
| 81 | 81 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 82 | 82 | $error = array(); |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | 92 | if(!isset($error['message'])) { |
| 93 | - $text = $_POST['comment']; |
|
| 93 | + $text = $_POST['comment']; |
|
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | - $stmt->bindParam(":id", $_user['username']); |
|
| 96 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | - $stmt->bindParam(":comment", $text); |
|
| 95 | + $stmt->bindParam(":id", $_user['username']); |
|
| 96 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | + $stmt->bindParam(":comment", $text); |
|
| 98 | 98 | $stmt->execute(); |
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | - ?> |
|
| 107 | + ?> |
|
| 108 | 108 | <!DOCTYPE html> |
| 109 | 109 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
| 110 | 110 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 147 | <?php } ?> |
| 148 | 148 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 151 | - ?> |
|
| 149 | + if(empty(trim($_user['bio']))) |
|
| 150 | + $_user['bio'] = "This user has no description."; |
|
| 151 | + ?> |
|
| 152 | 152 | <div id="content"> |
| 153 | 153 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 154 | 154 | <div class="content" id="recommended-channels-list"></div> |
@@ -477,9 +477,9 @@ discard block |
||
| 477 | 477 | <h2>Featured Channels</h2> |
| 478 | 478 | <ul class="channel-summary-list "> |
| 479 | 479 | <?php |
| 480 | - foreach($_user['featured_channels'] as $user) { |
|
| 481 | - if($__user_h->user_exists($user)) { |
|
| 482 | - ?> |
|
| 480 | + foreach($_user['featured_channels'] as $user) { |
|
| 481 | + if($__user_h->user_exists($user)) { |
|
| 482 | + ?> |
|
| 483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
| 484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
| 485 | 485 | <div class="channel-summary-thumb"> |
@@ -503,19 +503,19 @@ discard block |
||
| 503 | 503 | </div> |
| 504 | 504 | |
| 505 | 505 | <?php |
| 506 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 507 | - $stmt->bindParam(":search", $_user['username']); |
|
| 508 | - $stmt->execute(); |
|
| 506 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 507 | + $stmt->bindParam(":search", $_user['username']); |
|
| 508 | + $stmt->execute(); |
|
| 509 | 509 | |
| 510 | - if($stmt->rowCount() != 0) { |
|
| 511 | - ?> |
|
| 510 | + if($stmt->rowCount() != 0) { |
|
| 511 | + ?> |
|
| 512 | 512 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 513 | 513 | <div class="module-view gh-featured"> |
| 514 | 514 | <h2>Featured Playlists</h2> |
| 515 | 515 | <?php |
| 516 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 517 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 518 | - ?> |
|
| 516 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 517 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 518 | + ?> |
|
| 519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 520 | 520 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 521 | 521 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 16 | + if (isset($_SESSION['siteusername'])) |
|
| 17 | 17 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
| 18 | 18 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 19 | + if (!$__user_h->user_exists($_GET['n'])) |
|
| 20 | 20 | header("Location: /?userdoesntexist"); |
| 21 | 21 | |
| 22 | 22 | $_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 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 127 | 127 | <style> |
| 128 | 128 | #content-container { |
| 129 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 129 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 130 | 130 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
| 131 | 131 | background-repeat: repeat; |
| 132 | 132 | background-position: center top; |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 143 | 143 | <div id="content-container"> |
| 144 | 144 | <!-- begin content --> |
| 145 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 145 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 146 | 146 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 147 | <?php } ?> |
| 148 | 148 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 149 | + if (empty(trim($_user['bio']))) |
|
| 150 | 150 | $_user['bio'] = "This user has no description."; |
| 151 | 151 | ?> |
| 152 | 152 | <div id="content"> |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 202 | 202 | </div> |
| 203 | 203 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 204 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 204 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 205 | 205 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 206 | 206 | <button |
| 207 | 207 | href="#" |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | title="" |
| 210 | 210 | id="subscribe-button" |
| 211 | 211 | type="button" |
| 212 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 212 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 213 | 213 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 214 | 214 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 215 | 215 | <span class="subscribed-label">Subscribed</span> |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | </div> |
| 276 | 276 | </div> |
| 277 | 277 | </div> |
| 278 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 278 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 279 | 279 | <div id="branded-page-body"> |
| 280 | 280 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 281 | 281 | <div class="tab-content-body"> |
| 282 | 282 | <div class="primary-pane"> |
| 283 | - <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 283 | + <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 284 | 284 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> |
| 285 | 285 | <div class="module-view featured-video-view-module"> |
| 286 | 286 | <div class="channels-video-player " data-swf-config="{"assets": {"html": "\/html5_player_template", "css": "http:\/\/s.ytimg.com\/yt\/cssbin\/www-player-vfllhw7HB.css", "js": "http:\/\/s.ytimg.com\/yt\/jsbin\/html5player-vflzTrRqK.js"}, "url": "http:\/\/s.ytimg.com\/yt\/swfbin\/watch_as3-vflbPspVE.swf", "min_version": "8.0.0", "args": {"ttsurl": "http:\/\/www.youtube.com\/api\/timedtext?sparams=asr_langs%2Ccaps%2Cv%2Cexpire\u0026asr_langs=en%2Cko%2Cja%2Ces\u0026v=/watch?v=<?php echo $video['rid']; ?>\u0026caps=asr\u0026expire=1339746882\u0026key=yttt1\u0026signature=A1B858FF427B45672676C7403417ED1F4091A806.C347A6021C0F843E46F2056AEBA38FC93A0A47B8\u0026hl=en_US", "el": "profilepage", "fexp": "904001,907342,904824,910206,908620,907217,907335,921602,919306,922600,919316,920704,912804,913542,919324,912706", "url_encoded_fmt_stream_map": "url=http%3A%2F%2Fo-o.preferred.nuq04s10.v1.lscache4.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D44%26ip%3D207.0.0.0%26signature%3D9B9B5ECF02F2F66BDCCB0ACED26D3406F9F83241.1B2CC833461E3D2C4D081B7DFBC65B0948C61FB9%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v1.cache4.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=44,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D35%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3DB702D7CA72653169BDC2C945B5A35F4A23A3FEBF.ACC660CDAB11901FF8D3DA8D384D61F0AB0F0125%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=35,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v24.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D43%26ip%3D207.0.0.0%26signature%3D9FABDD8C013AA137B87DF2D154D1B90E6827A2A3.880FECDEC066236D85FCF223CF472B62B8F9B3A4%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v24.cache3.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=43,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v3.lscache7.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D34%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D1BA326B784DAA9F62FD789CBB5C2FABFCD5D351C.C4618E3AB2AB08C61C6A982A36F405DA886B5D5A%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v3.cache7.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=34,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D18%26ip%3D207.0.0.0%26signature%3D8806EA8FAE16557A2F9732068442133EA0A0760F.D91694A47E6B0BF627965CDA46010F36105A28FE%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026itag=18,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v4.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D5%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D011CB6739AB60ED79D032DE2F62EB016D8A8E462.C2C0ABE42F26DBA18F2BC6E0D074EB99A95C0DF0%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v4.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=5,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v12.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D36%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D988FDD37CBA8DB74C1148EE17921D8549434297C.A2C1796F2BA0427C9FE370BFB6B3B09BA1D81B07%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v12.cache3.c.youtube.com\u0026type=video%2F3gpp\u0026itag=36", "allow_embed": 1, "vq": "auto", "account_playback_token": "", "allow_ratings": 1, "keywords": "Rehearsal,Dance,justin,bieber,believe,as,long,you,love,me,rodney,jerkins,pattie,mallette,jeremy,dad,mom,scooter,braun,island,def,jam,usher,rbmg,making,of,the,album,webisode,june,19th,19,new,amazing,song,big,sean,hit,record,<?php echo htmlspecialchars($_user['username']); ?>,always,still,studio,singing,kuk,harrell,producer,sing,boy,guy,man,smash,single,nick,demoura,dancers,sweat,beliebers,hard,work,tour,band", "cc3_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitles3_module-vflu_Qeod.swf", "track_embed": 0, "is_purchased": false, "ps": "default", "fmt_list": "44\/854x480\/99\/0\/0,35\/854x480\/9\/0\/115,43\/640x360\/99\/0\/0,34\/640x360\/9\/0\/115,18\/640x360\/9\/0\/115,5\/320x240\/7\/0\/0,36\/320x240\/99\/0\/0", "author": "<?php echo htmlspecialchars($_user['username']); ?>", "muted": "0", "cc_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitle_module-vflq8KnSi.swf", "length_seconds": 82, "feature": "g-logo-xit", "enablejsapi": 1, "rel": 0, "plid": "AATCeEL9eg3Ls9t-", "cc_font": "Arial Unicode MS, arial, verdana, _sans", "ftoken": "", "sdetail": "f:g-logo-xit,p:\/", "status": "ok", "cc_asr": 1, "watermark": ",http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_watermark-vflHX6b6E.png,http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_hd_watermark-vflAzLcD6.png", "sourceid": "y", "timestamp": 1339721682, "has_cc": true, "view_count": 2600, "quality_cap": "highres", "hl": "en_US", "tmi": "1", "no_get_video_log": "1", "eurl": "http:\/\/www.youtube.com\/user\/<?php echo htmlspecialchars($_user['username']); ?>", "iurl": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/hqdefault.jpg", "endscreen_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/endscreen-vflJBKwqC.swf", "referrer": "http:\/\/www.youtube.com\/", "avg_rating": 4.97805486284, "video_id": "/watch?v=<?php echo $video['rid']; ?>", "sendtmp": "1", "sk": "bwv_lGOGF4u1g0p7puy7ERICN8NZ5cVFC", "is_video_preview": false, "token": "vjVQa1PpcFMSYb-unvOiIgSL8pW9tObJUMfrEc1mxfE=", "thumbnail_url": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/default.jpg", "iurlsd": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/sddefault.jpg", "autoplay": "1"}, "url_v9as2": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "params": {"allowscriptaccess": "always", "allowfullscreen": "true", "bgcolor": "#000000"}, "attrs": {"width": "640", "id": "movie_player", "height": "390"}, "url_v8": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "html5": false}" data-video-id="/watch?v=<?php echo $video['rid']; ?>"> |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | <div class="playlist-info"> |
| 321 | 321 | <h2>Uploaded videos</h2> |
| 322 | 322 | <div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div> |
| 323 | - <?php if($_user['videos'] == 0) { ?> |
|
| 323 | + <?php if ($_user['videos'] == 0) { ?> |
|
| 324 | 324 | <h4>This user has not uploaded a video yet.</h4> |
| 325 | 325 | <?php } ?> |
| 326 | 326 | </div> |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 330 | 330 | $stmt->bindParam(":username", $_user['username']); |
| 331 | 331 | $stmt->execute(); |
| 332 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 332 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 333 | 333 | ?> |
| 334 | 334 | <li class="blogger-video"> |
| 335 | 335 | <div class="video yt-tile-visible"> |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | </div> |
| 412 | 412 | <hr class="yt-horizontal-rule "> |
| 413 | 413 | </div> |
| 414 | - <?php if(!empty($_user['website'])) { ?> |
|
| 414 | + <?php if (!empty($_user['website'])) { ?> |
|
| 415 | 415 | <div class="user-profile-item"> |
| 416 | 416 | <div class="yt-c3-profile-custom-url field-container "> |
| 417 | 417 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | <h5>Country</h5> |
| 461 | 461 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 462 | 462 | </div> |
| 463 | - <?php if($_user['genre'] != "none") { ?> |
|
| 463 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 464 | 464 | <div class="user-profile-item "> |
| 465 | 465 | <h5>Channel Genre</h5> |
| 466 | 466 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -472,13 +472,13 @@ discard block |
||
| 472 | 472 | </div> |
| 473 | 473 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 474 | 474 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 475 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 475 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 476 | 476 | <div class="module-view other-channels-view"> |
| 477 | 477 | <h2>Featured Channels</h2> |
| 478 | 478 | <ul class="channel-summary-list "> |
| 479 | 479 | <?php |
| 480 | - foreach($_user['featured_channels'] as $user) { |
|
| 481 | - if($__user_h->user_exists($user)) { |
|
| 480 | + foreach ($_user['featured_channels'] as $user) { |
|
| 481 | + if ($__user_h->user_exists($user)) { |
|
| 482 | 482 | ?> |
| 483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
| 484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -507,13 +507,13 @@ discard block |
||
| 507 | 507 | $stmt->bindParam(":search", $_user['username']); |
| 508 | 508 | $stmt->execute(); |
| 509 | 509 | |
| 510 | - if($stmt->rowCount() != 0) { |
|
| 510 | + if ($stmt->rowCount() != 0) { |
|
| 511 | 511 | ?> |
| 512 | 512 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 513 | 513 | <div class="module-view gh-featured"> |
| 514 | 514 | <h2>Featured Playlists</h2> |
| 515 | 515 | <?php |
| 516 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 516 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 517 | 517 | $playlist['videos'] = json_decode($playlist['videos']); |
| 518 | 518 | ?> |
| 519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) { |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + } |
|
| 18 | 19 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 20 | - header("Location: /?userdoesntexist"); |
|
| 20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 21 | + header("Location: /?userdoesntexist"); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
| 40 | 42 | |
| 41 | 43 | if ( |
| 42 | 44 | ctype_xdigit($colorCode) && |
| 43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 44 | - return true; |
|
| 45 | - |
|
| 46 | - else return false; |
|
| 45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 46 | + return true; |
|
| 47 | + } else { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']); |
@@ -75,8 +78,9 @@ discard block |
||
| 75 | 78 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 76 | 79 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 77 | 80 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 81 | + if(isset($_SESSION['siteusername'])) { |
|
| 82 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 83 | + } |
|
| 80 | 84 | |
| 81 | 85 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 82 | 86 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
| 146 | 150 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 151 | <?php } ?> |
| 148 | 152 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 153 | + if(empty(trim($_user['bio']))) { |
|
| 154 | + $_user['bio'] = "This user has no description."; |
|
| 155 | + } |
|
| 151 | 156 | ?> |
| 152 | 157 | <div id="content"> |
| 153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <?php $__db_h = new db_helper(); ?> |
| 10 | 10 | <?php $__time_h = new time_helper(); ?> |
| 11 | 11 | <?php |
| 12 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
| 12 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
| 13 | 13 | $request = (object) [ |
| 14 | 14 | "username" => $_POST['username'], |
| 15 | 15 | "password" => $_POST['password'], |
@@ -23,25 +23,25 @@ discard block |
||
| 23 | 23 | ]; |
| 24 | 24 | |
| 25 | 25 | if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) |
| 26 | - { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
| 27 | - if(strlen($request->username) > 21) |
|
| 26 | + { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
| 27 | + if (strlen($request->username) > 21) |
|
| 28 | 28 | { $request->error->message = "Your username must be shorter than 21 characters."; $request->error->status = ""; } |
| 29 | - if(strlen($request->password) < 8) |
|
| 29 | + if (strlen($request->password) < 8) |
|
| 30 | 30 | { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; } |
| 31 | - if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
| 31 | + if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
| 32 | 32 | { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; } |
| 33 | - if(!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
| 33 | + if (!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
| 34 | 34 | { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; } |
| 35 | - if(empty(trim($request->username))) |
|
| 35 | + if (empty(trim($request->username))) |
|
| 36 | 36 | { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; } |
| 37 | 37 | |
| 38 | 38 | $stmt = $__db->prepare("SELECT username FROM users WHERE username = :username"); |
| 39 | 39 | $stmt->bindParam(":username", $request->username); |
| 40 | 40 | $stmt->execute(); |
| 41 | - if($stmt->rowCount()) |
|
| 41 | + if ($stmt->rowCount()) |
|
| 42 | 42 | { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; } |
| 43 | 43 | |
| 44 | - if($request->error->status == "OK") { |
|
| 44 | + if ($request->error->status == "OK") { |
|
| 45 | 45 | $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)"); |
| 46 | 46 | $stmt->bindParam(":username", $request->username); |
| 47 | 47 | $stmt->bindParam(":email", $request->email); |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | 18 | |
| 19 | 19 | if(!$__user_h->user_exists($_GET['n'])) |
| 20 | 20 | header("Location: /?userdoesntexist"); |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - function addhttp($url) { |
|
| 31 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 32 | - $url = "http://" . $url; |
|
| 33 | - } |
|
| 34 | - return $url; |
|
| 35 | - } |
|
| 30 | + function addhttp($url) { |
|
| 31 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 32 | + $url = "http://" . $url; |
|
| 33 | + } |
|
| 34 | + return $url; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | 37 | function check_valid_colorhex($colorCode) { |
| 38 | 38 | // If user accidentally passed along the # sign, strip it off |
| 39 | 39 | $colorCode = ltrim($colorCode, '#'); |
| 40 | 40 | |
| 41 | 41 | if ( |
| 42 | - ctype_xdigit($colorCode) && |
|
| 42 | + ctype_xdigit($colorCode) && |
|
| 43 | 43 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
| 44 | - return true; |
|
| 44 | + return true; |
|
| 45 | 45 | |
| 46 | 46 | else return false; |
| 47 | 47 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 77 | 77 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 78 | 78 | |
| 79 | - if(isset($_SESSION['siteusername'])) |
|
| 80 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 79 | + if(isset($_SESSION['siteusername'])) |
|
| 80 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 81 | 81 | |
| 82 | 82 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 83 | 83 | $error = array(); |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 92 | 92 | |
| 93 | 93 | if(!isset($error['message'])) { |
| 94 | - $text = $_POST['comment']; |
|
| 94 | + $text = $_POST['comment']; |
|
| 95 | 95 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 96 | - $stmt->bindParam(":id", $_user['username']); |
|
| 97 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 98 | - $stmt->bindParam(":comment", $text); |
|
| 96 | + $stmt->bindParam(":id", $_user['username']); |
|
| 97 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 98 | + $stmt->bindParam(":comment", $text); |
|
| 99 | 99 | $stmt->execute(); |
| 100 | 100 | |
| 101 | 101 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | - ?> |
|
| 108 | + ?> |
|
| 109 | 109 | <!DOCTYPE html> |
| 110 | 110 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
| 111 | 111 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 147 | <?php } ?> |
| 148 | 148 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 151 | - ?> |
|
| 149 | + if(empty(trim($_user['bio']))) |
|
| 150 | + $_user['bio'] = "This user has no description."; |
|
| 151 | + ?> |
|
| 152 | 152 | <div id="content"> |
| 153 | 153 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 154 | 154 | <div class="content" id="recommended-channels-list"></div> |
@@ -320,19 +320,19 @@ discard block |
||
| 320 | 320 | ORDER BY |
| 321 | 321 | `date` DESC;"); |
| 322 | 322 | $stmt->bindParam(":comment_username", $_user['username']); |
| 323 | - $stmt->bindParam(":videos_username", $_user['username']); |
|
| 323 | + $stmt->bindParam(":videos_username", $_user['username']); |
|
| 324 | 324 | $stmt->execute(); |
| 325 | 325 | while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 326 | - if((int)$content['id']) { |
|
| 327 | - $content = $__video_h->fetch_comment_id($content['id']); |
|
| 328 | - $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
|
| 329 | - $content['type'] = "comment"; |
|
| 330 | - } else { |
|
| 331 | - $content = $__video_h->fetch_video_rid($content['id']); |
|
| 332 | - $content['type'] = "video"; |
|
| 333 | - } |
|
| 326 | + if((int)$content['id']) { |
|
| 327 | + $content = $__video_h->fetch_comment_id($content['id']); |
|
| 328 | + $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
|
| 329 | + $content['type'] = "comment"; |
|
| 330 | + } else { |
|
| 331 | + $content = $__video_h->fetch_video_rid($content['id']); |
|
| 332 | + $content['type'] = "video"; |
|
| 333 | + } |
|
| 334 | 334 | |
| 335 | - if($content['type'] == "video") { |
|
| 335 | + if($content['type'] == "video") { |
|
| 336 | 336 | ?> |
| 337 | 337 | <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg"> |
| 338 | 338 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | </div> |
| 405 | 405 | </div> |
| 406 | 406 | <?php } else { |
| 407 | - if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
| 407 | + if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
| 408 | 408 | <div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw"> |
| 409 | 409 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
| 410 | 410 | <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="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | <h2>Featured Channels</h2> |
| 577 | 577 | <ul class="channel-summary-list "> |
| 578 | 578 | <?php |
| 579 | - foreach($_user['featured_channels'] as $user) { |
|
| 580 | - if($__user_h->user_exists($user)) { |
|
| 581 | - ?> |
|
| 579 | + foreach($_user['featured_channels'] as $user) { |
|
| 580 | + if($__user_h->user_exists($user)) { |
|
| 581 | + ?> |
|
| 582 | 582 | <li class="yt-tile-visible yt-uix-tile"> |
| 583 | 583 | <div class="channel-summary clearfix channel-summary-compact"> |
| 584 | 584 | <div class="channel-summary-thumb"> |
@@ -602,19 +602,19 @@ discard block |
||
| 602 | 602 | </div> |
| 603 | 603 | |
| 604 | 604 | <?php |
| 605 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 606 | - $stmt->bindParam(":search", $_user['username']); |
|
| 607 | - $stmt->execute(); |
|
| 605 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 606 | + $stmt->bindParam(":search", $_user['username']); |
|
| 607 | + $stmt->execute(); |
|
| 608 | 608 | |
| 609 | - if($stmt->rowCount() != 0) { |
|
| 610 | - ?> |
|
| 609 | + if($stmt->rowCount() != 0) { |
|
| 610 | + ?> |
|
| 611 | 611 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 612 | 612 | <div class="module-view gh-featured"> |
| 613 | 613 | <h2>Featured Playlists</h2> |
| 614 | 614 | <?php |
| 615 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 616 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 617 | - ?> |
|
| 615 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 616 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 617 | + ?> |
|
| 618 | 618 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 619 | 619 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 620 | 620 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 16 | + if (isset($_SESSION['siteusername'])) |
|
| 17 | 17 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
| 18 | 18 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 19 | + if (!$__user_h->user_exists($_GET['n'])) |
|
| 20 | 20 | header("Location: /?userdoesntexist"); |
| 21 | 21 | |
| 22 | 22 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -69,28 +69,28 @@ discard block |
||
| 69 | 69 | $_user['genre'] = strtolower($_user['genre']); |
| 70 | 70 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 71 | 71 | |
| 72 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 75 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 76 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 77 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 75 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 76 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 77 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 78 | 78 | |
| 79 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | + if (isset($_SESSION['siteusername'])) |
|
| 80 | 80 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 81 | 81 | |
| 82 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 82 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 83 | 83 | $error = array(); |
| 84 | 84 | |
| 85 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 86 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 87 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 85 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 86 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 87 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 88 | 88 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 89 | 89 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 90 | - 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 | + 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; } |
|
| 91 | 91 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 92 | 92 | |
| 93 | - if(!isset($error['message'])) { |
|
| 93 | + if (!isset($error['message'])) { |
|
| 94 | 94 | $text = $_POST['comment']; |
| 95 | 95 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 96 | 96 | $stmt->bindParam(":id", $_user['username']); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 102 | 102 | |
| 103 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 103 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 104 | 104 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 127 | 127 | <style> |
| 128 | 128 | #content-container { |
| 129 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 129 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 130 | 130 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
| 131 | 131 | background-repeat: repeat; |
| 132 | 132 | background-position: center top; |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 143 | 143 | <div id="content-container"> |
| 144 | 144 | <!-- begin content --> |
| 145 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 145 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 146 | 146 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 147 | <?php } ?> |
| 148 | 148 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 149 | + if (empty(trim($_user['bio']))) |
|
| 150 | 150 | $_user['bio'] = "This user has no description."; |
| 151 | 151 | ?> |
| 152 | 152 | <div id="content"> |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 202 | 202 | </div> |
| 203 | 203 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 204 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 204 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 205 | 205 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 206 | 206 | <button href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsubscribe%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252Fuser%252F<?php echo htmlspecialchars($_user['username']); ?>%253Ffeature%253Dg-logo-xit&hl=en_US&ltmpl=sso" onclick=";window.location.href=this.getAttribute('href');return false;" title="" type="button" class="yt-subscription-button subscription-button-with-recommended-channels yt-uix-button yt-uix-button-subscription yt-uix-tooltip" data-enable-hovercard="true" data-subscription-value="UCIwFjwMjI0y7PDBVEO9-bkQ" data-force-position="" data-position="" data-subscription-feature="channels3" data-subscription-type="channel" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 207 | 207 | <span class="subscribed-label">Subscribed</span> |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | </div> |
| 268 | 268 | </div> |
| 269 | 269 | </div> |
| 270 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 270 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 271 | 271 | <div id="branded-page-body"> |
| 272 | 272 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 273 | 273 | <div class="tab-content-body"> |
@@ -322,8 +322,8 @@ discard block |
||
| 322 | 322 | $stmt->bindParam(":comment_username", $_user['username']); |
| 323 | 323 | $stmt->bindParam(":videos_username", $_user['username']); |
| 324 | 324 | $stmt->execute(); |
| 325 | - while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 326 | - if((int)$content['id']) { |
|
| 325 | + while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 326 | + if ((int) $content['id']) { |
|
| 327 | 327 | $content = $__video_h->fetch_comment_id($content['id']); |
| 328 | 328 | $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
| 329 | 329 | $content['type'] = "comment"; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $content['type'] = "video"; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - if($content['type'] == "video") { |
|
| 335 | + if ($content['type'] == "video") { |
|
| 336 | 336 | ?> |
| 337 | 337 | <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg"> |
| 338 | 338 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | </div> |
| 405 | 405 | </div> |
| 406 | 406 | <?php } else { |
| 407 | - if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
| 407 | + if ($__video_h->video_exists($content['video']['rid'])) { ?> |
|
| 408 | 408 | <div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw"> |
| 409 | 409 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
| 410 | 410 | <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="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | </div> |
| 511 | 511 | <hr class="yt-horizontal-rule "> |
| 512 | 512 | </div> |
| 513 | - <?php if(!empty($_user['website'])) { ?> |
|
| 513 | + <?php if (!empty($_user['website'])) { ?> |
|
| 514 | 514 | <div class="user-profile-item"> |
| 515 | 515 | <div class="yt-c3-profile-custom-url field-container "> |
| 516 | 516 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | <h5>Country</h5> |
| 560 | 560 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 561 | 561 | </div> |
| 562 | - <?php if($_user['genre'] != "none") { ?> |
|
| 562 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 563 | 563 | <div class="user-profile-item "> |
| 564 | 564 | <h5>Channel Genre</h5> |
| 565 | 565 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -571,13 +571,13 @@ discard block |
||
| 571 | 571 | </div> |
| 572 | 572 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 573 | 573 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 574 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 574 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 575 | 575 | <div class="module-view other-channels-view"> |
| 576 | 576 | <h2>Featured Channels</h2> |
| 577 | 577 | <ul class="channel-summary-list "> |
| 578 | 578 | <?php |
| 579 | - foreach($_user['featured_channels'] as $user) { |
|
| 580 | - if($__user_h->user_exists($user)) { |
|
| 579 | + foreach ($_user['featured_channels'] as $user) { |
|
| 580 | + if ($__user_h->user_exists($user)) { |
|
| 581 | 581 | ?> |
| 582 | 582 | <li class="yt-tile-visible yt-uix-tile"> |
| 583 | 583 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -606,13 +606,13 @@ discard block |
||
| 606 | 606 | $stmt->bindParam(":search", $_user['username']); |
| 607 | 607 | $stmt->execute(); |
| 608 | 608 | |
| 609 | - if($stmt->rowCount() != 0) { |
|
| 609 | + if ($stmt->rowCount() != 0) { |
|
| 610 | 610 | ?> |
| 611 | 611 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 612 | 612 | <div class="module-view gh-featured"> |
| 613 | 613 | <h2>Featured Playlists</h2> |
| 614 | 614 | <?php |
| 615 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 615 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 616 | 616 | $playlist['videos'] = json_decode($playlist['videos']); |
| 617 | 617 | ?> |
| 618 | 618 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) { |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + } |
|
| 18 | 19 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 20 | - header("Location: /?userdoesntexist"); |
|
| 20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 21 | + header("Location: /?userdoesntexist"); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
| 40 | 42 | |
| 41 | 43 | if ( |
| 42 | 44 | ctype_xdigit($colorCode) && |
| 43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 44 | - return true; |
|
| 45 | - |
|
| 46 | - else return false; |
|
| 45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 46 | + return true; |
|
| 47 | + } else { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
@@ -76,8 +79,9 @@ discard block |
||
| 76 | 79 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 77 | 80 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 78 | 81 | |
| 79 | - if(isset($_SESSION['siteusername'])) |
|
| 80 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 82 | + if(isset($_SESSION['siteusername'])) { |
|
| 83 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 83 | 87 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
| 146 | 150 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 151 | <?php } ?> |
| 148 | 152 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 153 | + if(empty(trim($_user['bio']))) { |
|
| 154 | + $_user['bio'] = "This user has no description."; |
|
| 155 | + } |
|
| 151 | 156 | ?> |
| 152 | 157 | <div id="content"> |
| 153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -6,34 +6,34 @@ discard block |
||
| 6 | 6 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?> |
| 7 | 7 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?> |
| 8 | 8 | <?php |
| 9 | - $request = (object) [ |
|
| 10 | - "search_term" => htmlspecialchars($_GET['search_query']), |
|
| 11 | - "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
| 12 | - "search_amount" => 0 /* [fallback] */ |
|
| 13 | - ]; |
|
| 9 | + $request = (object) [ |
|
| 10 | + "search_term" => htmlspecialchars($_GET['search_query']), |
|
| 11 | + "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
| 12 | + "search_amount" => 0 /* [fallback] */ |
|
| 13 | + ]; |
|
| 14 | 14 | |
| 15 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
| 16 | - $stmt->bindParam(":search", $request->like_search_term); |
|
| 17 | - $stmt->execute(); |
|
| 18 | - $request->search_amount = $stmt->rowCount(); |
|
| 15 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
| 16 | + $stmt->bindParam(":search", $request->like_search_term); |
|
| 17 | + $stmt->execute(); |
|
| 18 | + $request->search_amount = $stmt->rowCount(); |
|
| 19 | 19 | |
| 20 | - $results_per_page = 12; |
|
| 21 | - $number_of_result = $request->search_amount; |
|
| 22 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 20 | + $results_per_page = 12; |
|
| 21 | + $number_of_result = $request->search_amount; |
|
| 22 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 23 | 23 | |
| 24 | - if (!isset ($_GET['page']) ) { |
|
| 25 | - $page = 1; |
|
| 26 | - } else { |
|
| 27 | - $page = (int)$_GET['page']; |
|
| 28 | - } |
|
| 24 | + if (!isset ($_GET['page']) ) { |
|
| 25 | + $page = 1; |
|
| 26 | + } else { |
|
| 27 | + $page = (int)$_GET['page']; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 30 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 31 | 31 | |
| 32 | - $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 33 | - $stmt6->bindParam(":search", $request->like_search_term); |
|
| 34 | - $stmt6->bindParam(":pfirst", $page_first_result); |
|
| 35 | - $stmt6->bindParam(":pper", $results_per_page); |
|
| 36 | - $stmt6->execute(); |
|
| 32 | + $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 33 | + $stmt6->bindParam(":search", $request->like_search_term); |
|
| 34 | + $stmt6->bindParam(":pfirst", $page_first_result); |
|
| 35 | + $stmt6->bindParam(":pper", $results_per_page); |
|
| 36 | + $stmt6->execute(); |
|
| 37 | 37 | ?> |
| 38 | 38 | <?php $__video_h = new video_helper($__db); ?> |
| 39 | 39 | <?php $__user_h = new user_helper($__db); ?> |
@@ -213,14 +213,14 @@ discard block |
||
| 213 | 213 | <div id="results-main-content"> |
| 214 | 214 | <ol id="search-results"> |
| 215 | 215 | <?php |
| 216 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 217 | - $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
| 218 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 219 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 220 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 221 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 222 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 223 | - $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
| 216 | + while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 217 | + $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
| 218 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 219 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 220 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 221 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 222 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 223 | + $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
| 224 | 224 | ?> |
| 225 | 225 | <li class="yt-grid-box result-item-video *sr "> |
| 226 | 226 | <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box "> |
@@ -19,15 +19,15 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | $results_per_page = 12; |
| 21 | 21 | $number_of_result = $request->search_amount; |
| 22 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 22 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 23 | 23 | |
| 24 | - if (!isset ($_GET['page']) ) { |
|
| 24 | + if (!isset ($_GET['page'])) { |
|
| 25 | 25 | $page = 1; |
| 26 | 26 | } else { |
| 27 | - $page = (int)$_GET['page']; |
|
| 27 | + $page = (int) $_GET['page']; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 30 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 31 | 31 | |
| 32 | 32 | $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 33 | 33 | $stmt6->bindParam(":search", $request->like_search_term); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | <div id="results-main-content"> |
| 214 | 214 | <ol id="search-results"> |
| 215 | 215 | <?php |
| 216 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 216 | + while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
| 217 | 217 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
| 218 | 218 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 219 | 219 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | </div> |
| 259 | 259 | <div id="search-footer-box" class="searchFooterBox"> |
| 260 | 260 | <div class="yt-uix-pager" role="navigation"> |
| 261 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
| 261 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
| 262 | 262 | <a href="/results?search_query=<?php echo $request->search_term; ?>&page=<?php echo $page; ?>"> |
| 263 | 263 | <button class="yt-uix-button yt-uix-button-default"><?php echo $page; ?></button> |
| 264 | 264 | </a> |
@@ -25,21 +25,21 @@ discard block |
||
| 25 | 25 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - function addhttp($url) { |
|
| 29 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 30 | - $url = "http://" . $url; |
|
| 31 | - } |
|
| 32 | - return $url; |
|
| 33 | - } |
|
| 28 | + function addhttp($url) { |
|
| 29 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 30 | + $url = "http://" . $url; |
|
| 31 | + } |
|
| 32 | + return $url; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | 35 | function check_valid_colorhex($colorCode) { |
| 36 | 36 | // If user accidentally passed along the # sign, strip it off |
| 37 | 37 | $colorCode = ltrim($colorCode, '#'); |
| 38 | 38 | |
| 39 | 39 | if ( |
| 40 | - ctype_xdigit($colorCode) && |
|
| 40 | + ctype_xdigit($colorCode) && |
|
| 41 | 41 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
| 42 | - return true; |
|
| 42 | + return true; |
|
| 43 | 43 | |
| 44 | 44 | else return false; |
| 45 | 45 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
| 65 | 65 | |
| 66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
| 67 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 67 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 68 | 68 | |
| 69 | 69 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
| 70 | 70 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 74 | 74 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 75 | 75 | |
| 76 | - if(isset($_SESSION['siteusername'])) |
|
| 77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 76 | + if(isset($_SESSION['siteusername'])) |
|
| 77 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | 78 | |
| 79 | 79 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 80 | 80 | $error = array(); |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 89 | 89 | |
| 90 | 90 | if(!isset($error['message'])) { |
| 91 | - $text = $_POST['comment']; |
|
| 91 | + $text = $_POST['comment']; |
|
| 92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 93 | - $stmt->bindParam(":id", $_user['username']); |
|
| 94 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 95 | - $stmt->bindParam(":comment", $text); |
|
| 93 | + $stmt->bindParam(":id", $_user['username']); |
|
| 94 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 95 | + $stmt->bindParam(":comment", $text); |
|
| 96 | 96 | $stmt->execute(); |
| 97 | 97 | |
| 98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | - ?> |
|
| 105 | + ?> |
|
| 106 | 106 | <!DOCTYPE html> |
| 107 | 107 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
| 108 | 108 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 146 | 146 | <?php } ?> |
| 147 | 147 | <?php |
| 148 | - if(empty(trim($_user['bio']))) |
|
| 149 | - $_user['bio'] = "This user has no description."; |
|
| 150 | - ?> |
|
| 148 | + if(empty(trim($_user['bio']))) |
|
| 149 | + $_user['bio'] = "This user has no description."; |
|
| 150 | + ?> |
|
| 151 | 151 | <div id="content"> |
| 152 | 152 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 153 | 153 | <div class="content" id="recommended-channels-list"></div> |
@@ -306,20 +306,20 @@ discard block |
||
| 306 | 306 | </div> |
| 307 | 307 | <ol> |
| 308 | 308 | <?php |
| 309 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 310 | - $_playlist['count'] = 1; |
|
| 311 | - foreach($_playlist['videos'] as $video) { |
|
| 312 | - if($__video_h->video_exists($video)) { |
|
| 313 | - $_video = $__video_h->fetch_video_rid($video); |
|
| 314 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
| 315 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
| 316 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
| 317 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
| 318 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
| 319 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
| 320 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
| 321 | - $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
| 322 | - ?> |
|
| 309 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 310 | + $_playlist['count'] = 1; |
|
| 311 | + foreach($_playlist['videos'] as $video) { |
|
| 312 | + if($__video_h->video_exists($video)) { |
|
| 313 | + $_video = $__video_h->fetch_video_rid($video); |
|
| 314 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
| 315 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
| 316 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
| 317 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
| 318 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
| 319 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
| 320 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
| 321 | + $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
| 322 | + ?> |
|
| 323 | 323 | <li class="playlist-video-item |
| 324 | 324 | odd |
| 325 | 325 | "> |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | <h2>Featured Channels</h2> |
| 475 | 475 | <ul class="channel-summary-list "> |
| 476 | 476 | <?php |
| 477 | - foreach($_user['featured_channels'] as $user) { |
|
| 478 | - if($__user_h->user_exists($user)) { |
|
| 479 | - ?> |
|
| 477 | + foreach($_user['featured_channels'] as $user) { |
|
| 478 | + if($__user_h->user_exists($user)) { |
|
| 479 | + ?> |
|
| 480 | 480 | <li class="yt-tile-visible yt-uix-tile"> |
| 481 | 481 | <div class="channel-summary clearfix channel-summary-compact"> |
| 482 | 482 | <div class="channel-summary-thumb"> |
@@ -500,19 +500,19 @@ discard block |
||
| 500 | 500 | </div> |
| 501 | 501 | |
| 502 | 502 | <?php |
| 503 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 504 | - $stmt->bindParam(":search", $_user['username']); |
|
| 505 | - $stmt->execute(); |
|
| 503 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 504 | + $stmt->bindParam(":search", $_user['username']); |
|
| 505 | + $stmt->execute(); |
|
| 506 | 506 | |
| 507 | - if($stmt->rowCount() != 0) { |
|
| 508 | - ?> |
|
| 507 | + if($stmt->rowCount() != 0) { |
|
| 508 | + ?> |
|
| 509 | 509 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 510 | 510 | <div class="module-view gh-featured"> |
| 511 | 511 | <h2>Featured Playlists</h2> |
| 512 | 512 | <?php |
| 513 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 514 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 515 | - ?> |
|
| 513 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 514 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 515 | + ?> |
|
| 516 | 516 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 517 | 517 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 518 | 518 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | <?php |
| 15 | 15 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
| 16 | 16 | |
| 17 | - if(!$__user_h->user_exists($_playlist['author'])) |
|
| 17 | + if (!$__user_h->user_exists($_playlist['author'])) |
|
| 18 | 18 | header("Location: /?userdoesntexist"); |
| 19 | 19 | |
| 20 | 20 | $_user = $__user_h->fetch_user_username($_playlist['author']); |
@@ -66,28 +66,28 @@ discard block |
||
| 66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
| 67 | 67 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 68 | 68 | |
| 69 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 70 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 71 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 69 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 70 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 75 | 75 | |
| 76 | - if(isset($_SESSION['siteusername'])) |
|
| 76 | + if (isset($_SESSION['siteusername'])) |
|
| 77 | 77 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 78 | 78 | |
| 79 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 79 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 80 | 80 | $error = array(); |
| 81 | 81 | |
| 82 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 83 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 84 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 82 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 83 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 84 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 85 | 85 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 86 | 86 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 87 | - 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; } |
|
| 87 | + 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; } |
|
| 88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 89 | 89 | |
| 90 | - if(!isset($error['message'])) { |
|
| 90 | + if (!isset($error['message'])) { |
|
| 91 | 91 | $text = $_POST['comment']; |
| 92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 93 | 93 | $stmt->bindParam(":id", $_user['username']); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 99 | 99 | |
| 100 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 100 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 101 | 101 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 126 | 126 | <style> |
| 127 | 127 | #content-container { |
| 128 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 128 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 129 | 129 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
| 130 | 130 | background-repeat: repeat; |
| 131 | 131 | background-position: center top; |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 142 | 142 | <div id="content-container"> |
| 143 | 143 | <!-- begin content --> |
| 144 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 144 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 145 | 145 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 146 | 146 | <?php } ?> |
| 147 | 147 | <?php |
| 148 | - if(empty(trim($_user['bio']))) |
|
| 148 | + if (empty(trim($_user['bio']))) |
|
| 149 | 149 | $_user['bio'] = "This user has no description."; |
| 150 | 150 | ?> |
| 151 | 151 | <div id="content"> |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | </div> |
| 206 | 206 | </div> |
| 207 | 207 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 208 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 208 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 209 | 209 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 210 | 210 | <button |
| 211 | 211 | href="#" |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | title="" |
| 214 | 214 | id="subscribe-button" |
| 215 | 215 | type="button" |
| 216 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 216 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 217 | 217 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 218 | 218 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 219 | 219 | <span class="subscribed-label">Subscribed</span> |
@@ -247,12 +247,12 @@ discard block |
||
| 247 | 247 | </div> |
| 248 | 248 | </div> |
| 249 | 249 | </div> |
| 250 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 250 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 251 | 251 | <div id="branded-page-body"> |
| 252 | 252 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 253 | 253 | <div class="tab-content-body"> |
| 254 | 254 | <div class="primary-pane"> |
| 255 | - <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 255 | + <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 256 | 256 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> |
| 257 | 257 | <div class="module-view featured-video-view-module"> |
| 258 | 258 | <div class="channels-video-player " data-swf-config="{"assets": {"html": "\/html5_player_template", "css": "http:\/\/s.ytimg.com\/yt\/cssbin\/www-player-vfllhw7HB.css", "js": "http:\/\/s.ytimg.com\/yt\/jsbin\/html5player-vflzTrRqK.js"}, "url": "http:\/\/s.ytimg.com\/yt\/swfbin\/watch_as3-vflbPspVE.swf", "min_version": "8.0.0", "args": {"ttsurl": "http:\/\/www.youtube.com\/api\/timedtext?sparams=asr_langs%2Ccaps%2Cv%2Cexpire\u0026asr_langs=en%2Cko%2Cja%2Ces\u0026v=/watch?v=<?php echo $video['rid']; ?>\u0026caps=asr\u0026expire=1339746882\u0026key=yttt1\u0026signature=A1B858FF427B45672676C7403417ED1F4091A806.C347A6021C0F843E46F2056AEBA38FC93A0A47B8\u0026hl=en_US", "el": "profilepage", "fexp": "904001,907342,904824,910206,908620,907217,907335,921602,919306,922600,919316,920704,912804,913542,919324,912706", "url_encoded_fmt_stream_map": "url=http%3A%2F%2Fo-o.preferred.nuq04s10.v1.lscache4.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D44%26ip%3D207.0.0.0%26signature%3D9B9B5ECF02F2F66BDCCB0ACED26D3406F9F83241.1B2CC833461E3D2C4D081B7DFBC65B0948C61FB9%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v1.cache4.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=44,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D35%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3DB702D7CA72653169BDC2C945B5A35F4A23A3FEBF.ACC660CDAB11901FF8D3DA8D384D61F0AB0F0125%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=35,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v24.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D43%26ip%3D207.0.0.0%26signature%3D9FABDD8C013AA137B87DF2D154D1B90E6827A2A3.880FECDEC066236D85FCF223CF472B62B8F9B3A4%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v24.cache3.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=43,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v3.lscache7.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D34%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D1BA326B784DAA9F62FD789CBB5C2FABFCD5D351C.C4618E3AB2AB08C61C6A982A36F405DA886B5D5A%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v3.cache7.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=34,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D18%26ip%3D207.0.0.0%26signature%3D8806EA8FAE16557A2F9732068442133EA0A0760F.D91694A47E6B0BF627965CDA46010F36105A28FE%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026itag=18,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v4.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D5%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D011CB6739AB60ED79D032DE2F62EB016D8A8E462.C2C0ABE42F26DBA18F2BC6E0D074EB99A95C0DF0%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v4.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=5,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v12.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D36%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D988FDD37CBA8DB74C1148EE17921D8549434297C.A2C1796F2BA0427C9FE370BFB6B3B09BA1D81B07%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v12.cache3.c.youtube.com\u0026type=video%2F3gpp\u0026itag=36", "allow_embed": 1, "vq": "auto", "account_playback_token": "", "allow_ratings": 1, "keywords": "Rehearsal,Dance,justin,bieber,believe,as,long,you,love,me,rodney,jerkins,pattie,mallette,jeremy,dad,mom,scooter,braun,island,def,jam,usher,rbmg,making,of,the,album,webisode,june,19th,19,new,amazing,song,big,sean,hit,record,<?php echo htmlspecialchars($_user['username']); ?>,always,still,studio,singing,kuk,harrell,producer,sing,boy,guy,man,smash,single,nick,demoura,dancers,sweat,beliebers,hard,work,tour,band", "cc3_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitles3_module-vflu_Qeod.swf", "track_embed": 0, "is_purchased": false, "ps": "default", "fmt_list": "44\/854x480\/99\/0\/0,35\/854x480\/9\/0\/115,43\/640x360\/99\/0\/0,34\/640x360\/9\/0\/115,18\/640x360\/9\/0\/115,5\/320x240\/7\/0\/0,36\/320x240\/99\/0\/0", "author": "<?php echo htmlspecialchars($_user['username']); ?>", "muted": "0", "cc_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitle_module-vflq8KnSi.swf", "length_seconds": 82, "feature": "g-logo-xit", "enablejsapi": 1, "rel": 0, "plid": "AATCeEL9eg3Ls9t-", "cc_font": "Arial Unicode MS, arial, verdana, _sans", "ftoken": "", "sdetail": "f:g-logo-xit,p:\/", "status": "ok", "cc_asr": 1, "watermark": ",http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_watermark-vflHX6b6E.png,http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_hd_watermark-vflAzLcD6.png", "sourceid": "y", "timestamp": 1339721682, "has_cc": true, "view_count": 2600, "quality_cap": "highres", "hl": "en_US", "tmi": "1", "no_get_video_log": "1", "eurl": "http:\/\/www.youtube.com\/user\/<?php echo htmlspecialchars($_user['username']); ?>", "iurl": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/hqdefault.jpg", "endscreen_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/endscreen-vflJBKwqC.swf", "referrer": "http:\/\/www.youtube.com\/", "avg_rating": 4.97805486284, "video_id": "/watch?v=<?php echo $video['rid']; ?>", "sendtmp": "1", "sk": "bwv_lGOGF4u1g0p7puy7ERICN8NZ5cVFC", "is_video_preview": false, "token": "vjVQa1PpcFMSYb-unvOiIgSL8pW9tObJUMfrEc1mxfE=", "thumbnail_url": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/default.jpg", "iurlsd": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/sddefault.jpg", "autoplay": "1"}, "url_v9as2": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "params": {"allowscriptaccess": "always", "allowfullscreen": "true", "bgcolor": "#000000"}, "attrs": {"width": "640", "id": "movie_player", "height": "390"}, "url_v8": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "html5": false}" data-video-id="/watch?v=<?php echo $video['rid']; ?>"> |
@@ -308,8 +308,8 @@ discard block |
||
| 308 | 308 | <?php |
| 309 | 309 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 310 | 310 | $_playlist['count'] = 1; |
| 311 | - foreach($_playlist['videos'] as $video) { |
|
| 312 | - if($__video_h->video_exists($video)) { |
|
| 311 | + foreach ($_playlist['videos'] as $video) { |
|
| 312 | + if ($__video_h->video_exists($video)) { |
|
| 313 | 313 | $_video = $__video_h->fetch_video_rid($video); |
| 314 | 314 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
| 315 | 315 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | </div> |
| 409 | 409 | <hr class="yt-horizontal-rule "> |
| 410 | 410 | </div> |
| 411 | - <?php if(!empty($_user['website'])) { ?> |
|
| 411 | + <?php if (!empty($_user['website'])) { ?> |
|
| 412 | 412 | <div class="user-profile-item"> |
| 413 | 413 | <div class="yt-c3-profile-custom-url field-container "> |
| 414 | 414 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | <h5>Country</h5> |
| 458 | 458 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 459 | 459 | </div> |
| 460 | - <?php if($_user['genre'] != "none") { ?> |
|
| 460 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 461 | 461 | <div class="user-profile-item "> |
| 462 | 462 | <h5>Channel Genre</h5> |
| 463 | 463 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -469,13 +469,13 @@ discard block |
||
| 469 | 469 | </div> |
| 470 | 470 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 471 | 471 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 472 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 472 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 473 | 473 | <div class="module-view other-channels-view"> |
| 474 | 474 | <h2>Featured Channels</h2> |
| 475 | 475 | <ul class="channel-summary-list "> |
| 476 | 476 | <?php |
| 477 | - foreach($_user['featured_channels'] as $user) { |
|
| 478 | - if($__user_h->user_exists($user)) { |
|
| 477 | + foreach ($_user['featured_channels'] as $user) { |
|
| 478 | + if ($__user_h->user_exists($user)) { |
|
| 479 | 479 | ?> |
| 480 | 480 | <li class="yt-tile-visible yt-uix-tile"> |
| 481 | 481 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -504,13 +504,13 @@ discard block |
||
| 504 | 504 | $stmt->bindParam(":search", $_user['username']); |
| 505 | 505 | $stmt->execute(); |
| 506 | 506 | |
| 507 | - if($stmt->rowCount() != 0) { |
|
| 507 | + if ($stmt->rowCount() != 0) { |
|
| 508 | 508 | ?> |
| 509 | 509 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 510 | 510 | <div class="module-view gh-featured"> |
| 511 | 511 | <h2>Featured Playlists</h2> |
| 512 | 512 | <?php |
| 513 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 513 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 514 | 514 | $playlist['videos'] = json_decode($playlist['videos']); |
| 515 | 515 | ?> |
| 516 | 516 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | <?php |
| 15 | 15 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
| 16 | 16 | |
| 17 | - if(!$__user_h->user_exists($_playlist['author'])) |
|
| 18 | - header("Location: /?userdoesntexist"); |
|
| 17 | + if(!$__user_h->user_exists($_playlist['author'])) { |
|
| 18 | + header("Location: /?userdoesntexist"); |
|
| 19 | + } |
|
| 19 | 20 | |
| 20 | 21 | $_user = $__user_h->fetch_user_username($_playlist['author']); |
| 21 | 22 | |
@@ -38,10 +39,11 @@ discard block |
||
| 38 | 39 | |
| 39 | 40 | if ( |
| 40 | 41 | ctype_xdigit($colorCode) && |
| 41 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 42 | - return true; |
|
| 43 | - |
|
| 44 | - else return false; |
|
| 42 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 43 | + return true; |
|
| 44 | + } else { |
|
| 45 | + return false; |
|
| 46 | + } |
|
| 45 | 47 | } |
| 46 | 48 | |
| 47 | 49 | $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']); |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 74 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 75 | 77 | |
| 76 | - if(isset($_SESSION['siteusername'])) |
|
| 77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | + if(isset($_SESSION['siteusername'])) { |
|
| 79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 80 | + } |
|
| 78 | 81 | |
| 79 | 82 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 80 | 83 | $error = array(); |
@@ -145,8 +148,9 @@ discard block |
||
| 145 | 148 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 146 | 149 | <?php } ?> |
| 147 | 150 | <?php |
| 148 | - if(empty(trim($_user['bio']))) |
|
| 149 | - $_user['bio'] = "This user has no description."; |
|
| 151 | + if(empty(trim($_user['bio']))) { |
|
| 152 | + $_user['bio'] = "This user has no description."; |
|
| 153 | + } |
|
| 150 | 154 | ?> |
| 151 | 155 | <div id="content"> |
| 152 | 156 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | <?php $__user_h = new user_helper($__db); ?> |
| 11 | 11 | <?php $__db_h = new db_helper(); ?> |
| 12 | 12 | <?php $__time_h = new time_helper(); ?> |
| 13 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 13 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 14 | 14 | <!DOCTYPE html> |
| 15 | 15 | <html dir="ltr"> |
| 16 | 16 | <head> |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | ?> |
| 161 | 161 | |
| 162 | 162 | <div class="my_videos_ajax"> |
| 163 | - <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
| 163 | + <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
| 164 | 164 | <div style="width: 33%;display: inline-block;"> |
| 165 | 165 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>"> |
| 166 | 166 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;"> |