@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | <?php $__user_u = new user_update($__db); ?> |
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 14 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 18 | + if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | 19 | header("Location: /"); |
| 20 | 20 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 21 | + if (isset($_SESSION['siteusername'])) |
|
| 22 | 22 | $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
| 23 | 23 | |
| 24 | 24 | $_SESSION['current_video'] = $_video['rid']; |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 68 | 68 | </script> |
| 69 | 69 | <?php |
| 70 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 70 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | 71 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
| 72 | 72 | |
| 73 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 75 | 75 | |
| 76 | 76 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
| 77 | 77 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
| 78 | 78 | |
| 79 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 79 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | 80 | $_video['likeswidth'] = 0; |
| 81 | 81 | $_video['dislikeswidth'] = 0; |
| 82 | 82 | } else { |
| 83 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 83 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
| 84 | 84 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | </div> |
| 115 | 115 | <div id="instream_google_companion_ad_div"></div> |
| 116 | 116 | </div> |
| 117 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 117 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 118 | 118 | <div id="watch-owner-container"> |
| 119 | 119 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 120 | 120 | <ul class="yt-nav-aside"> |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | </div> |
| 134 | 134 | </div><br> |
| 135 | 135 | <?php } ?> |
| 136 | - <?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 136 | + <?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 137 | 137 | <div id="watch-owner-container"> |
| 138 | 138 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 139 | 139 | <ul class="yt-nav-aside"> |
@@ -159,10 +159,10 @@ discard block |
||
| 159 | 159 | $stmt->execute(); |
| 160 | 160 | $alts = $stmt->rowCount(); |
| 161 | 161 | |
| 162 | - if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 162 | + if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 163 | 163 | |
| 164 | - while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 165 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 164 | + while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 165 | + if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 166 | 166 | echo " |
| 167 | 167 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
| 168 | 168 | htmlspecialchars($username['username']) |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | title="" |
| 188 | 188 | id="subscribe-button" |
| 189 | 189 | type="button" |
| 190 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 190 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 191 | 191 | role="button"> |
| 192 | 192 | <span class="yt-uix-button-icon-wrapper"> |
| 193 | 193 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | <div id="watch-main-container"> |
| 246 | 246 | <div id="watch-main"> |
| 247 | 247 | <div id="watch-panel"> |
| 248 | - <?php if($_video['visibility'] == "u") { ?> |
|
| 248 | + <?php if ($_video['visibility'] == "u") { ?> |
|
| 249 | 249 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 250 | 250 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 251 | 251 | </div> |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | This video is unlisted. Only people who have the link can view this video. |
| 255 | 255 | </div> |
| 256 | 256 | </div></div></div> |
| 257 | - <?php } else if($_video['visibility'] == "v") { ?> |
|
| 257 | + <?php } else if ($_video['visibility'] == "v") { ?> |
|
| 258 | 258 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 259 | 259 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 260 | 260 | </div> |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | <button onclick=";window.location.href=this.getAttribute('href');return false;" href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 289 | 289 | title="I like this" |
| 290 | 290 | type="button" |
| 291 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 291 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 292 | 292 | id="watch-like" |
| 293 | 293 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 294 | 294 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | type="button" |
| 303 | 303 | style="margin-left: -2px;" |
| 304 | 304 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 305 | - 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" |
|
| 305 | + 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" |
|
| 306 | 306 | id="watch-unlike" |
| 307 | 307 | role="button"> |
| 308 | 308 | <span class="yt-uix-button-icon-wrapper"> |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | </div> |
| 323 | 323 | </div> |
| 324 | 324 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 325 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 325 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 326 | 326 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 327 | 327 | <div class="yt-alert-icon"> |
| 328 | 328 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | <?php } else { ?> |
| 339 | 339 | <h3>Be friends with the creator</h3> |
| 340 | 340 | |
| 341 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 341 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 342 | 342 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 343 | 343 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 344 | 344 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -352,8 +352,8 @@ discard block |
||
| 352 | 352 | </span><br><br> |
| 353 | 353 | <?php } ?> |
| 354 | 354 | |
| 355 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 356 | - <?php if($_video['friended'] == false) { ?> |
|
| 355 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 356 | + <?php if ($_video['friended'] == false) { ?> |
|
| 357 | 357 | <a href="/friends">Send a friend request</a> |
| 358 | 358 | <?php } else { ?> |
| 359 | 359 | Your friend request is pending. |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | <?php } ?> |
| 364 | 364 | <hr><br> |
| 365 | 365 | <h3>Add to Favorites</h3> |
| 366 | - <?php if($_video['favorited'] == false) { ?> |
|
| 366 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 367 | 367 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 368 | 368 | <?php } else { ?> |
| 369 | 369 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -374,10 +374,10 @@ discard block |
||
| 374 | 374 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 375 | 375 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 376 | 376 | $stmt->execute(); |
| 377 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 377 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 378 | 378 | $buffer = json_decode($playlist['videos']); |
| 379 | 379 | @$rid = $buffer[0]; |
| 380 | - if(!empty($rid)) { |
|
| 380 | + if (!empty($rid)) { |
|
| 381 | 381 | @$video = $__video_h->fetch_video_rid($rid); |
| 382 | 382 | } else { |
| 383 | 383 | $video['thumbnail'] = ""; |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | $stmt->execute(); |
| 656 | 656 | ?> |
| 657 | 657 | |
| 658 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 658 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 659 | 659 | <div class="comments-section"> |
| 660 | 660 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 661 | 661 | see all |
@@ -663,8 +663,8 @@ discard block |
||
| 663 | 663 | <h4>Video Responses</h4> |
| 664 | 664 | <ul class="video-list"> |
| 665 | 665 | <?php |
| 666 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 667 | - if($__video_h->video_exists($video['video'])) { |
|
| 666 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 667 | + if ($__video_h->video_exists($video['video'])) { |
|
| 668 | 668 | $video = $__video_h->fetch_video_rid($video['video']); |
| 669 | 669 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 670 | 670 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -695,18 +695,18 @@ discard block |
||
| 695 | 695 | </h4> |
| 696 | 696 | </div> |
| 697 | 697 | </div> |
| 698 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 698 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 699 | 699 | <div class="comments-post-container clearfix"> |
| 700 | 700 | <div class="comments-post-alert"> |
| 701 | 701 | <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> |
| 702 | 702 | </div> |
| 703 | 703 | </div> |
| 704 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 704 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 705 | 705 | <div class="comments-disabled-message"> |
| 706 | 706 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
| 707 | 707 | <span>Adding comments has been disabled for this video.</span> |
| 708 | 708 | </div> |
| 709 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 709 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 710 | 710 | <div class="comments-post-container clearfix"> |
| 711 | 711 | <div class="comments-post-alert"> |
| 712 | 712 | This user has blocked you! |
@@ -760,15 +760,15 @@ discard block |
||
| 760 | 760 | $stmt->execute(); |
| 761 | 761 | |
| 762 | 762 | $number_of_result = $stmt->rowCount(); |
| 763 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 763 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 764 | 764 | |
| 765 | - if (!isset ($_GET['page']) ) { |
|
| 765 | + if (!isset ($_GET['page'])) { |
|
| 766 | 766 | $page = 1; |
| 767 | 767 | } else { |
| 768 | - $page = (int)$_GET['page']; |
|
| 768 | + $page = (int) $_GET['page']; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 771 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 772 | 772 | |
| 773 | 773 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 774 | 774 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -776,10 +776,10 @@ discard block |
||
| 776 | 776 | $stmt->bindParam(":pper", $results_per_page); |
| 777 | 777 | $stmt->execute(); |
| 778 | 778 | |
| 779 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 780 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 779 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 780 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 781 | 781 | $comment['liked'] = true; |
| 782 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 782 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 783 | 783 | $comment['disliked'] = true; |
| 784 | 784 | |
| 785 | 785 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
| 802 | 802 | </span> |
| 803 | 803 | </span></span> |
| 804 | - <?php if($comment['likes'] != 0) { ?> |
|
| 804 | + <?php if ($comment['likes'] != 0) { ?> |
|
| 805 | 805 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
| 806 | 806 | <?php echo $comment['likes']; ?> |
| 807 | 807 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | </button> |
| 830 | 830 | </span> |
| 831 | 831 | </div> |
| 832 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 832 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 833 | 833 | <li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>"> |
| 834 | 834 | |
| 835 | 835 | <div class="comment-body"> |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | $stmt2->bindParam(":rid", $comment['id']); |
| 855 | 855 | $stmt2->execute(); |
| 856 | 856 | |
| 857 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 857 | + while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 858 | 858 | ?> |
| 859 | 859 | <li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0"> |
| 860 | 860 | <div class="comment-body"> |
@@ -937,11 +937,11 @@ discard block |
||
| 937 | 937 | <?php |
| 938 | 938 | $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
| 939 | 939 | $stmt->execute(); |
| 940 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 940 | + while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 941 | 941 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 942 | 942 | $_playlist['count'] = 1; |
| 943 | 943 | |
| 944 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 944 | + if ($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 945 | 945 | $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
| 946 | 946 | } else { |
| 947 | 947 | $video = []; |
@@ -996,7 +996,7 @@ discard block |
||
| 996 | 996 | <?php |
| 997 | 997 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
| 998 | 998 | $stmt->execute(); |
| 999 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 999 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 1000 | 1000 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 1001 | 1001 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 1002 | 1002 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | <?php $__db_h = new db_helper(); ?> |
| 9 | 9 | <?php $__time_h = new time_helper(); ?> |
| 10 | 10 | <?php |
| 11 | - $__server->page_embeds->page_title = "SubRocks"; |
|
| 12 | - $__server->page_embeds->page_description = "Share your videos with friends, family, and the world"; |
|
| 13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 11 | + $__server->page_embeds->page_title = "SubRocks"; |
|
| 12 | + $__server->page_embeds->page_description = "Share your videos with friends, family, and the world"; |
|
| 13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 15 | 15 | ?> |
| 16 | 16 | <html lang="en"> |
| 17 | 17 | <head> |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | <?php |
| 64 | 64 | $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' ORDER BY id DESC LIMIT 1"); |
| 65 | 65 | $stmt->execute(); |
| 66 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 66 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 67 | 67 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 68 | 68 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 69 | 69 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -71,20 +71,20 @@ discard block |
||
| 71 | 71 | $video['title'] = htmlspecialchars($video['title']); |
| 72 | 72 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 73 | 73 | ?> |
| 74 | - <div class="context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="<?php echo $video['views']; ?> views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="6:58"> |
|
| 75 | - <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CAMQ0x4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-370 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" width="370"><span class="vertical-align"></span></span></span></span><span class="video-time">6:58</span> |
|
| 76 | - <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 74 | + <div class="context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="<?php echo $video['views']; ?> views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="6:58"> |
|
| 75 | + <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CAMQ0x4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-370 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" width="370"><span class="vertical-align"></span></span></span></span><span class="video-time">6:58</span> |
|
| 76 | + <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 77 | 77 | </span> <img class="yt-uix-button-arrow" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" title=""> |
| 78 | 78 | </button> |
| 79 | 79 | </a> |
| 80 | - <a class="lohp-video-link max-line-2 yt-uix-sessionlink" data-sessionlink="ved=CAMQ0x4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 80 | + <a class="lohp-video-link max-line-2 yt-uix-sessionlink" data-sessionlink="ved=CAMQ0x4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 81 | 81 | <div class="lohp-video-metadata attached"> |
| 82 | 82 | <span class="content-uploader"> |
| 83 | - <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 83 | + <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 84 | 84 | </span> |
| 85 | 85 | </div> |
| 86 | - <p title="<?php echo $video['description']; ?>" class="lohp-blog-headline"> |
|
| 87 | - <?php echo $video['description']; ?> |
|
| 86 | + <p title="<?php echo $video['description']; ?>" class="lohp-blog-headline"> |
|
| 87 | + <?php echo $video['description']; ?> |
|
| 88 | 88 | </p> |
| 89 | 89 | <a title="Trending" href="#" class="lohp-blog-attribution"> |
| 90 | 90 | <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" class="lohp-blog-decoration">Trending & Featured: SubRocks |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | <?php |
| 97 | 97 | $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' ORDER BY id DESC LIMIT 1, 3"); |
| 98 | 98 | $stmt->execute(); |
| 99 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 99 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 100 | 100 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 101 | 101 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 102 | 102 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -104,23 +104,23 @@ discard block |
||
| 104 | 104 | $video['title'] = htmlspecialchars($video['title']); |
| 105 | 105 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 106 | 106 | ?> |
| 107 | - <div class="lohp-medium-shelf context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="5,761,446 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 107 | + <div class="lohp-medium-shelf context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="5,761,446 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 108 | 108 | <div class="lohp-media-object"> |
| 109 | - <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CAQQ0x4oAQ&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-128 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" width="128"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 110 | - <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 109 | + <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CAQQ0x4oAQ&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-128 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" width="128"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 110 | + <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 111 | 111 | </span> <img class="yt-uix-button-arrow" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" title=""> |
| 112 | 112 | </button> |
| 113 | 113 | </a> |
| 114 | 114 | </div> |
| 115 | 115 | <div class="lohp-media-object-content lohp-medium-shelf-content"> |
| 116 | - <a class="lohp-video-link max-line-1 yt-uix-sessionlink" data-sessionlink="ved=CAQQ0x4oAQ&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 116 | + <a class="lohp-video-link max-line-1 yt-uix-sessionlink" data-sessionlink="ved=CAQQ0x4oAQ&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 117 | 117 | <div class="lohp-video-metadata attached"> |
| 118 | 118 | <span class="content-uploader"> |
| 119 | - <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 119 | + <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 120 | 120 | </span> |
| 121 | 121 | </div> |
| 122 | - <p title="<?php echo $video['title']; ?>" class="lohp-blog-headline"> |
|
| 123 | - <?php echo $video['title']; ?> |
|
| 122 | + <p title="<?php echo $video['title']; ?>" class="lohp-blog-headline"> |
|
| 123 | + <?php echo $video['title']; ?> |
|
| 124 | 124 | </p> |
| 125 | 125 | </div> |
| 126 | 126 | </div> |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | <?php |
| 140 | 140 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY id DESC LIMIT 6"); |
| 141 | 141 | $stmt->execute(); |
| 142 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 142 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 143 | 143 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 144 | 144 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 145 | 145 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | <?php |
| 179 | 179 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Entertainment' ORDER BY rand() LIMIT 3"); |
| 180 | 180 | $stmt->execute(); |
| 181 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 181 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 182 | 182 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 183 | 183 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 184 | 184 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | <?php |
| 218 | 218 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Sports' ORDER BY rand() LIMIT 3"); |
| 219 | 219 | $stmt->execute(); |
| 220 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 220 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 221 | 221 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 222 | 222 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 223 | 223 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | <?php |
| 257 | 257 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = 'bhief' ORDER BY rand() LIMIT 1"); |
| 258 | 258 | $stmt->execute(); |
| 259 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 259 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 260 | 260 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 261 | 261 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 262 | 262 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | <?php |
| 294 | 294 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Music' ORDER BY rand() LIMIT 2"); |
| 295 | 295 | $stmt->execute(); |
| 296 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 296 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 297 | 297 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 298 | 298 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 299 | 299 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | <?php |
| 333 | 333 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Gaming' ORDER BY rand() LIMIT 3"); |
| 334 | 334 | $stmt->execute(); |
| 335 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 335 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 336 | 336 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 337 | 337 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 338 | 338 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | <?php |
| 372 | 372 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Gaming' ORDER BY rand() LIMIT 2"); |
| 373 | 373 | $stmt->execute(); |
| 374 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 374 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 375 | 375 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 376 | 376 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 377 | 377 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -379,19 +379,19 @@ discard block |
||
| 379 | 379 | $video['title'] = htmlspecialchars($video['title']); |
| 380 | 380 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 381 | 381 | ?> |
| 382 | - <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 382 | + <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 383 | 383 | <div class="lohp-media-object"> |
| 384 | - <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 385 | - <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 384 | + <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 385 | + <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 386 | 386 | </span> <img class="yt-uix-button-arrow" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" title=""> |
| 387 | 387 | </button> |
| 388 | 388 | </a> |
| 389 | 389 | </div> |
| 390 | 390 | <div class="lohp-vertical-shelf-item-content lohp-media-object-content"> |
| 391 | - <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 391 | + <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 392 | 392 | <div class="lohp-video-metadata attached"> |
| 393 | 393 | <span class="content-uploader"> |
| 394 | - <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 394 | + <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 395 | 395 | </span> |
| 396 | 396 | </div> |
| 397 | 397 | </div> |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | <?php |
| 408 | 408 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Music' ORDER BY rand() LIMIT 4"); |
| 409 | 409 | $stmt->execute(); |
| 410 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 410 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 411 | 411 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 412 | 412 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 413 | 413 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -415,19 +415,19 @@ discard block |
||
| 415 | 415 | $video['title'] = htmlspecialchars($video['title']); |
| 416 | 416 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 417 | 417 | ?> |
| 418 | - <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 418 | + <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 419 | 419 | <div class="lohp-media-object"> |
| 420 | - <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 421 | - <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 420 | + <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 421 | + <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 422 | 422 | </span> <img class="yt-uix-button-arrow" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" title=""> |
| 423 | 423 | </button> |
| 424 | 424 | </a> |
| 425 | 425 | </div> |
| 426 | 426 | <div class="lohp-vertical-shelf-item-content lohp-media-object-content"> |
| 427 | - <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 427 | + <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 428 | 428 | <div class="lohp-video-metadata attached"> |
| 429 | 429 | <span class="content-uploader"> |
| 430 | - <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 430 | + <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 431 | 431 | </span> |
| 432 | 432 | </div> |
| 433 | 433 | </div> |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | <?php |
| 444 | 444 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Trending' ORDER BY rand() LIMIT 4"); |
| 445 | 445 | $stmt->execute(); |
| 446 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 446 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 447 | 447 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 448 | 448 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 449 | 449 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -451,19 +451,19 @@ discard block |
||
| 451 | 451 | $video['title'] = htmlspecialchars($video['title']); |
| 452 | 452 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 453 | 453 | ?> |
| 454 | - <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 454 | + <div class="lohp-vertical-shelf-item context-data-item" data-context-item-id="<?php echo $video['rid']; ?>" data-context-item-type="video" data-context-item-title="<?php echo $video['title']; ?>" data-context-item-views="303 views" data-context-item-user="<?php echo $video['author']; ?>" data-context-item-time="<?php echo $video['duration']; ?>"> |
|
| 455 | 455 | <div class="lohp-media-object"> |
| 456 | - <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 457 | - <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 456 | + <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo"><span class="video-thumb ux-thumb yt-thumb-default-64 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="64"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
|
| 457 | + <button onclick=";return false;" type="button" class="addto-button video-actions spf-nolink addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" title="Watch Later" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="<?php echo $video['rid']; ?>" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
|
| 458 | 458 | </span> <img class="yt-uix-button-arrow" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="" title=""> |
| 459 | 459 | </button> |
| 460 | 460 | </a> |
| 461 | 461 | </div> |
| 462 | 462 | <div class="lohp-vertical-shelf-item-content lohp-media-object-content"> |
| 463 | - <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 463 | + <a class="lohp-video-link max-line-3 yt-uix-sessionlink" data-sessionlink="ved=CCsQzx4oAA&ei=7pFAUZzAG52shAGGr4DACw&feature=g-logo" href="/watch?v=<?php echo $video['rid']; ?>" title="<?php echo $video['title']; ?>"><?php echo $video['title']; ?></a> |
|
| 464 | 464 | <div class="lohp-video-metadata attached"> |
| 465 | 465 | <span class="content-uploader"> |
| 466 | - <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 466 | + <span class="username-prepend">by</span> <a href="/user/<?php echo $video['author']; ?>" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw" dir="ltr"><?php echo $video['author']; ?></a> |
|
| 467 | 467 | </span> |
| 468 | 468 | </div> |
| 469 | 469 | </div> |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | <div class="guide-recommendations-list"> |
| 104 | 104 | <div class="guide-channels-content"> |
| 105 | 105 | <ul class="guide-channels-list guide-item-container yt-uix-scroller filter-has-matches"> |
| 106 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 107 | - <?php foreach($__server->featured_channels as $channel) { ?> |
|
| 106 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 107 | + <?php foreach ($__server->featured_channels as $channel) { ?> |
|
| 108 | 108 | <li class="guide-channel"> |
| 109 | 109 | <a class="guide-item yt-uix-sessionlink narrow-item" href="/feed/UCF1cWZk-kVBrN9AM_ey7qdQ" title="<?php echo htmlspecialchars($channel); ?>" data-channel-id="UCF1cWZk-kVBrN9AM_ey7qdQ" data-featured="1" data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw&feature=g-featured"> |
| 110 | 110 | <span class="thumb"><span class="video-thumb ux-thumb yt-thumb-square-18 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb-manual="1" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" data-group-key="guide-channel-thumbs" width="18"><span class="vertical-align"></span></span></span></span></span> |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $stmt = $__db->prepare("SELECT * FROM subscribers WHERE sender = :username ORDER BY id DESC LIMIT 20"); |
| 119 | 119 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 120 | 120 | $stmt->execute(); |
| 121 | - while($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
| 121 | + while ($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
| 122 | 122 | <li class="guide-channel"> |
| 123 | 123 | <a class="guide-item yt-uix-sessionlink narrow-item" href="/feed/UCF1cWZk-kVBrN9AM_ey7qdQ" title="<?php echo htmlspecialchars($channel); ?>" data-channel-id="UCF1cWZk-kVBrN9AM_ey7qdQ" data-featured="1" data-sessionlink="ei=7pFAUZzAG52shAGGr4DACw&feature=g-featured"> |
| 124 | 124 | <span class="thumb"><span class="video-thumb ux-thumb yt-thumb-square-18 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb-manual="1" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" data-group-key="guide-channel-thumbs" width="18"><span class="vertical-align"></span></span></span></span></span> |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | - if(isset($_SESSION['siteusername'])) { |
|
| 2 | + if(isset($_SESSION['siteusername'])) { |
|
| 3 | 3 | $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username"); |
| 4 | 4 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 5 | - $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 5 | + $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 6 | 6 | $stmt->execute(); |
| 7 | - } |
|
| 7 | + } |
|
| 8 | 8 | |
| 9 | - if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 10 | - die("<a href='/logout'>Your user has been deleted. Logout</a>"); |
|
| 11 | - } |
|
| 9 | + if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 10 | + die("<a href='/logout'>Your user has been deleted. Logout</a>"); |
|
| 11 | + } |
|
| 12 | 12 | ?> |
| 13 | 13 | <!-- begin masthead --> |
| 14 | 14 | <div id="masthead" class="" dir="ltr"> |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(isset($_SESSION['siteusername'])) { |
|
| 2 | + if (isset($_SESSION['siteusername'])) { |
|
| 3 | 3 | $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username"); |
| 4 | 4 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 5 | - $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 5 | + $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 6 | 6 | $stmt->execute(); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | - if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 9 | + if (isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 10 | 10 | die("<a href='/logout'>Your user has been deleted. Logout</a>"); |
| 11 | 11 | } |
| 12 | 12 | ?> |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | <a id="logo-container" href="/" title="SubRocks home"> |
| 16 | 16 | <img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks home"> |
| 17 | 17 | </a> |
| 18 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 18 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 19 | 19 | <div id="yt-masthead-signin"> |
| 20 | 20 | <div id="masthead-user-display"><span id="masthead-user-wrapper"><button href="/sign_in" type="button" id="masthead-user-button" onclick=";window.location.href=this.getAttribute('href');return false;" class=" yt-uix-button yt-uix-button-text" role="button"><span class="yt-uix-button-content"> <span id="masthead-user-image"> |
| 21 | 21 | <span class="clip"> |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | <div id="masthead-user-bar"> |
| 34 | 34 | <div id="masthead-user"> |
| 35 | 35 | <span id="masthead-gaia-user-expander" class="masthead-user-menu-expander masthead-expander" onclick="yt.www.masthead.toggleExpandedMasthead()"><span id="masthead-gaia-user-wrapper" class="yt-rounded" tabindex="0"><?php echo htmlspecialchars($_SESSION['siteusername']); ?></span></span> |
| 36 | - <?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
| 36 | + <?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
| 37 | 37 | <button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-on yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button> |
| 38 | 38 | <?php } else { ?> |
| 39 | 39 | <button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-off yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | </div> |
| 58 | 58 | |
| 59 | -<?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 59 | +<?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 60 | 60 | <div id="masthead-expanded" class="hid" style="display: none;"> |
| 61 | 61 | <div id="masthead-expanded-container" class="with-sandbar"> |
| 62 | 62 | <div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4" |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 78 | 78 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 79 | 79 | $stmt->execute(); |
| 80 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 80 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 81 | 81 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 82 | 82 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 83 | 83 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | </div> |
| 221 | 221 | <?php } ?> |
| 222 | 222 | <div id="alerts"> |
| 223 | - <?php if(isset($error['status'])) { ?> |
|
| 223 | + <?php if (isset($error['status'])) { ?> |
|
| 224 | 224 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error yt-alert-player"> <div class="yt-alert-icon"> |
| 225 | 225 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 226 | 226 | </div> |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | </div> |
| 231 | 231 | </div></div></div> |
| 232 | 232 | <?php } ?> |
| 233 | - <?php if(isset($_GET['error'])) { ?> |
|
| 233 | + <?php if (isset($_GET['error'])) { ?> |
|
| 234 | 234 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"> |
| 235 | 235 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 236 | 236 | </div> |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | </div> |
| 241 | 241 | </div></div></div> |
| 242 | 242 | <?php } ?> |
| 243 | - <?php if(isset($_GET['success'])) { ?> |
|
| 243 | + <?php if (isset($_GET['success'])) { ?> |
|
| 244 | 244 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-success "> <div class="yt-alert-icon"> |
| 245 | 245 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 246 | 246 | </div> |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | </div> |
| 251 | 251 | </div></div></div> |
| 252 | 252 | <?php } ?> |
| 253 | - <?php if(isset($_SESSION['error'])) { ?> |
|
| 253 | + <?php if (isset($_SESSION['error'])) { ?> |
|
| 254 | 254 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 255 | 255 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 256 | 256 | </div> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
| 39 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) { |
|
| 40 | 40 | $request = (object) [ |
| 41 | 41 | "username" => $_POST['username'], |
| 42 | 42 | "password" => $_POST['password'], |
@@ -56,30 +56,30 @@ discard block |
||
| 56 | 56 | $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
| 57 | 57 | $stmt->execute(); |
| 58 | 58 | |
| 59 | - while($ip = $stmt->fetch(PDO::FETCH_ASSOC)) { $request->error->message = "You cannot make alt accounts."; $request->error->status = ""; } |
|
| 59 | + while ($ip = $stmt->fetch(PDO::FETCH_ASSOC)) { $request->error->message = "You cannot make alt accounts."; $request->error->status = ""; } |
|
| 60 | 60 | |
| 61 | 61 | if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) |
| 62 | - { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
| 63 | - if(strlen($request->username) > 21) |
|
| 62 | + { $request->error->message = "Your email is invalid!"; $request->error->status = ""; } |
|
| 63 | + if (strlen($request->username) > 21) |
|
| 64 | 64 | { $request->error->message = "Your username must be shorter than 20 characters."; $request->error->status = ""; } |
| 65 | - if(strlen($request->password) < 8) |
|
| 65 | + if (strlen($request->password) < 8) |
|
| 66 | 66 | { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; } |
| 67 | - if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
| 67 | + if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) |
|
| 68 | 68 | { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; } |
| 69 | - if(preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username)) |
|
| 69 | + if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username)) |
|
| 70 | 70 | { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; } |
| 71 | - if(!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
| 71 | + if (!preg_match('/^\S+\w\S{1,}/', $request->username)) |
|
| 72 | 72 | { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; } |
| 73 | - if(empty(trim($request->username))) |
|
| 73 | + if (empty(trim($request->username))) |
|
| 74 | 74 | { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; } |
| 75 | 75 | |
| 76 | 76 | $stmt = $__db->prepare("SELECT username FROM users WHERE username = lower(:username)"); |
| 77 | 77 | $stmt->bindParam(":username", $request->username); |
| 78 | 78 | $stmt->execute(); |
| 79 | - if($stmt->rowCount()) |
|
| 79 | + if ($stmt->rowCount()) |
|
| 80 | 80 | { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; } |
| 81 | 81 | |
| 82 | - if($request->error->status == "OK") { |
|
| 82 | + if ($request->error->status == "OK") { |
|
| 83 | 83 | $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)"); |
| 84 | 84 | $stmt->bindParam(":username", $request->username); |
| 85 | 85 | $stmt->bindParam(":email", $request->email); |