Test Failed
Push — main ( 00747d...5f665f )
by chief
03:00
created
web/public/t/about_subrocks.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - About";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - About";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/t/terms.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Terms & Conditions";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Terms & Conditions";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/t/partners.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Terms & Conditions";
14
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
13
+    $__server->page_embeds->page_title = "SubRocks - Terms & Conditions";
14
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
15
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
16
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
17 17
 ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/2013/index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks";
12
-	$__server->page_embeds->page_description = "Share your videos with friends, family, and the world";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks";
12
+    $__server->page_embeds->page_description = "Share your videos with friends, family, and the world";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <html lang="en">
17 17
 	<head>
Please login to merge, or discard this patch.
web/public/channel_discussion.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+    if(isset($_SESSION['siteusername']))
16
+        $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18 18
     if(!$__user_h->user_exists($_GET['n']))
19 19
         header("Location: /?userdoesntexist");
20 20
 
21 21
     $_user = $__user_h->fetch_user_username($_GET['n']);
22 22
 
23
-	$stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
-	$stmt->bindParam(":username", $_user['username']);
25
-	$stmt->execute();
23
+    $stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC");
24
+    $stmt->bindParam(":username", $_user['username']);
25
+    $stmt->execute();
26 26
 
27
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
-		header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
-	}
27
+    while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28
+        header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29
+    }
30 30
 
31 31
     function clean($string) {
32 32
         $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
@@ -34,21 +34,21 @@  discard block
 block discarded – undo
34 34
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
35 35
     }
36 36
 
37
-	function addhttp($url) {
38
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
-			$url = "http://" . $url;
40
-		}
41
-		return $url;
42
-	}
37
+    function addhttp($url) {
38
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
39
+            $url = "http://" . $url;
40
+        }
41
+        return $url;
42
+    }
43 43
 
44 44
     function check_valid_colorhex($colorCode) {
45 45
         // If user accidentally passed along the # sign, strip it off
46 46
         $colorCode = ltrim($colorCode, '#');
47 47
     
48 48
         if (
49
-              ctype_xdigit($colorCode) &&
49
+                ctype_xdigit($colorCode) &&
50 50
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
51
-                   return true;
51
+                    return true;
52 52
     
53 53
         else return false;
54 54
     }
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84 84
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
85 85
 
86
-	if(isset($_SESSION['siteusername']))
87
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
86
+    if(isset($_SESSION['siteusername']))
87
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
88 88
 
89 89
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
90 90
         $error = array();
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
99 99
 
100 100
         if(!isset($error['message'])) {
101
-			$text = $_POST['comment'];
101
+            $text = $_POST['comment'];
102 102
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
103
-			$stmt->bindParam(":id", $_user['username']);
104
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
105
-			$stmt->bindParam(":comment", $text);
103
+            $stmt->bindParam(":id", $_user['username']);
104
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
105
+            $stmt->bindParam(":comment", $text);
106 106
             $stmt->execute();
107 107
 
108 108
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
     }
115 115
 ?>
116 116
 <?php
117
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
117
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
118
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
119
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
120
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
121 121
 ?>
122 122
 <!DOCTYPE html>
123 123
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -145,27 +145,27 @@  discard block
 block discarded – undo
145 145
 				background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>);
146 146
 				background-repeat: repeat;
147 147
 				<?php
148
-					switch($_user['2012_bgoption']) {
149
-						case "stretch":
150
-						echo "background-size: cover;";
151
-						break;
152
-						case "solid":
153
-						echo "";
154
-						break;
155
-						case "norepeat":
156
-						echo "background-repeat: no-repeat !important;";
157
-						break;
158
-						case "repeatxy":
159
-						echo "background-repeat: repeat;";
160
-						break;
161
-						case "repeaty":
162
-						echo "background-repeat: repeat-y;";
163
-						break;
164
-						case "repeatx":
165
-						echo "background-repeat: repeat-x;";
166
-						break;
167
-					}
168
-				?>
148
+                    switch($_user['2012_bgoption']) {
149
+                        case "stretch":
150
+                        echo "background-size: cover;";
151
+                        break;
152
+                        case "solid":
153
+                        echo "";
154
+                        break;
155
+                        case "norepeat":
156
+                        echo "background-repeat: no-repeat !important;";
157
+                        break;
158
+                        case "repeatxy":
159
+                        echo "background-repeat: repeat;";
160
+                        break;
161
+                        case "repeaty":
162
+                        echo "background-repeat: repeat-y;";
163
+                        break;
164
+                        case "repeatx":
165
+                        echo "background-repeat: repeat-x;";
166
+                        break;
167
+                    }
168
+                ?>
169 169
 			}
170 170
    		</style>
171 171
 	</head>
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
183 183
 				<?php } ?> 
184 184
 				<?php
185
-					if(empty(trim($_user['bio'])))
186
-						$_user['bio'] = "This user has no description.";
187
-				?>
185
+                    if(empty(trim($_user['bio'])))
186
+                        $_user['bio'] = "This user has no description.";
187
+                ?>
188 188
 				<div id="content">
189 189
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
190 190
 						<div class="content" id="recommended-channels-list"></div>
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+    if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
+        header("Location: /");
20 20
 
21
-	$__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
21
+    $__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]);
22 22
 
23
-	$_SESSION['current_video'] = $_video['rid'];
23
+    $_SESSION['current_video'] = $_video['rid'];
24 24
 
25
-	/* 
25
+    /* 
26 26
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
27 27
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
28 28
 	Work on this tomorrow or some shit idk lol
29 29
 	*/
30 30
 
31
-	/* 
31
+    /* 
32 32
 	USE THE GOD DAMN __CONFIG MORE -- idiot
33 33
 	Work on this tomorrow or some shit
34 34
 	*/
35 35
 
36
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
36
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
37
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
38
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
39
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
40 40
 ?>
41 41
 <!DOCTYPE html>
42 42
 <html>
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
          if (window.yt.timing) {yt.timing.tick("ct");}    
67 67
       </script>
68 68
 		<?php
69
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
69
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
70
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
71 71
 
72
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
72
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
73
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
74 74
 
75
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
75
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
76
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
77 77
 
78
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
-				$_video['likeswidth'] = 0;
80
-				$_video['dislikeswidth'] = 0;
81
-			} else {
82
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
-			}
78
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
79
+                $_video['likeswidth'] = 0;
80
+                $_video['dislikeswidth'] = 0;
81
+            } else {
82
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
83
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
84
+            }
85 85
 
86
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
-		?>
86
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
87
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
88
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
89
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
90
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
91
+        ?>
92 92
 	</head>
93 93
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
94 94
 		<form name="logoutForm" method="POST" action="/logout">
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 
157 157
 									<?php $_user = $__user_h->fetch_user_username($_video['author']); ?>
158 158
 									<?php
159
-										$stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
-										$stmt->bindParam(":ip", $_user['ip']);
161
-										$stmt->execute();
162
-										$alts = $stmt->rowCount();
159
+                                        $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip");
160
+                                        $stmt->bindParam(":ip", $_user['ip']);
161
+                                        $stmt->execute();
162
+                                        $alts = $stmt->rowCount();
163 163
 
164
-										if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
164
+                                        if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; }
165 165
 
166
-										while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
-											if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
-												echo "
166
+                                        while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { 
167
+                                            if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0")
168
+                                                echo "
169 169
 												  <a style='font-size:10px;' href='/user/" .  htmlspecialchars($username['username']) . "'>" . 
170
-													htmlspecialchars($username['username']) 
171
-												. "</a><br>";
172
-										}
173
-									?>
170
+                                                    htmlspecialchars($username['username']) 
171
+                                                . "</a><br>";
172
+                                        }
173
+                                    ?>
174 174
 									<hr>
175 175
 								<?php } ?>
176 176
 								<h1 id="watch-headline-title">
@@ -384,21 +384,21 @@  discard block
 block discarded – undo
384 384
 													<hr><br>
385 385
 													<h3>Add to a Playlist</h3>
386 386
 													<?php
387
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
389
-														$stmt->execute();
390
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
-															$buffer = json_decode($playlist['videos']);
392
-															@$rid = $buffer[0];
393
-															if(!empty($rid)) {
394
-																@$video = $__video_h->fetch_video_rid($rid);
395
-															} else {
396
-																$video['thumbnail'] = "";
397
-																$video['duration'] = 0;
398
-															}
387
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
388
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
389
+                                                        $stmt->execute();
390
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+                                                            $buffer = json_decode($playlist['videos']);
392
+                                                            @$rid = $buffer[0];
393
+                                                            if(!empty($rid)) {
394
+                                                                @$video = $__video_h->fetch_video_rid($rid);
395
+                                                            } else {
396
+                                                                $video['thumbnail'] = "";
397
+                                                                $video['duration'] = 0;
398
+                                                            }
399 399
 
400
-															$videos = count($buffer);
401
-													?>
400
+                                                            $videos = count($buffer);
401
+                                                    ?>
402 402
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br>
403 403
 													<?php } ?>
404 404
 												<?php } ?>
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
 												</div>
664 664
 											</div>
665 665
 											<?php 
666
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
-												$stmt->bindParam(":v", $_GET['v']);
668
-												$stmt->execute();
669
-											?>
666
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
667
+                                                $stmt->bindParam(":v", $_GET['v']);
668
+                                                $stmt->execute();
669
+                                            ?>
670 670
 
671 671
 											<?php if($stmt->rowCount() != 0) { ?>
672 672
 												<div class="comments-section">
@@ -676,16 +676,16 @@  discard block
 block discarded – undo
676 676
 													<h4>Video Responses</h4>
677 677
 													<ul class="video-list">
678 678
 													<?php 
679
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
-															if($__video_h->video_exists($video['video'])) { 
681
-																$video = $__video_h->fetch_video_rid($video['video']);
682
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
-																$video['duration'] = $__time_h->timestamp($video['duration']);
684
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
685
-																$video['author'] = htmlspecialchars($video['author']);		
686
-																$video['title'] = htmlspecialchars($video['title']);
687
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
688
-													?>
679
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
680
+                                                            if($__video_h->video_exists($video['video'])) { 
681
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
682
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
683
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
684
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
685
+                                                                $video['author'] = htmlspecialchars($video['author']);		
686
+                                                                $video['title'] = htmlspecialchars($video['title']);
687
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
688
+                                                    ?>
689 689
 														<li class="video-list-item yt-tile-default">
690 690
 															<a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&amp;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>
691 691
 															<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">
@@ -766,38 +766,38 @@  discard block
 block discarded – undo
766 766
 												</div>
767 767
 												<ul class="comment-list" id="live_comments">
768 768
 														<?php
769
-														$results_per_page = 20;
769
+                                                        $results_per_page = 20;
770 770
 
771
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
-														$stmt->bindParam(":rid", $_video['rid']);
773
-														$stmt->execute();
771
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
772
+                                                        $stmt->bindParam(":rid", $_video['rid']);
773
+                                                        $stmt->execute();
774 774
 
775
-														$number_of_result = $stmt->rowCount();
776
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
775
+                                                        $number_of_result = $stmt->rowCount();
776
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
777 777
 
778
-														if (!isset ($_GET['page']) ) {  
779
-															$page = 1;  
780
-														} else {  
781
-															$page = (int)$_GET['page'];  
782
-														}  
778
+                                                        if (!isset ($_GET['page']) ) {  
779
+                                                            $page = 1;  
780
+                                                        } else {  
781
+                                                            $page = (int)$_GET['page'];  
782
+                                                        }  
783 783
 
784
-														$page_first_result = ($page - 1) * $results_per_page;  
784
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
785 785
 
786
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
-														$stmt->bindParam(":rid", $_video['rid']);
788
-														$stmt->bindParam(":pfirst", $page_first_result);
789
-														$stmt->bindParam(":pper", $results_per_page);
790
-														$stmt->execute();
786
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
787
+                                                        $stmt->bindParam(":rid", $_video['rid']);
788
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
789
+                                                        $stmt->bindParam(":pper", $results_per_page);
790
+                                                        $stmt->execute();
791 791
 
792
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
-																$comment['liked'] = true;
795
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
-																$comment['disliked'] = true;
792
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
793
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
794
+                                                                $comment['liked'] = true;
795
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
796
+                                                                $comment['disliked'] = true;
797 797
 																
798
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
-													?>
798
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
799
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
800
+                                                    ?>
801 801
 
802 802
 														<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
803 803
 															<div class="comment-body">
@@ -863,12 +863,12 @@  discard block
 block discarded – undo
863 863
 															</div>
864 864
 														</li>
865 865
 														<?php 
866
-															$stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
-															$stmt2->bindParam(":rid", $comment['id']);
868
-															$stmt2->execute();
866
+                                                            $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC");
867
+                                                            $stmt2->bindParam(":rid", $comment['id']);
868
+                                                            $stmt2->execute();
869 869
 
870
-															while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
-														?>
870
+                                                            while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { 
871
+                                                        ?>
872 872
 															<li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0">
873 873
 																<div class="comment-body">
874 874
 																	<div class="content-container">
@@ -948,19 +948,19 @@  discard block
 block discarded – undo
948 948
 										<div id="watch-related-container" class="watch-sidebar-body">
949 949
 											<ul id="watch-related" class="video-list">
950 950
 												<?php
951
-													$stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
-													$stmt->execute();
953
-													while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
-														$_playlist['videos'] = json_decode($_playlist['videos']);
955
-														$_playlist['count'] = 1;
951
+                                                    $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2");
952
+                                                    $stmt->execute();
953
+                                                    while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) {	
954
+                                                        $_playlist['videos'] = json_decode($_playlist['videos']);
955
+                                                        $_playlist['count'] = 1;
956 956
 
957
-														if($__video_h->video_exists($_playlist['videos'][0])) {
958
-															$video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
-														} else {
960
-															$video = [];
961
-															$video['thumbnail'] = "default.jpg";
962
-														}
963
-												?>
957
+                                                        if($__video_h->video_exists($_playlist['videos'][0])) {
958
+                                                            $video = $__video_h->fetch_video_rid($_playlist['videos'][0]);
959
+                                                        } else {
960
+                                                            $video = [];
961
+                                                            $video['thumbnail'] = "default.jpg";
962
+                                                        }
963
+                                                ?>
964 964
 												<li class="video-list-item">
965 965
 													<a href="/view_playlist?v=<?php echo $_playlist['rid']; ?>" class="related-playlist yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAMQzhooAA%3D%3D&amp;ei=CKf4md_r7rMCFYMfRAodLGlRiA%3D%3D&amp;feature=list_other">
966 966
 														<span class="ux-thumb-wrap">
@@ -1007,16 +1007,16 @@  discard block
 block discarded – undo
1007 1007
 												<?php } ?>
1008 1008
 												<div id="ppv-container" class="hid"></div>
1009 1009
 												<?php
1010
-													$stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
-													$stmt->execute();
1012
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
-														$video['duration'] = $__time_h->timestamp($video['duration']);
1015
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
-														$video['author'] = htmlspecialchars($video['author']);		
1017
-														$video['title'] = htmlspecialchars($video['title']);
1018
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
-												?>
1010
+                                                    $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20");
1011
+                                                    $stmt->execute();
1012
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
1013
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
1014
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
1015
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
1016
+                                                        $video['author'] = htmlspecialchars($video['author']);		
1017
+                                                        $video['title'] = htmlspecialchars($video['title']);
1018
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
1019
+                                                ?>
1020 1020
 												<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&amp;<?php echo htmlspecialchars($_video['author']); ?>&amp;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']; ?>" onerror=";this.src='/dynamic/thumbs/default.jpg';" 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>
1021 1021
 													<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">
1022 1022
 													</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
Please login to merge, or discard this patch.
web/public/s/mod/header.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	if(isset($_SESSION['siteusername'])) {
2
+    if(isset($_SESSION['siteusername'])) {
3 3
         $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username");
4 4
         $stmt->bindParam(":username", $_SESSION['siteusername']);
5
-		$stmt->bindParam(":ip",       $_SERVER["HTTP_CF_CONNECTING_IP"]);
5
+        $stmt->bindParam(":ip",       $_SERVER["HTTP_CF_CONNECTING_IP"]);
6 6
         $stmt->execute();
7 7
 
8
-		$stmt = $__db->prepare("UPDATE users SET lastlogin = now() WHERE username = :username");
8
+        $stmt = $__db->prepare("UPDATE users SET lastlogin = now() WHERE username = :username");
9 9
         $stmt->bindParam(":username", $_SESSION['siteusername']);
10 10
         $stmt->execute();
11
-	}
11
+    }
12 12
 
13
-	if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
14
-		die("<a href='/logout'>Your user has been deleted. Logout</a>");
15
-	}
13
+    if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
14
+        die("<a href='/logout'>Your user has been deleted. Logout</a>");
15
+    }
16 16
 ?>
17 17
 <!-- begin masthead -->
18 18
 <div id="masthead" class="" dir="ltr">
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 <div id="masthead-expanded" class="hid" style="display: none;height: 165px;">
110 110
 	<div id="masthead-expanded-container" style="height: 142px;" class="with-sandbar">
111 111
 	<?php
112
-		$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
113
-		$stmt->bindParam(":username", $_SESSION['siteusername']);
114
-		$stmt->execute();
115
-	?>
112
+        $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
113
+        $stmt->bindParam(":username", $_SESSION['siteusername']);
114
+        $stmt->execute();
115
+    ?>
116 116
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="<?php echo $stmt->rowCount(); ?>"
117 117
 		style="
118 118
 		width: 580px;
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
 	<div class="yt-uix-slider-body" style="width: 525px;">
128 128
 		<div class="yt-uix-slider-slides">
129 129
 			<?php 
130
-				while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
131
-					$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
132
-					$video['duration'] = $__time_h->timestamp($video['duration']);
133
-					$video['views'] = $__video_h->fetch_video_views($video['rid']);
134
-					$video['author'] = htmlspecialchars($video['author']);		
135
-					$video['title'] = htmlspecialchars($video['title']);
136
-					$video['description'] = $__video_h->shorten_description($video['description'], 50);
137
-			?>
130
+                while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
131
+                    $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
132
+                    $video['duration'] = $__time_h->timestamp($video['duration']);
133
+                    $video['views'] = $__video_h->fetch_video_views($video['rid']);
134
+                    $video['author'] = htmlspecialchars($video['author']);		
135
+                    $video['title'] = htmlspecialchars($video['title']);
136
+                    $video['description'] = $__video_h->shorten_description($video['description'], 50);
137
+            ?>
138 138
 			<ul class="yt-uix-slider-slide ">
139 139
 				<li class="yt-uix-slider-slide-item ">
140 140
 					<div class="video-list-item  yt-tile-default ">
Please login to merge, or discard this patch.
web/public/s/mod/channel_feed.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 																	  ORDER BY 
52 52
 																		`date` DESC LIMIT 10;");
53 53
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
54
-																		$stmt->bindParam(":videos_username", $_user['username']);
54
+                                                                        $stmt->bindParam(":videos_username", $_user['username']);
55 55
                                                                         $stmt->execute();
56
-																		if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
56
+                                                                        if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
57 57
                                                                         while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
58
-																			if((int)$content['id']) {
59
-																				$content = $__video_h->fetch_comment_id($content['id']);
60
-																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
61
-																				$content['type'] = "comment";
62
-																			} else {
63
-																				$content = $__video_h->fetch_video_rid($content['id']);
64
-																				$content['type'] = "video";
65
-																			}
58
+                                                                            if((int)$content['id']) {
59
+                                                                                $content = $__video_h->fetch_comment_id($content['id']);
60
+                                                                                $content['video'] = $__video_h->fetch_video_rid($content['toid']);
61
+                                                                                $content['type'] = "comment";
62
+                                                                            } else {
63
+                                                                                $content = $__video_h->fetch_video_rid($content['id']);
64
+                                                                                $content['type'] = "video";
65
+                                                                            }
66 66
 
67
-																			if($content['type'] == "video") {
67
+                                                                            if($content['type'] == "video") {
68 68
                                                                     ?>
69 69
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
70 70
                                                                         <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                                                                         </div>
137 137
                                                                     </div>
138 138
                                                                     <?php } else { 
139
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
139
+                                                                        if($__video_h->video_exists($content['video']['rid'])) { ?>
140 140
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
141 141
 																		<a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
142 142
 																		<span class="video-thumb ux-thumb yt-thumb-square-28 "><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 htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span>
Please login to merge, or discard this patch.
web/public/s/mod/channel_playlists.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
                                                         $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
53 53
                                                         $stmt->bindParam(":search", $_user['username']);
54 54
                                                         $stmt->execute();
55
-													?>
55
+                                                    ?>
56 56
 													<div class="playlist-info">
57 57
 														<h2><?php echo htmlspecialchars($_user['username']); ?>'s playlists</h2>
58 58
 														<?php if($stmt->rowCount() == 0) { echo "<span style='font-size:11px;color:grey;'>This user has no playlists available currently.</span><br><br>"; } ?>
Please login to merge, or discard this patch.