@@ -23,14 +23,14 @@ discard block |
||
| 23 | 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 | 25 | if(!isset($error['message'])) { |
| 26 | - $text = $_POST['comment']; |
|
| 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']); |
| 29 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 30 | - $stmt->bindParam(":comment", $text); |
|
| 29 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 30 | + $stmt->bindParam(":comment", $text); |
|
| 31 | 31 | $stmt->execute(); |
| 32 | 32 | |
| 33 | - $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 33 | + $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | ?> |
@@ -62,28 +62,28 @@ 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); |
|
| 66 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 65 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 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 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 72 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 71 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 72 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 73 | 73 | |
| 74 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 75 | - $_video['likeswidth'] = 50; |
|
| 76 | - $_video['dislikeswidth'] = 50; |
|
| 77 | - } else { |
|
| 78 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 79 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 80 | - } |
|
| 74 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 75 | + $_video['likeswidth'] = 50; |
|
| 76 | + $_video['dislikeswidth'] = 50; |
|
| 77 | + } else { |
|
| 78 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 79 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 83 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 84 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 85 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 86 | - ?> |
|
| 82 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 83 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 84 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 85 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 86 | + ?> |
|
| 87 | 87 | </head> |
| 88 | 88 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 89 | 89 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -355,10 +355,10 @@ discard block |
||
| 355 | 355 | </div> |
| 356 | 356 | </div> |
| 357 | 357 | <?php |
| 358 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 359 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 360 | - $stmt->execute(); |
|
| 361 | - ?> |
|
| 358 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 359 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 360 | + $stmt->execute(); |
|
| 361 | + ?> |
|
| 362 | 362 | |
| 363 | 363 | <?php if($stmt->rowCount() != 0) { ?> |
| 364 | 364 | <div class="comments-section"> |
@@ -368,16 +368,16 @@ 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'])) { |
|
| 373 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 374 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 375 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 376 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 377 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 378 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 379 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 380 | - ?> |
|
| 371 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 372 | + if($__video_h->video_exists($video['video'])) { |
|
| 373 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 374 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 375 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 376 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 377 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 378 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 379 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 380 | + ?> |
|
| 381 | 381 | <li class="video-list-item yt-tile-default"> |
| 382 | 382 | <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> |
| 383 | 383 | <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"> |
@@ -459,31 +459,31 @@ discard block |
||
| 459 | 459 | </div> |
| 460 | 460 | <ul class="comment-list" id="live_comments"> |
| 461 | 461 | <?php |
| 462 | - $results_per_page = 20; |
|
| 462 | + $results_per_page = 20; |
|
| 463 | 463 | |
| 464 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 465 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 466 | - $stmt->execute(); |
|
| 464 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 465 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 466 | + $stmt->execute(); |
|
| 467 | 467 | |
| 468 | - $number_of_result = $stmt->rowCount(); |
|
| 469 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 468 | + $number_of_result = $stmt->rowCount(); |
|
| 469 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 470 | 470 | |
| 471 | - if (!isset ($_GET['page']) ) { |
|
| 472 | - $page = 1; |
|
| 473 | - } else { |
|
| 474 | - $page = (int)$_GET['page']; |
|
| 475 | - } |
|
| 471 | + if (!isset ($_GET['page']) ) { |
|
| 472 | + $page = 1; |
|
| 473 | + } else { |
|
| 474 | + $page = (int)$_GET['page']; |
|
| 475 | + } |
|
| 476 | 476 | |
| 477 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 477 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 478 | 478 | |
| 479 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 480 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 481 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 482 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 483 | - $stmt->execute(); |
|
| 479 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 480 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 481 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 482 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 483 | + $stmt->execute(); |
|
| 484 | 484 | |
| 485 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 486 | - ?> |
|
| 485 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 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"> |
| 489 | 489 | <div class="comment-body"> |
@@ -562,16 +562,16 @@ discard block |
||
| 562 | 562 | <ul id="watch-related" class="video-list"> |
| 563 | 563 | <div id="ppv-container" class="hid"></div> |
| 564 | 564 | <?php |
| 565 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 566 | - $stmt->execute(); |
|
| 567 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 568 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 569 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 570 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 571 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 572 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 573 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 574 | - ?> |
|
| 565 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 566 | + $stmt->execute(); |
|
| 567 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 568 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 569 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 570 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 571 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 572 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 573 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 574 | + ?> |
|
| 575 | 575 | <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> |
| 576 | 576 | <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"> |
| 577 | 577 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | // these are all the videos, with their settings, and formats |
| 39 | 39 | $fmt_stream_map = [ |
| 40 | - [ |
|
| 41 | - "itag" => "43", |
|
| 40 | + [ |
|
| 41 | + "itag" => "43", |
|
| 42 | 42 | "url" => $_video['fmtPath'], |
| 43 | 43 | "sig" => "aintnothinggonnabreakmystrideaintnothinggonnaslowmedownnooigottakeeponmovin", |
| 44 | 44 | "fallback_host" => "tc.v14.cache3.c.youtube.com", |
| 45 | 45 | "quality" => "hd720", |
| 46 | 46 | "type" => "video/webm; codecs=\"vp8.0, vorbis\"" |
| 47 | - ], |
|
| 47 | + ], |
|
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | $count = 0; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | "avg_rating" => "5.0", |
| 70 | 70 | "ttsurl" => "http://www.youtube.com/api/timedtext?signature=E949556D4478C57B95F0E4268F8D85D460D27DF6.1EC1679B0E1466625B2A029D836BE9C135A0B300&hl=en_US&caps=asr&expire=1361228889&sparams=asr_langs%2Ccaps%2Cv%2Cexpire&v=LHdA7Yc-8Rg&key=yttt1&asr_langs=ko%2Cde%2Cpt%2Cen%2Cnl%2Cja%2Cru%2Ces%2Cfr%2Cit", |
| 71 | 71 | "url_encoded_fmt_stream_map" => $url_encoded_fmt_stream_map, |
| 72 | - "plid" => "AATWAe5iQ_FjAV-I", |
|
| 72 | + "plid" => "AATWAe5iQ_FjAV-I", |
|
| 73 | 73 | "view_count" => "24465", |
| 74 | 74 | "cc_asr" => "1", |
| 75 | 75 | "token" => "vjVQa1PpcFPQw_h19VxFJZdJZbKkh5-obrhC9M93j-E=", |