@@ -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']); |
@@ -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> |
| 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;"> |
@@ -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(); |