@@ -10,19 +10,19 @@ discard block |
||
| 10 | 10 | <?php $__user_u = new user_update($__db); ?> |
| 11 | 11 | <?php $__db_h = new db_helper(); ?> |
| 12 | 12 | <?php $__time_h = new time_helper(); ?> |
| 13 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 13 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 14 | 14 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 15 | 15 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 16 | 16 | <?php |
| 17 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 17 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 18 | 18 | $error = array(); |
| 19 | 19 | |
| 20 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 20 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 24 | 24 | |
| 25 | - if(!isset($error['message'])) { |
|
| 25 | + if (!isset($error['message'])) { |
|
| 26 | 26 | $text = $_POST['comment']; |
| 27 | 27 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 28 | 28 | $stmt->bindParam(":v", $_GET['v']); |
@@ -62,20 +62,20 @@ discard block |
||
| 62 | 62 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 63 | 63 | </script> |
| 64 | 64 | <?php |
| 65 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 65 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 66 | 66 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
| 67 | 67 | |
| 68 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 69 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 68 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 69 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 70 | 70 | |
| 71 | 71 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
| 72 | 72 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
| 73 | 73 | |
| 74 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 74 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 75 | 75 | $_video['likeswidth'] = 50; |
| 76 | 76 | $_video['dislikeswidth'] = 50; |
| 77 | 77 | } else { |
| 78 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 78 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
| 79 | 79 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | </div> |
| 109 | 109 | <div id="instream_google_companion_ad_div"></div> |
| 110 | 110 | </div> |
| 111 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 111 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 112 | 112 | <div id="watch-owner-container"> |
| 113 | 113 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 114 | 114 | <ul class="yt-nav-aside"> |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | title="" |
| 144 | 144 | id="subscribe-button" |
| 145 | 145 | type="button" |
| 146 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 146 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 147 | 147 | role="button"> |
| 148 | 148 | <span class="yt-uix-button-icon-wrapper"> |
| 149 | 149 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | <button onclick=";window.location.href=this.getAttribute('href');return false;" |
| 222 | 222 | title="I like this" |
| 223 | 223 | type="button" |
| 224 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 224 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 225 | 225 | id="watch-like" |
| 226 | 226 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 227 | 227 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | type="button" |
| 236 | 236 | style="margin-left: -2px;" |
| 237 | 237 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 238 | - 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" |
|
| 238 | + 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" |
|
| 239 | 239 | id="watch-unlike" |
| 240 | 240 | role="button"> |
| 241 | 241 | <span class="yt-uix-button-icon-wrapper"> |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $stmt->execute(); |
| 361 | 361 | ?> |
| 362 | 362 | |
| 363 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 363 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 364 | 364 | <div class="comments-section"> |
| 365 | 365 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 366 | 366 | see all |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | <h4>Video Responses</h4> |
| 369 | 369 | <ul class="video-list"> |
| 370 | 370 | <?php |
| 371 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 372 | - if($__video_h->video_exists($video['video'])) { |
|
| 371 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 372 | + if ($__video_h->video_exists($video['video'])) { |
|
| 373 | 373 | $video = $__video_h->fetch_video_rid($video['video']); |
| 374 | 374 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 375 | 375 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -400,19 +400,19 @@ discard block |
||
| 400 | 400 | </h4> |
| 401 | 401 | </div> |
| 402 | 402 | </div> |
| 403 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 403 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 404 | 404 | <div class="comments-post-container clearfix"> |
| 405 | 405 | <div class="comments-post-alert"> |
| 406 | 406 | <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> |
| 407 | 407 | </div> |
| 408 | 408 | </div> |
| 409 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 409 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 410 | 410 | <div class="comments-post-container clearfix"> |
| 411 | 411 | <div class="comments-post-alert"> |
| 412 | 412 | This video has comemnting disabled! |
| 413 | 413 | </div> |
| 414 | 414 | </div> |
| 415 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 415 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 416 | 416 | <div class="comments-post-container clearfix"> |
| 417 | 417 | <div class="comments-post-alert"> |
| 418 | 418 | This user has blocked you! |
@@ -466,15 +466,15 @@ discard block |
||
| 466 | 466 | $stmt->execute(); |
| 467 | 467 | |
| 468 | 468 | $number_of_result = $stmt->rowCount(); |
| 469 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 469 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 470 | 470 | |
| 471 | - if (!isset ($_GET['page']) ) { |
|
| 471 | + if (!isset ($_GET['page'])) { |
|
| 472 | 472 | $page = 1; |
| 473 | 473 | } else { |
| 474 | - $page = (int)$_GET['page']; |
|
| 474 | + $page = (int) $_GET['page']; |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 477 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 478 | 478 | |
| 479 | 479 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 480 | 480 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $stmt->bindParam(":pper", $results_per_page); |
| 483 | 483 | $stmt->execute(); |
| 484 | 484 | |
| 485 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 485 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 486 | 486 | ?> |
| 487 | 487 | |
| 488 | 488 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | <?php |
| 565 | 565 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
| 566 | 566 | $stmt->execute(); |
| 567 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 567 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 568 | 568 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 569 | 569 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 570 | 570 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_update.php"); ?> |
| 31 | 31 | <?php $__video_h = new video_helper($__db); ?> |
| 32 | 32 | <?php $__db_h = new db_helper(); ?> |
| 33 | -<?php if(!$__video_h->video_exists($_GET['video_id'])) { header("Location: /?error=This video doesn't exist!"); } ?>
|
|
| 33 | +<?php if (!$__video_h->video_exists($_GET['video_id'])) { header("Location: /?error=This video doesn't exist!"); } ?>
|
|
| 34 | 34 | <?php $_video = $__video_h->fetch_video_rid($_GET['video_id']); ?> |
| 35 | -<?php @$_video['fmtPath'] = "/dynamic/videos/".$_video['filename']; ?> |
|
| 35 | +<?php @$_video['fmtPath'] = "/dynamic/videos/" . $_video['filename']; ?> |
|
| 36 | 36 | <?php |
| 37 | 37 | |
| 38 | 38 | // these are all the videos, with their settings, and formats |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $count = 0; |
| 51 | 51 | $url_encoded_fmt_stream_map; |
| 52 | -foreach($fmt_stream_map as $stream) {
|
|
| 53 | - if($count == 0) |
|
| 52 | +foreach ($fmt_stream_map as $stream) {
|
|
| 53 | + if ($count == 0) |
|
| 54 | 54 | $url_encoded_fmt_stream_map = http_build_query($stream); |
| 55 | 55 | else |
| 56 | 56 | $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream); |