@@ -18,8 +18,8 @@ |
||
18 | 18 | $video['title'] = htmlspecialchars($video['title']); |
19 | 19 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
20 | 20 | |
21 | - if(!$__video_h->video_exists($_GET['v'])) |
|
22 | - header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
21 | + if(!$__video_h->video_exists($_GET['v'])) |
|
22 | + header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
23 | 23 | |
24 | 24 | if($_SESSION['siteusername'] != $video['author']) |
25 | 25 | header("Location: /"); |
@@ -18,10 +18,10 @@ |
||
18 | 18 | $video['title'] = htmlspecialchars($video['title']); |
19 | 19 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
20 | 20 | |
21 | - if(!$__video_h->video_exists($_GET['v'])) |
|
21 | + if (!$__video_h->video_exists($_GET['v'])) |
|
22 | 22 | header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
23 | 23 | |
24 | - if($_SESSION['siteusername'] != $video['author']) |
|
24 | + if ($_SESSION['siteusername'] != $video['author']) |
|
25 | 25 | header("Location: /"); |
26 | 26 | ?> |
27 | 27 | <!DOCTYPE html> |
@@ -18,12 +18,14 @@ |
||
18 | 18 | $video['title'] = htmlspecialchars($video['title']); |
19 | 19 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
20 | 20 | |
21 | - if(!$__video_h->video_exists($_GET['v'])) |
|
22 | - header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
21 | + if(!$__video_h->video_exists($_GET['v'])) { |
|
22 | + header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
23 | + } |
|
23 | 24 | |
24 | - if($_SESSION['siteusername'] != $video['author']) |
|
25 | - header("Location: /"); |
|
26 | -?> |
|
25 | + if($_SESSION['siteusername'] != $video['author']) { |
|
26 | + header("Location: /"); |
|
27 | + } |
|
28 | + ?> |
|
27 | 29 | <!DOCTYPE html> |
28 | 30 | <html> |
29 | 31 | <head> |
@@ -12,18 +12,18 @@ 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(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
15 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
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 description cannot be blank"; $error['status'] = true; } |
|
22 | - if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
23 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $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 description cannot be blank"; $error['status'] = true; } |
|
22 | + if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
23 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; } |
|
25 | 25 | |
26 | - if(!isset($error['message'])) { |
|
26 | + if (!isset($error['message'])) { |
|
27 | 27 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
28 | 28 | $result = ''; |
29 | 29 | for ($i = 0; $i < 11; $i++) |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | $stmt->execute(); |
193 | 193 | |
194 | 194 | $number_of_result = $stmt->rowCount(); |
195 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
195 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
196 | 196 | |
197 | - if (!isset ($_GET['page']) ) { |
|
197 | + if (!isset ($_GET['page'])) { |
|
198 | 198 | $page = 1; |
199 | 199 | } else { |
200 | - $page = (int)$_GET['page']; |
|
200 | + $page = (int) $_GET['page']; |
|
201 | 201 | } |
202 | 202 | |
203 | - $page_first_result = ($page - 1) * $results_per_page; |
|
203 | + $page_first_result = ($page - 1)*$results_per_page; |
|
204 | 204 | ?> |
205 | 205 | <?php |
206 | 206 | $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | </tr> |
246 | 246 | |
247 | 247 | <?php |
248 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
248 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
249 | 249 | $playlist['videos'] = json_decode($playlist['videos']); |
250 | - if($__video_h->video_exists(@$playlist['videos'][0])) { |
|
251 | - if(count($playlist['videos']) != 0) { |
|
250 | + if ($__video_h->video_exists(@$playlist['videos'][0])) { |
|
251 | + if (count($playlist['videos']) != 0) { |
|
252 | 252 | $video = $__video_h->fetch_video_rid($playlist['videos'][0]); |
253 | 253 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
254 | 254 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | </div> |
331 | 331 | </center> |
332 | 332 | |
333 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
333 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
334 | 334 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
335 | 335 | <?php } ?> |
336 | 336 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | </script> |
377 | 377 | |
378 | 378 | <?php |
379 | - if($stmt6->rowCount() == 0) { echo " |
|
379 | + if ($stmt6->rowCount() == 0) { echo " |
|
380 | 380 | <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br> |
381 | 381 | "; |
382 | 382 | } ?> |
@@ -26,8 +26,9 @@ |
||
26 | 26 | if(!isset($error['message'])) { |
27 | 27 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
28 | 28 | $result = ''; |
29 | - for ($i = 0; $i < 11; $i++) |
|
30 | - $rid .= $characters[mt_rand(0, 63)]; |
|
29 | + for ($i = 0; $i < 11; $i++) { |
|
30 | + $rid .= $characters[mt_rand(0, 63)]; |
|
31 | + } |
|
31 | 32 | $stmt = $__db->prepare("INSERT INTO playlists (title, description, rid, author) VALUES (:title, :desc, :rid, :username)"); |
32 | 33 | $stmt->bindParam(":title", $_POST['title']); |
33 | 34 | $stmt->bindParam(":desc", $_POST['comment']); |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | <?php $__db_h = new db_helper(); ?> |
14 | 14 | <?php $__time_h = new time_helper(); ?> |
15 | 15 | <?php |
16 | - if(isset($_SESSION['siteusername'])) |
|
17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
16 | + if(isset($_SESSION['siteusername'])) |
|
17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
18 | 18 | |
19 | 19 | if(!$__user_h->user_exists($_GET['n'])) |
20 | 20 | header("Location: /?userdoesntexist"); |
@@ -27,21 +27,21 @@ discard block |
||
27 | 27 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
28 | 28 | } |
29 | 29 | |
30 | - function addhttp($url) { |
|
31 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
32 | - $url = "http://" . $url; |
|
33 | - } |
|
34 | - return $url; |
|
35 | - } |
|
30 | + function addhttp($url) { |
|
31 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
32 | + $url = "http://" . $url; |
|
33 | + } |
|
34 | + return $url; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | function check_valid_colorhex($colorCode) { |
38 | 38 | // If user accidentally passed along the # sign, strip it off |
39 | 39 | $colorCode = ltrim($colorCode, '#'); |
40 | 40 | |
41 | 41 | if ( |
42 | - ctype_xdigit($colorCode) && |
|
42 | + ctype_xdigit($colorCode) && |
|
43 | 43 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
44 | - return true; |
|
44 | + return true; |
|
45 | 45 | |
46 | 46 | else return false; |
47 | 47 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
67 | 67 | |
68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
69 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
69 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
70 | 70 | |
71 | 71 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
72 | 72 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
76 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
77 | 77 | |
78 | - if(isset($_SESSION['siteusername'])) |
|
79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
78 | + if(isset($_SESSION['siteusername'])) |
|
79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
80 | 80 | |
81 | 81 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
82 | 82 | $error = array(); |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
91 | 91 | |
92 | 92 | if(!isset($error['message'])) { |
93 | - $text = $_POST['comment']; |
|
93 | + $text = $_POST['comment']; |
|
94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
95 | - $stmt->bindParam(":id", $_user['username']); |
|
96 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
97 | - $stmt->bindParam(":comment", $text); |
|
95 | + $stmt->bindParam(":id", $_user['username']); |
|
96 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
97 | + $stmt->bindParam(":comment", $text); |
|
98 | 98 | $stmt->execute(); |
99 | 99 | |
100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
107 | - ?> |
|
107 | + ?> |
|
108 | 108 | <!DOCTYPE html> |
109 | 109 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
110 | 110 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
147 | 147 | <?php } ?> |
148 | 148 | <?php |
149 | - if(empty(trim($_user['bio']))) |
|
150 | - $_user['bio'] = "This user has no description."; |
|
151 | - ?> |
|
149 | + if(empty(trim($_user['bio']))) |
|
150 | + $_user['bio'] = "This user has no description."; |
|
151 | + ?> |
|
152 | 152 | <div id="content"> |
153 | 153 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
154 | 154 | <div class="content" id="recommended-channels-list"></div> |
@@ -477,9 +477,9 @@ discard block |
||
477 | 477 | <h2>Featured Channels</h2> |
478 | 478 | <ul class="channel-summary-list "> |
479 | 479 | <?php |
480 | - foreach($_user['featured_channels'] as $user) { |
|
481 | - if($__user_h->user_exists($user)) { |
|
482 | - ?> |
|
480 | + foreach($_user['featured_channels'] as $user) { |
|
481 | + if($__user_h->user_exists($user)) { |
|
482 | + ?> |
|
483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
485 | 485 | <div class="channel-summary-thumb"> |
@@ -503,19 +503,19 @@ discard block |
||
503 | 503 | </div> |
504 | 504 | |
505 | 505 | <?php |
506 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
507 | - $stmt->bindParam(":search", $_user['username']); |
|
508 | - $stmt->execute(); |
|
506 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
507 | + $stmt->bindParam(":search", $_user['username']); |
|
508 | + $stmt->execute(); |
|
509 | 509 | |
510 | - if($stmt->rowCount() != 0) { |
|
511 | - ?> |
|
510 | + if($stmt->rowCount() != 0) { |
|
511 | + ?> |
|
512 | 512 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
513 | 513 | <div class="module-view gh-featured"> |
514 | 514 | <h2>Featured Playlists</h2> |
515 | 515 | <?php |
516 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
517 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
518 | - ?> |
|
516 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
517 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
518 | + ?> |
|
519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
520 | 520 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
521 | 521 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | <?php $__db_h = new db_helper(); ?> |
14 | 14 | <?php $__time_h = new time_helper(); ?> |
15 | 15 | <?php |
16 | - if(isset($_SESSION['siteusername'])) |
|
16 | + if (isset($_SESSION['siteusername'])) |
|
17 | 17 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
18 | 18 | |
19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
19 | + if (!$__user_h->user_exists($_GET['n'])) |
|
20 | 20 | header("Location: /?userdoesntexist"); |
21 | 21 | |
22 | 22 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -68,28 +68,28 @@ discard block |
||
68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
69 | 69 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
70 | 70 | |
71 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
72 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
73 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
74 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
75 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
76 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
71 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
72 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
73 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
74 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
75 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
76 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
77 | 77 | |
78 | - if(isset($_SESSION['siteusername'])) |
|
78 | + if (isset($_SESSION['siteusername'])) |
|
79 | 79 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
80 | 80 | |
81 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
81 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
82 | 82 | $error = array(); |
83 | 83 | |
84 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
85 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
86 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
84 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
85 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
86 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
87 | 87 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
88 | 88 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
89 | - 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; } |
|
89 | + 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; } |
|
90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
91 | 91 | |
92 | - if(!isset($error['message'])) { |
|
92 | + if (!isset($error['message'])) { |
|
93 | 93 | $text = $_POST['comment']; |
94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
95 | 95 | $stmt->bindParam(":id", $_user['username']); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
101 | 101 | |
102 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
102 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
103 | 103 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
104 | 104 | } |
105 | 105 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
127 | 127 | <style> |
128 | 128 | #content-container { |
129 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
129 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
130 | 130 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
131 | 131 | background-repeat: repeat; |
132 | 132 | background-position: center top; |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | <div id="masthead-container"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
143 | 143 | <div id="content-container"> |
144 | 144 | <!-- begin content --> |
145 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
145 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
146 | 146 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
147 | 147 | <?php } ?> |
148 | 148 | <?php |
149 | - if(empty(trim($_user['bio']))) |
|
149 | + if (empty(trim($_user['bio']))) |
|
150 | 150 | $_user['bio'] = "This user has no description."; |
151 | 151 | ?> |
152 | 152 | <div id="content"> |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
202 | 202 | </div> |
203 | 203 | <div class="upper-left-section enable-fancy-subscribe-button"> |
204 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
204 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
205 | 205 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
206 | 206 | <button |
207 | 207 | href="#" |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | title="" |
210 | 210 | id="subscribe-button" |
211 | 211 | type="button" |
212 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
212 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
213 | 213 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
214 | 214 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
215 | 215 | <span class="subscribed-label">Subscribed</span> |
@@ -275,12 +275,12 @@ discard block |
||
275 | 275 | </div> |
276 | 276 | </div> |
277 | 277 | </div> |
278 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
278 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
279 | 279 | <div id="branded-page-body"> |
280 | 280 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
281 | 281 | <div class="tab-content-body"> |
282 | 282 | <div class="primary-pane"> |
283 | - <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
283 | + <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
284 | 284 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> |
285 | 285 | <div class="module-view featured-video-view-module"> |
286 | 286 | <div class="channels-video-player " data-swf-config="{"assets": {"html": "\/html5_player_template", "css": "http:\/\/s.ytimg.com\/yt\/cssbin\/www-player-vfllhw7HB.css", "js": "http:\/\/s.ytimg.com\/yt\/jsbin\/html5player-vflzTrRqK.js"}, "url": "http:\/\/s.ytimg.com\/yt\/swfbin\/watch_as3-vflbPspVE.swf", "min_version": "8.0.0", "args": {"ttsurl": "http:\/\/www.youtube.com\/api\/timedtext?sparams=asr_langs%2Ccaps%2Cv%2Cexpire\u0026asr_langs=en%2Cko%2Cja%2Ces\u0026v=/watch?v=<?php echo $video['rid']; ?>\u0026caps=asr\u0026expire=1339746882\u0026key=yttt1\u0026signature=A1B858FF427B45672676C7403417ED1F4091A806.C347A6021C0F843E46F2056AEBA38FC93A0A47B8\u0026hl=en_US", "el": "profilepage", "fexp": "904001,907342,904824,910206,908620,907217,907335,921602,919306,922600,919316,920704,912804,913542,919324,912706", "url_encoded_fmt_stream_map": "url=http%3A%2F%2Fo-o.preferred.nuq04s10.v1.lscache4.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D44%26ip%3D207.0.0.0%26signature%3D9B9B5ECF02F2F66BDCCB0ACED26D3406F9F83241.1B2CC833461E3D2C4D081B7DFBC65B0948C61FB9%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v1.cache4.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=44,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D35%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3DB702D7CA72653169BDC2C945B5A35F4A23A3FEBF.ACC660CDAB11901FF8D3DA8D384D61F0AB0F0125%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=35,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v24.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D43%26ip%3D207.0.0.0%26signature%3D9FABDD8C013AA137B87DF2D154D1B90E6827A2A3.880FECDEC066236D85FCF223CF472B62B8F9B3A4%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v24.cache3.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=43,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v3.lscache7.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D34%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D1BA326B784DAA9F62FD789CBB5C2FABFCD5D351C.C4618E3AB2AB08C61C6A982A36F405DA886B5D5A%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v3.cache7.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=34,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D18%26ip%3D207.0.0.0%26signature%3D8806EA8FAE16557A2F9732068442133EA0A0760F.D91694A47E6B0BF627965CDA46010F36105A28FE%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026itag=18,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v4.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D5%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D011CB6739AB60ED79D032DE2F62EB016D8A8E462.C2C0ABE42F26DBA18F2BC6E0D074EB99A95C0DF0%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v4.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=5,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v12.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D36%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D988FDD37CBA8DB74C1148EE17921D8549434297C.A2C1796F2BA0427C9FE370BFB6B3B09BA1D81B07%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v12.cache3.c.youtube.com\u0026type=video%2F3gpp\u0026itag=36", "allow_embed": 1, "vq": "auto", "account_playback_token": "", "allow_ratings": 1, "keywords": "Rehearsal,Dance,justin,bieber,believe,as,long,you,love,me,rodney,jerkins,pattie,mallette,jeremy,dad,mom,scooter,braun,island,def,jam,usher,rbmg,making,of,the,album,webisode,june,19th,19,new,amazing,song,big,sean,hit,record,<?php echo htmlspecialchars($_user['username']); ?>,always,still,studio,singing,kuk,harrell,producer,sing,boy,guy,man,smash,single,nick,demoura,dancers,sweat,beliebers,hard,work,tour,band", "cc3_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitles3_module-vflu_Qeod.swf", "track_embed": 0, "is_purchased": false, "ps": "default", "fmt_list": "44\/854x480\/99\/0\/0,35\/854x480\/9\/0\/115,43\/640x360\/99\/0\/0,34\/640x360\/9\/0\/115,18\/640x360\/9\/0\/115,5\/320x240\/7\/0\/0,36\/320x240\/99\/0\/0", "author": "<?php echo htmlspecialchars($_user['username']); ?>", "muted": "0", "cc_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitle_module-vflq8KnSi.swf", "length_seconds": 82, "feature": "g-logo-xit", "enablejsapi": 1, "rel": 0, "plid": "AATCeEL9eg3Ls9t-", "cc_font": "Arial Unicode MS, arial, verdana, _sans", "ftoken": "", "sdetail": "f:g-logo-xit,p:\/", "status": "ok", "cc_asr": 1, "watermark": ",http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_watermark-vflHX6b6E.png,http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_hd_watermark-vflAzLcD6.png", "sourceid": "y", "timestamp": 1339721682, "has_cc": true, "view_count": 2600, "quality_cap": "highres", "hl": "en_US", "tmi": "1", "no_get_video_log": "1", "eurl": "http:\/\/www.youtube.com\/user\/<?php echo htmlspecialchars($_user['username']); ?>", "iurl": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/hqdefault.jpg", "endscreen_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/endscreen-vflJBKwqC.swf", "referrer": "http:\/\/www.youtube.com\/", "avg_rating": 4.97805486284, "video_id": "/watch?v=<?php echo $video['rid']; ?>", "sendtmp": "1", "sk": "bwv_lGOGF4u1g0p7puy7ERICN8NZ5cVFC", "is_video_preview": false, "token": "vjVQa1PpcFMSYb-unvOiIgSL8pW9tObJUMfrEc1mxfE=", "thumbnail_url": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/default.jpg", "iurlsd": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/sddefault.jpg", "autoplay": "1"}, "url_v9as2": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "params": {"allowscriptaccess": "always", "allowfullscreen": "true", "bgcolor": "#000000"}, "attrs": {"width": "640", "id": "movie_player", "height": "390"}, "url_v8": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "html5": false}" data-video-id="/watch?v=<?php echo $video['rid']; ?>"> |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | <div class="playlist-info"> |
321 | 321 | <h2>Uploaded videos</h2> |
322 | 322 | <div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div> |
323 | - <?php if($_user['videos'] == 0) { ?> |
|
323 | + <?php if ($_user['videos'] == 0) { ?> |
|
324 | 324 | <h4>This user has not uploaded a video yet.</h4> |
325 | 325 | <?php } ?> |
326 | 326 | </div> |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
330 | 330 | $stmt->bindParam(":username", $_user['username']); |
331 | 331 | $stmt->execute(); |
332 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
332 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
333 | 333 | ?> |
334 | 334 | <li class="blogger-video"> |
335 | 335 | <div class="video yt-tile-visible"> |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | </div> |
412 | 412 | <hr class="yt-horizontal-rule "> |
413 | 413 | </div> |
414 | - <?php if(!empty($_user['website'])) { ?> |
|
414 | + <?php if (!empty($_user['website'])) { ?> |
|
415 | 415 | <div class="user-profile-item"> |
416 | 416 | <div class="yt-c3-profile-custom-url field-container "> |
417 | 417 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | <h5>Country</h5> |
461 | 461 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
462 | 462 | </div> |
463 | - <?php if($_user['genre'] != "none") { ?> |
|
463 | + <?php if ($_user['genre'] != "none") { ?> |
|
464 | 464 | <div class="user-profile-item "> |
465 | 465 | <h5>Channel Genre</h5> |
466 | 466 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | </div> |
473 | 473 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
474 | 474 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
475 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
475 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
476 | 476 | <div class="module-view other-channels-view"> |
477 | 477 | <h2>Featured Channels</h2> |
478 | 478 | <ul class="channel-summary-list "> |
479 | 479 | <?php |
480 | - foreach($_user['featured_channels'] as $user) { |
|
481 | - if($__user_h->user_exists($user)) { |
|
480 | + foreach ($_user['featured_channels'] as $user) { |
|
481 | + if ($__user_h->user_exists($user)) { |
|
482 | 482 | ?> |
483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -507,13 +507,13 @@ discard block |
||
507 | 507 | $stmt->bindParam(":search", $_user['username']); |
508 | 508 | $stmt->execute(); |
509 | 509 | |
510 | - if($stmt->rowCount() != 0) { |
|
510 | + if ($stmt->rowCount() != 0) { |
|
511 | 511 | ?> |
512 | 512 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
513 | 513 | <div class="module-view gh-featured"> |
514 | 514 | <h2>Featured Playlists</h2> |
515 | 515 | <?php |
516 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
516 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
517 | 517 | $playlist['videos'] = json_decode($playlist['videos']); |
518 | 518 | ?> |
519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -13,11 +13,13 @@ discard block |
||
13 | 13 | <?php $__db_h = new db_helper(); ?> |
14 | 14 | <?php $__time_h = new time_helper(); ?> |
15 | 15 | <?php |
16 | - if(isset($_SESSION['siteusername'])) |
|
17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
16 | + if(isset($_SESSION['siteusername'])) { |
|
17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
18 | + } |
|
18 | 19 | |
19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
20 | - header("Location: /?userdoesntexist"); |
|
20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
21 | + header("Location: /?userdoesntexist"); |
|
22 | + } |
|
21 | 23 | |
22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
40 | 42 | |
41 | 43 | if ( |
42 | 44 | ctype_xdigit($colorCode) && |
43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
44 | - return true; |
|
45 | - |
|
46 | - else return false; |
|
45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
46 | + return true; |
|
47 | + } else { |
|
48 | + return false; |
|
49 | + } |
|
47 | 50 | } |
48 | 51 | |
49 | 52 | $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']); |
@@ -75,8 +78,9 @@ discard block |
||
75 | 78 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
76 | 79 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
77 | 80 | |
78 | - if(isset($_SESSION['siteusername'])) |
|
79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
81 | + if(isset($_SESSION['siteusername'])) { |
|
82 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
83 | + } |
|
80 | 84 | |
81 | 85 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
82 | 86 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
146 | 150 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
147 | 151 | <?php } ?> |
148 | 152 | <?php |
149 | - if(empty(trim($_user['bio']))) |
|
150 | - $_user['bio'] = "This user has no description."; |
|
153 | + if(empty(trim($_user['bio']))) { |
|
154 | + $_user['bio'] = "This user has no description."; |
|
155 | + } |
|
151 | 156 | ?> |
152 | 157 | <div id="content"> |
153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -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> |
@@ -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']); |
@@ -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=", |
@@ -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); |
@@ -50,10 +50,11 @@ |
||
50 | 50 | $count = 0; |
51 | 51 | $url_encoded_fmt_stream_map; |
52 | 52 | foreach($fmt_stream_map as $stream) { |
53 | - if($count == 0) |
|
54 | - $url_encoded_fmt_stream_map = http_build_query($stream); |
|
55 | - else |
|
56 | - $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream); |
|
53 | + if($count == 0) { |
|
54 | + $url_encoded_fmt_stream_map = http_build_query($stream); |
|
55 | + } else { |
|
56 | + $url_encoded_fmt_stream_map = $url_encoded_fmt_stream_map . "," . http_build_query($stream); |
|
57 | + } |
|
57 | 58 | $count++; |
58 | 59 | } |
59 | 60 |
@@ -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 | ?> |
@@ -53,28 +53,28 @@ discard block |
||
53 | 53 | if (window.yt.timing) {yt.timing.tick("ct");} |
54 | 54 | </script> |
55 | 55 | <?php |
56 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
57 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
56 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
57 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
58 | 58 | |
59 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
60 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
59 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
60 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
61 | 61 | |
62 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
63 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
62 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
63 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
64 | 64 | |
65 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
66 | - $_video['likeswidth'] = 50; |
|
67 | - $_video['dislikeswidth'] = 50; |
|
68 | - } else { |
|
69 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
70 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
71 | - } |
|
65 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
66 | + $_video['likeswidth'] = 50; |
|
67 | + $_video['dislikeswidth'] = 50; |
|
68 | + } else { |
|
69 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
70 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
71 | + } |
|
72 | 72 | |
73 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
74 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
75 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
76 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
77 | - ?> |
|
73 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
74 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
75 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
76 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
77 | + ?> |
|
78 | 78 | </head> |
79 | 79 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
80 | 80 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -360,10 +360,10 @@ discard block |
||
360 | 360 | </div> |
361 | 361 | </div> |
362 | 362 | <?php |
363 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
364 | - $stmt->bindParam(":v", $_GET['v']); |
|
365 | - $stmt->execute(); |
|
366 | - ?> |
|
363 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
364 | + $stmt->bindParam(":v", $_GET['v']); |
|
365 | + $stmt->execute(); |
|
366 | + ?> |
|
367 | 367 | |
368 | 368 | <?php if($stmt->rowCount() != 0) { ?> |
369 | 369 | <div class="comments-section"> |
@@ -373,16 +373,16 @@ discard block |
||
373 | 373 | <h4>Video Responses</h4> |
374 | 374 | <ul class="video-list"> |
375 | 375 | <?php |
376 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
377 | - if($__video_h->video_exists($video['video'])) { |
|
378 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
379 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
380 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
381 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
382 | - $video['author'] = htmlspecialchars($video['author']); |
|
383 | - $video['title'] = htmlspecialchars($video['title']); |
|
384 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
385 | - ?> |
|
376 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
377 | + if($__video_h->video_exists($video['video'])) { |
|
378 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
379 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
380 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
381 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
382 | + $video['author'] = htmlspecialchars($video['author']); |
|
383 | + $video['title'] = htmlspecialchars($video['title']); |
|
384 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
385 | + ?> |
|
386 | 386 | <li class="video-list-item yt-tile-default"> |
387 | 387 | <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="http://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> |
388 | 388 | <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"> |
@@ -464,31 +464,31 @@ discard block |
||
464 | 464 | </div> |
465 | 465 | <ul class="comment-list" id="live_comments"> |
466 | 466 | <?php |
467 | - $results_per_page = 20; |
|
467 | + $results_per_page = 20; |
|
468 | 468 | |
469 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
470 | - $stmt->bindParam(":rid", $_video['rid']); |
|
471 | - $stmt->execute(); |
|
469 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
470 | + $stmt->bindParam(":rid", $_video['rid']); |
|
471 | + $stmt->execute(); |
|
472 | 472 | |
473 | - $number_of_result = $stmt->rowCount(); |
|
474 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
473 | + $number_of_result = $stmt->rowCount(); |
|
474 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
475 | 475 | |
476 | - if (!isset ($_GET['page']) ) { |
|
477 | - $page = 1; |
|
478 | - } else { |
|
479 | - $page = (int)$_GET['page']; |
|
480 | - } |
|
476 | + if (!isset ($_GET['page']) ) { |
|
477 | + $page = 1; |
|
478 | + } else { |
|
479 | + $page = (int)$_GET['page']; |
|
480 | + } |
|
481 | 481 | |
482 | - $page_first_result = ($page - 1) * $results_per_page; |
|
482 | + $page_first_result = ($page - 1) * $results_per_page; |
|
483 | 483 | |
484 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
485 | - $stmt->bindParam(":rid", $_video['rid']); |
|
486 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
487 | - $stmt->bindParam(":pper", $results_per_page); |
|
488 | - $stmt->execute(); |
|
484 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
485 | + $stmt->bindParam(":rid", $_video['rid']); |
|
486 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
487 | + $stmt->bindParam(":pper", $results_per_page); |
|
488 | + $stmt->execute(); |
|
489 | 489 | |
490 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
491 | - ?> |
|
490 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
491 | + ?> |
|
492 | 492 | |
493 | 493 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
494 | 494 | <div class="comment-body"> |
@@ -567,16 +567,16 @@ discard block |
||
567 | 567 | <ul id="watch-related" class="video-list"> |
568 | 568 | <div id="ppv-container" class="hid"></div> |
569 | 569 | <?php |
570 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
571 | - $stmt->execute(); |
|
572 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
573 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
574 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
575 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
576 | - $video['author'] = htmlspecialchars($video['author']); |
|
577 | - $video['title'] = htmlspecialchars($video['title']); |
|
578 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
579 | - ?> |
|
570 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
571 | + $stmt->execute(); |
|
572 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
573 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
574 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
575 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
576 | + $video['author'] = htmlspecialchars($video['author']); |
|
577 | + $video['title'] = htmlspecialchars($video['title']); |
|
578 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
579 | + ?> |
|
580 | 580 | <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="http://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> |
581 | 581 | <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"> |
582 | 582 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -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']); |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | if (window.yt.timing) {yt.timing.tick("ct");} |
54 | 54 | </script> |
55 | 55 | <?php |
56 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
56 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
57 | 57 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
58 | 58 | |
59 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
60 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
59 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
60 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
61 | 61 | |
62 | 62 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
63 | 63 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
64 | 64 | |
65 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
65 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
66 | 66 | $_video['likeswidth'] = 50; |
67 | 67 | $_video['dislikeswidth'] = 50; |
68 | 68 | } else { |
69 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
69 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
70 | 70 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
71 | 71 | } |
72 | 72 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | </div> |
100 | 100 | <div id="instream_google_companion_ad_div"></div> |
101 | 101 | </div> |
102 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
102 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
103 | 103 | <div id="watch-owner-container"> |
104 | 104 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
105 | 105 | <ul class="yt-nav-aside"> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | title="" |
135 | 135 | id="subscribe-button" |
136 | 136 | type="button" |
137 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
137 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
138 | 138 | role="button"> |
139 | 139 | <span class="yt-uix-button-icon-wrapper"> |
140 | 140 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | <button onclick=";window.location.href=this.getAttribute('href');return false;" |
227 | 227 | title="I like this" |
228 | 228 | type="button" |
229 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
229 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
230 | 230 | id="watch-like" |
231 | 231 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
232 | 232 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | type="button" |
241 | 241 | style="margin-left: -2px;" |
242 | 242 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
243 | - 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 | + 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" |
|
244 | 244 | id="watch-unlike" |
245 | 245 | role="button"> |
246 | 246 | <span class="yt-uix-button-icon-wrapper"> |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $stmt->execute(); |
366 | 366 | ?> |
367 | 367 | |
368 | - <?php if($stmt->rowCount() != 0) { ?> |
|
368 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
369 | 369 | <div class="comments-section"> |
370 | 370 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
371 | 371 | see all |
@@ -373,8 +373,8 @@ discard block |
||
373 | 373 | <h4>Video Responses</h4> |
374 | 374 | <ul class="video-list"> |
375 | 375 | <?php |
376 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
377 | - if($__video_h->video_exists($video['video'])) { |
|
376 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
377 | + if ($__video_h->video_exists($video['video'])) { |
|
378 | 378 | $video = $__video_h->fetch_video_rid($video['video']); |
379 | 379 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
380 | 380 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -405,19 +405,19 @@ discard block |
||
405 | 405 | </h4> |
406 | 406 | </div> |
407 | 407 | </div> |
408 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
408 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
409 | 409 | <div class="comments-post-container clearfix"> |
410 | 410 | <div class="comments-post-alert"> |
411 | 411 | <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> |
412 | 412 | </div> |
413 | 413 | </div> |
414 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
414 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
415 | 415 | <div class="comments-post-container clearfix"> |
416 | 416 | <div class="comments-post-alert"> |
417 | 417 | This video has comemnting disabled! |
418 | 418 | </div> |
419 | 419 | </div> |
420 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
420 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
421 | 421 | <div class="comments-post-container clearfix"> |
422 | 422 | <div class="comments-post-alert"> |
423 | 423 | This user has blocked you! |
@@ -471,15 +471,15 @@ discard block |
||
471 | 471 | $stmt->execute(); |
472 | 472 | |
473 | 473 | $number_of_result = $stmt->rowCount(); |
474 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
474 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
475 | 475 | |
476 | - if (!isset ($_GET['page']) ) { |
|
476 | + if (!isset ($_GET['page'])) { |
|
477 | 477 | $page = 1; |
478 | 478 | } else { |
479 | - $page = (int)$_GET['page']; |
|
479 | + $page = (int) $_GET['page']; |
|
480 | 480 | } |
481 | 481 | |
482 | - $page_first_result = ($page - 1) * $results_per_page; |
|
482 | + $page_first_result = ($page - 1)*$results_per_page; |
|
483 | 483 | |
484 | 484 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
485 | 485 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $stmt->bindParam(":pper", $results_per_page); |
488 | 488 | $stmt->execute(); |
489 | 489 | |
490 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
490 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
491 | 491 | ?> |
492 | 492 | |
493 | 493 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | <?php |
570 | 570 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
571 | 571 | $stmt->execute(); |
572 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
572 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
573 | 573 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
574 | 574 | $video['duration'] = $__time_h->timestamp($video['duration']); |
575 | 575 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |