@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
| 26 | 26 | |
| 27 | 27 | if(!isset($error['message'])) { |
| 28 | - $text = $_POST['comment']; |
|
| 28 | + $text = $_POST['comment']; |
|
| 29 | 29 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 30 | 30 | $stmt->bindParam(":v", $_GET['v']); |
| 31 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 32 | - $stmt->bindParam(":comment", $text); |
|
| 31 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 32 | + $stmt->bindParam(":comment", $text); |
|
| 33 | 33 | $stmt->execute(); |
| 34 | 34 | |
| 35 | - $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 36 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 35 | + $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 36 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | ?> |
@@ -65,29 +65,29 @@ 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); |
|
| 69 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 68 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 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 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 75 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 74 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 75 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 76 | 76 | |
| 77 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 78 | - $_video['likeswidth'] = 50; |
|
| 79 | - $_video['dislikeswidth'] = 50; |
|
| 80 | - } else { |
|
| 81 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 82 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 83 | - } |
|
| 77 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 78 | + $_video['likeswidth'] = 50; |
|
| 79 | + $_video['dislikeswidth'] = 50; |
|
| 80 | + } else { |
|
| 81 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 82 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 86 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 87 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 88 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 89 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 90 | - ?> |
|
| 85 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 86 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 87 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 88 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 89 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 90 | + ?> |
|
| 91 | 91 | </head> |
| 92 | 92 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 93 | 93 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -306,21 +306,21 @@ discard block |
||
| 306 | 306 | <hr><br> |
| 307 | 307 | <h3>Add to a Playlist</h3> |
| 308 | 308 | <?php |
| 309 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 310 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 311 | - $stmt->execute(); |
|
| 312 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 313 | - $buffer = json_decode($playlist['videos']); |
|
| 314 | - @$rid = $buffer[0]; |
|
| 315 | - if(!empty($rid)) { |
|
| 316 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 317 | - } else { |
|
| 318 | - $video['thumbnail'] = ""; |
|
| 319 | - $video['duration'] = 0; |
|
| 320 | - } |
|
| 309 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 310 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 311 | + $stmt->execute(); |
|
| 312 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 313 | + $buffer = json_decode($playlist['videos']); |
|
| 314 | + @$rid = $buffer[0]; |
|
| 315 | + if(!empty($rid)) { |
|
| 316 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 317 | + } else { |
|
| 318 | + $video['thumbnail'] = ""; |
|
| 319 | + $video['duration'] = 0; |
|
| 320 | + } |
|
| 321 | 321 | |
| 322 | - $videos = count($buffer); |
|
| 323 | - ?> |
|
| 322 | + $videos = count($buffer); |
|
| 323 | + ?> |
|
| 324 | 324 | <a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a> |
| 325 | 325 | <?php } ?> |
| 326 | 326 | <?php } ?> |
@@ -585,10 +585,10 @@ discard block |
||
| 585 | 585 | </div> |
| 586 | 586 | </div> |
| 587 | 587 | <?php |
| 588 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 589 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 590 | - $stmt->execute(); |
|
| 591 | - ?> |
|
| 588 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 589 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 590 | + $stmt->execute(); |
|
| 591 | + ?> |
|
| 592 | 592 | |
| 593 | 593 | <?php if($stmt->rowCount() != 0) { ?> |
| 594 | 594 | <div class="comments-section"> |
@@ -598,16 +598,16 @@ 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'])) { |
|
| 603 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 604 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 605 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 606 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 607 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 608 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 609 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 610 | - ?> |
|
| 601 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 602 | + if($__video_h->video_exists($video['video'])) { |
|
| 603 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 604 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 605 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 606 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 607 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 608 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 609 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 610 | + ?> |
|
| 611 | 611 | <li class="video-list-item yt-tile-default"> |
| 612 | 612 | <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> |
| 613 | 613 | <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"> |
@@ -689,31 +689,31 @@ discard block |
||
| 689 | 689 | </div> |
| 690 | 690 | <ul class="comment-list" id="live_comments"> |
| 691 | 691 | <?php |
| 692 | - $results_per_page = 20; |
|
| 692 | + $results_per_page = 20; |
|
| 693 | 693 | |
| 694 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 695 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 696 | - $stmt->execute(); |
|
| 694 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 695 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 696 | + $stmt->execute(); |
|
| 697 | 697 | |
| 698 | - $number_of_result = $stmt->rowCount(); |
|
| 699 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 698 | + $number_of_result = $stmt->rowCount(); |
|
| 699 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 700 | 700 | |
| 701 | - if (!isset ($_GET['page']) ) { |
|
| 702 | - $page = 1; |
|
| 703 | - } else { |
|
| 704 | - $page = (int)$_GET['page']; |
|
| 705 | - } |
|
| 701 | + if (!isset ($_GET['page']) ) { |
|
| 702 | + $page = 1; |
|
| 703 | + } else { |
|
| 704 | + $page = (int)$_GET['page']; |
|
| 705 | + } |
|
| 706 | 706 | |
| 707 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 707 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 708 | 708 | |
| 709 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 710 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 711 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 712 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 713 | - $stmt->execute(); |
|
| 709 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 710 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 711 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 712 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 713 | + $stmt->execute(); |
|
| 714 | 714 | |
| 715 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 716 | - ?> |
|
| 715 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 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"> |
| 719 | 719 | <div class="comment-body"> |
@@ -792,16 +792,16 @@ discard block |
||
| 792 | 792 | <ul id="watch-related" class="video-list"> |
| 793 | 793 | <div id="ppv-container" class="hid"></div> |
| 794 | 794 | <?php |
| 795 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 796 | - $stmt->execute(); |
|
| 797 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 798 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 799 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 800 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 801 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 802 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 803 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 804 | - ?> |
|
| 795 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 796 | + $stmt->execute(); |
|
| 797 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 798 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 799 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 800 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 801 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 802 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 803 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 804 | + ?> |
|
| 805 | 805 | <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> |
| 806 | 806 | <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"> |
| 807 | 807 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | |
| 27 | 27 | $stmt = $__db->prepare("DELETE FROM favorite_video WHERE sender = :sender AND reciever = :reciever"); |
| 28 | 28 | $stmt->execute(array( |
| 29 | - ':sender' => $_SESSION['siteusername'], |
|
| 30 | - ':reciever' => $name, |
|
| 29 | + ':sender' => $_SESSION['siteusername'], |
|
| 30 | + ':reciever' => $name, |
|
| 31 | 31 | )); |
| 32 | 32 | |
| 33 | 33 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | if($request->error->status == "OK") { |
| 28 | 28 | $stmt = $__db->prepare("DELETE FROM subscribers WHERE sender=:sender AND reciever=:reciever"); |
| 29 | 29 | $stmt->execute(array( |
| 30 | - ':sender' => $request->sender, |
|
| 31 | - ':reciever' => $request->name, |
|
| 30 | + ':sender' => $request->sender, |
|
| 31 | + ':reciever' => $request->name, |
|
| 32 | 32 | )); |
| 33 | 33 | |
| 34 | 34 | header('Location: ' . $_SERVER['HTTP_REFERER']); |