Test Failed
Pull Request — main (#24)
by
unknown
02:55
created
web/public/upload_video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13
-	$__server->page_embeds->page_title = "SubRocks - Upload Video";
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 - Upload Video";
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>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_h = new user_helper($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13 13
 	$__server->page_embeds->page_title = "SubRocks - Upload Video";
14 14
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                                 <b>Category</b> <br>
97 97
                                 <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
98 98
                                     <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?>
99
-                                    <?php foreach($categories as $categoryTag) { ?>
99
+                                    <?php foreach ($categories as $categoryTag) { ?>
100 100
                                         <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
101 101
                                     <?php } ?>
102 102
                                 </select><br><br>
Please login to merge, or discard this patch.
web/public/subscriptions.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12
-	$__server->page_embeds->page_title = "SubRocks - Subscriptions";
13
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
12
+    $__server->page_embeds->page_title = "SubRocks - Subscriptions";
13
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
16 16
 ?>
17 17
 <!DOCTYPE html>
18 18
 <html dir="ltr">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <?php $__user_h = new user_helper($__db); ?>
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
10
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12 12
 	$__server->page_embeds->page_title = "SubRocks - Subscriptions";
13 13
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                                 ?>                    
164 164
                                 
165 165
                                 <div class="my_videos_ajax">                                  
166
-                                    <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
166
+                                    <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
167 167
                                         <div style="width: 33%;display: inline-block;">
168 168
                                             <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>">
169 169
                                             <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;">
Please login to merge, or discard this patch.
web/public/edit_video.php 2 patches
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 - Edit Video";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
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 - Edit Video";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
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
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14 14
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         <b>Category</b> <br>
178 178
                                         <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
179 179
                                             <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?>
180
-                                            <?php foreach($categories as $categoryTag) { ?>
180
+                                            <?php foreach ($categories as $categoryTag) { ?>
181 181
                                                 <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
182 182
                                             <?php } ?>
183 183
                                         </select><br><br>
Please login to merge, or discard this patch.
web/public/channel.php 3 patches
Braces   +18 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,11 +12,13 @@  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
-        header("Location: /?userdoesntexist");
19
+    if(!$__user_h->user_exists($_GET['n'])) {
20
+            header("Location: /?userdoesntexist");
21
+    }
20 22
 
21 23
     $_user = $__user_h->fetch_user_username($_GET['n']);
22 24
 
@@ -39,10 +41,11 @@  discard block
 block discarded – undo
39 41
     
40 42
         if (
41 43
               ctype_xdigit($colorCode) &&
42
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
44
-    
45
-        else return false;
44
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
45
+                           return true;
46
+        } else {
47
+            return false;
48
+        }
46 49
     }
47 50
 
48 51
     $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']);
@@ -74,8 +77,9 @@  discard block
 block discarded – undo
74 77
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75 78
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
76 79
 
77
-	if(isset($_SESSION['siteusername']))
78
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80
+	if(isset($_SESSION['siteusername'])) {
81
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
82
+	}
79 83
 
80 84
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
81 85
         $error = array();
@@ -151,8 +155,9 @@  discard block
 block discarded – undo
151 155
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
152 156
 				<?php } ?>
153 157
 				<?php
154
-					if(empty(trim($_user['bio'])))
155
-						$_user['bio'] = "This user has no description.";
158
+					if(empty(trim($_user['bio']))) {
159
+											$_user['bio'] = "This user has no description.";
160
+					}
156 161
 				?>
157 162
 				<div id="content">
158 163
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
@@ -235,7 +240,7 @@  discard block
 block discarded – undo
235 240
 												<div class="header-stats">
236 241
 													<div class="stat-entry">
237 242
 														<span class="stat-value"><?php echo $_user['subscribers']; ?></span>
238
-														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span>
243
+														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php } else{ ?>subscribers<?php } ?></span>
239 244
 													</div>
240 245
 													<div class="stat-entry">
241 246
 														<span class="stat-value"><?php echo $_user['views']; ?></span>
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  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");
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
27 27
     }
28 28
 
29
-	function addhttp($url) {
30
-		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
-			$url = "http://" . $url;
32
-		}
33
-		return $url;
34
-	}
29
+    function addhttp($url) {
30
+        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
31
+            $url = "http://" . $url;
32
+        }
33
+        return $url;
34
+    }
35 35
 
36 36
     function check_valid_colorhex($colorCode) {
37 37
         // If user accidentally passed along the # sign, strip it off
38 38
         $colorCode = ltrim($colorCode, '#');
39 39
     
40 40
         if (
41
-              ctype_xdigit($colorCode) &&
41
+                ctype_xdigit($colorCode) &&
42 42
               (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
43
+                    return true;
44 44
     
45 45
         else return false;
46 46
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7);
66 66
 
67 67
     $_user['genre'] = strtolower($_user['genre']);
68
-	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
68
+    $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
69 69
 
70 70
     if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71 71
     if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75 75
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
76 76
 
77
-	if(isset($_SESSION['siteusername']))
78
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
77
+    if(isset($_SESSION['siteusername']))
78
+        $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
79 79
 
80 80
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
81 81
         $error = array();
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
90 90
 
91 91
         if(!isset($error['message'])) {
92
-			$text = $_POST['comment'];
92
+            $text = $_POST['comment'];
93 93
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
94
-			$stmt->bindParam(":id", $_user['username']);
95
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
96
-			$stmt->bindParam(":comment", $text);
94
+            $stmt->bindParam(":id", $_user['username']);
95
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
96
+            $stmt->bindParam(":comment", $text);
97 97
             $stmt->execute();
98 98
 
99 99
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
     }
106 106
 ?>
107 107
 <?php
108
-	$__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
109
-	$__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
110
-	$__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
111
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
108
+    $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']);
109
+    $__server->page_embeds->page_description = htmlspecialchars($_user['bio']);
110
+    $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']);
111
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
112 112
 ?>
113 113
 <!DOCTYPE html>
114 114
 <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
@@ -140,27 +140,27 @@  discard block
 block discarded – undo
140 140
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
141 141
 				background-repeat: repeat;
142 142
 				<?php
143
-					switch($_user['2012_bgoption']) {
144
-						case "stretch":
145
-						echo "background-size: cover;";
146
-						break;
147
-						case "solid":
148
-						echo "";
149
-						break;
150
-						case "norepeat":
151
-						echo "";
152
-						break;
153
-						case "repeatxy":
154
-						echo "background-repeat: repeat;";
155
-						break;
156
-						case "repeaty":
157
-						echo "background-repeat: repeat-y;";
158
-						break;
159
-						case "repeatx":
160
-						echo "background-repeat: repeat-x;";
161
-						break;
162
-					}
163
-				?>
143
+                    switch($_user['2012_bgoption']) {
144
+                        case "stretch":
145
+                        echo "background-size: cover;";
146
+                        break;
147
+                        case "solid":
148
+                        echo "";
149
+                        break;
150
+                        case "norepeat":
151
+                        echo "";
152
+                        break;
153
+                        case "repeatxy":
154
+                        echo "background-repeat: repeat;";
155
+                        break;
156
+                        case "repeaty":
157
+                        echo "background-repeat: repeat-y;";
158
+                        break;
159
+                        case "repeatx":
160
+                        echo "background-repeat: repeat-x;";
161
+                        break;
162
+                    }
163
+                ?>
164 164
 			}
165 165
    		</style>
166 166
 		   <script>
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
189 189
 				<?php } ?>
190 190
 				<?php
191
-					if(empty(trim($_user['bio'])))
192
-						$_user['bio'] = "This user has no description.";
193
-				?>
191
+                    if(empty(trim($_user['bio'])))
192
+                        $_user['bio'] = "This user has no description.";
193
+                ?>
194 194
 				<div id="content">
195 195
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
196 196
 						<div class="content" id="recommended-channels-list"></div>
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 													<h2>Featured Channels</h2>
537 537
 													<ul class="channel-summary-list ">
538 538
 														<?php 
539
-															foreach($_user['featured_channels'] as $user) {
540
-																if($__user_h->user_exists($user)) {
541
-														?>
539
+                                                            foreach($_user['featured_channels'] as $user) {
540
+                                                                if($__user_h->user_exists($user)) {
541
+                                                        ?>
542 542
 															<li class="yt-tile-visible yt-uix-tile">
543 543
 																<div class="channel-summary clearfix channel-summary-compact">
544 544
 																	<div class="channel-summary-thumb">
@@ -562,19 +562,19 @@  discard block
 block discarded – undo
562 562
 											</div>
563 563
 
564 564
 											<?php 
565
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
566
-												$stmt->bindParam(":search", $_user['username']);
567
-												$stmt->execute();
565
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
566
+                                                $stmt->bindParam(":search", $_user['username']);
567
+                                                $stmt->execute();
568 568
 
569
-												if($stmt->rowCount() != 0) {
570
-											?>
569
+                                                if($stmt->rowCount() != 0) {
570
+                                            ?>
571 571
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
572 572
 													<div class="module-view gh-featured">
573 573
 														<h2>Featured Playlists</h2>     
574 574
 														<?php
575
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576
-															$playlist['videos'] = json_decode($playlist['videos']);
577
-														?> 
575
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
577
+                                                        ?> 
578 578
 															<div class="playlist yt-tile-visible yt-uix-tile">
579 579
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
580 580
 																<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">
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  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']))
15
+	if (isset($_SESSION['siteusername']))
16 16
 	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17 17
 
18
-    if(!$__user_h->user_exists($_GET['n']))
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']);
@@ -67,28 +67,28 @@  discard block
 block discarded – undo
67 67
     $_user['genre'] = strtolower($_user['genre']);
68 68
 	$_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
69 69
 
70
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
72
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
73
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
74
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
70
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
71
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
72
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
73
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
74
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
76 76
 
77
-	if(isset($_SESSION['siteusername']))
77
+	if (isset($_SESSION['siteusername']))
78 78
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
79 79
 
80
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
80
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
81 81
         $error = array();
82 82
 
83
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
84
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
85
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
83
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
84
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
85
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
86 86
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
87 87
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
88
-        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; }
88
+        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 89
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
90 90
 
91
-        if(!isset($error['message'])) {
91
+        if (!isset($error['message'])) {
92 92
 			$text = $_POST['comment'];
93 93
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
94 94
 			$stmt->bindParam(":id", $_user['username']);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
100 100
 
101
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
101
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
102 102
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
103 103
             }
104 104
         }
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
137 137
 		<style>
138 138
 			#content-container {
139
-				background-color: <?php echo $_user['primary_color'];  ?>;
139
+				background-color: <?php echo $_user['primary_color']; ?>;
140 140
 				background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>);
141 141
 				background-repeat: repeat;
142 142
 				<?php
143
-					switch($_user['2012_bgoption']) {
143
+					switch ($_user['2012_bgoption']) {
144 144
 						case "stretch":
145 145
 						echo "background-size: cover;";
146 146
 						break;
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
185 185
 			<div id="content-container">
186 186
 				<!-- begin content -->
187
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
187
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
188 188
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
189 189
 				<?php } ?>
190 190
 				<?php
191
-					if(empty(trim($_user['bio'])))
191
+					if (empty(trim($_user['bio'])))
192 192
 						$_user['bio'] = "This user has no description.";
193 193
 				?>
194 194
 				<div id="content">
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
244 244
 											</div>
245 245
 											<div class="upper-left-section enable-fancy-subscribe-button">
246
-												<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
246
+												<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
247 247
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
248 248
 														<button 
249 249
 															href="#" 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 															title="" 
252 252
 															id="subscribe-button"
253 253
 															type="button" 
254
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
254
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
255 255
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
256 256
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
257 257
 														<span class="subscribed-label">Subscribed</span>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 												<div class="header-stats">
273 273
 													<div class="stat-entry">
274 274
 														<span class="stat-value"><?php echo $_user['subscribers']; ?></span>
275
-														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span>
275
+														<span class="stat-name"><?php if ($_user['subscribers'] == 1) { ?>subscriber<?php } else { ?>subscribers<?php } ?></span>
276 276
 													</div>
277 277
 													<div class="stat-entry">
278 278
 														<span class="stat-value"><?php echo $_user['views']; ?></span>
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
 									</div>
318 318
 								</div>
319 319
 							</div>
320
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
320
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
321 321
 							<div id="branded-page-body">
322 322
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template">
323 323
 									<div class="tab-content-body">
324 324
 										<div class="primary-pane">
325
-                                            <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
325
+                                            <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?>
326 326
 											<div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge">
327 327
 												<div class="module-view featured-video-view-module">
328 328
 												<div id="watch-video" >
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 													<div class="playlist-info">
380 380
 														<h2>Uploaded videos</h2>
381 381
 														<div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div>
382
-														<?php if($_user['videos'] == 0) { ?>
382
+														<?php if ($_user['videos'] == 0) { ?>
383 383
 															<h4>This user has not uploaded a video yet.</h4>
384 384
 														<?php } ?>
385 385
 													</div>
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                                                             $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
389 389
                                                             $stmt->bindParam(":username", $_user['username']);
390 390
                                                             $stmt->execute();
391
-                                                            while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
391
+                                                            while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
392 392
                                                         ?>
393 393
 														<li class="blogger-video">
394 394
 															<div class="video yt-tile-visible">
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 														</div>
471 471
 														<hr class="yt-horizontal-rule ">
472 472
 													</div>
473
-													<?php if(!empty($_user['website'])) { ?>
473
+													<?php if (!empty($_user['website'])) { ?>
474 474
 														<div class="user-profile-item">
475 475
 															<div class="yt-c3-profile-custom-url field-container ">
476 476
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 															<h5>Country</h5>
520 520
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
521 521
 														</div>
522
-														<?php if($_user['genre'] != "none") { ?>
522
+														<?php if ($_user['genre'] != "none") { ?>
523 523
 															<div class="user-profile-item ">
524 524
 																<h5>Channel Genre</h5>
525 525
 																<span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span>
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
 											</div>
532 532
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
533 533
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
534
-												<?php if(count($_user['featured_channels']) != 0) { ?>
534
+												<?php if (count($_user['featured_channels']) != 0) { ?>
535 535
 												<div class="module-view other-channels-view">
536 536
 													<h2>Featured Channels</h2>
537 537
 													<ul class="channel-summary-list ">
538 538
 														<?php 
539
-															foreach($_user['featured_channels'] as $user) {
540
-																if($__user_h->user_exists($user)) {
539
+															foreach ($_user['featured_channels'] as $user) {
540
+																if ($__user_h->user_exists($user)) {
541 541
 														?>
542 542
 															<li class="yt-tile-visible yt-uix-tile">
543 543
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -566,13 +566,13 @@  discard block
 block discarded – undo
566 566
 												$stmt->bindParam(":search", $_user['username']);
567 567
 												$stmt->execute();
568 568
 
569
-												if($stmt->rowCount() != 0) {
569
+												if ($stmt->rowCount() != 0) {
570 570
 											?>
571 571
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
572 572
 													<div class="module-view gh-featured">
573 573
 														<h2>Featured Playlists</h2>     
574 574
 														<?php
575
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
575
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
576 576
 															$playlist['videos'] = json_decode($playlist['videos']);
577 577
 														?> 
578 578
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/s/mod/channel_customization.php 2 patches
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -313,14 +313,15 @@
 block discarded – undo
313 313
                             for($i = 0;$i <= $countryLength; $i++)
314 314
                             {
315 315
                                 $c = $countries[$i];
316
-                                if ($c == $_user['country'])
317
-                                //country is the same as in database
316
+                                if ($c == $_user['country']) {
317
+                                                                //country is the same as in database
318 318
                                 {
319 319
                                 ?>
320
-                                <option value="<?php echo $c; ?>" selected="selected"><?php echo $c; ?></option>
321
-                                <?php
320
+                                <option value="<?php echo $c;
322 321
                                 }
323
-                                else
322
+                                ?>" selected="selected"><?php echo $c; ?></option>
323
+                                <?php
324
+                                } else
324 325
                                 {
325 326
                                 ?>
326 327
                                 <option value="<?php echo $c;?>"><?php echo $c; ?></option>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                             </script>
287 287
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
288 288
                         <img src="/dynamic/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br>
289
-                        <?php if($_user['pfp'] != "default.png") { ?>
289
+                        <?php if ($_user['pfp'] != "default.png") { ?>
290 290
                             <a href="/get/remove_profile_pic">Remove Profile Picture</a><br>
291 291
                         <?php } ?>
292 292
                         <br><hr class="thin-line-darker" style="width:unset;">
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                             <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload">
297 297
                             <button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>
298 298
                         </div><br>                   
299
-                        <?php if(!empty($_user['subbutton'])) { ?>
299
+                        <?php if (!empty($_user['subbutton'])) { ?>
300 300
                             <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br>
301 301
                         <?php } ?><br><hr class="thin-line-darker" style="width:unset;">
302 302
                         
@@ -322,19 +322,19 @@  discard block
 block discarded – undo
322 322
 
323 323
                         <b>Featured Video</b>
324 324
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
325
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid">
325
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid">
326 326
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
327 327
 
328 328
                         <div style="position: relative;top: 7px;">
329 329
                             <b>Featured Channels</b>
330 330
                             <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
331
-                            <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']);?>" name="featuredchannels">
331
+                            <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']); ?>" name="featuredchannels">
332 332
                             </div>
333 333
                         </div><br><br><hr class="thin-line-darker" style="margin-top: 0px;width:unset;"><br>
334 334
 
335 335
                         <b>Website</b>
336 336
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;">
337
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website">
337
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website">
338 338
                             
339 339
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
340 340
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                             <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span>
345 345
                             <div class="customization-module" id="channellayout" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;">
346 346
                                 <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="genre">
347
-                                    <?php foreach($categories as $category) { ?>
347
+                                    <?php foreach ($categories as $category) { ?>
348 348
                                         <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
349 349
                                     <?php } ?>
350 350
                                 </select>
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                                 <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="transparency">
359 359
                                 <?php
360 360
                                 $trans = array(
361
-                                    "1.1","1.0","0.9","0.8","0.7","0.6","0.5","0.4","0.3","0.2","0.1",
361
+                                    "1.1", "1.0", "0.9", "0.8", "0.7", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1",
362 362
                                 );
363 363
                                 ?>
364 364
                                     <option value="1.0">100% (Visible)</option>
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"  id="country" name="country" value="<?php echo $_user['country']?>">
382 382
                             <?php
383 383
                             $countries = array(
384
-                                "Select country","Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
384
+                                "Select country", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
385 385
                             );
386 386
 
387 387
                             $countryLength = sizeof($countries);
388 388
                             $i = 0;
389
-                            for($i = 0;$i <= $countryLength; $i++)
389
+                            for ($i = 0; $i <= $countryLength; $i++)
390 390
                             {
391 391
                                 $c = $countries[$i];
392 392
                                 if ($c == $_user['country'])
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                                 else
400 400
                                 {
401 401
                                 ?>
402
-                                <option value="<?php echo $c;?>"><?php echo $c; ?></option>
402
+                                <option value="<?php echo $c; ?>"><?php echo $c; ?></option>
403 403
                                 <?php
404 404
                                 }
405 405
                             }
Please login to merge, or discard this patch.
web/public/file_upload.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 - Replace me";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
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 - Replace me";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
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
 <!DOCTYPE html>
17 17
 <html>
Please login to merge, or discard this patch.
web/public/report.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@
 block discarded – undo
18 18
     "username" => str_replace("@", "", $_SESSION['siteusername']),
19 19
     // "avatar_url" => "https://subrock.rocks/dynamic/pfp/",
20 20
     "tts" => false,
21
-], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
21
+], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
22 22
 
23
-$ch = curl_init( $webhookurl );
24
-curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
25
-curl_setopt( $ch, CURLOPT_POST, 1);
26
-curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data);
27
-curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
28
-curl_setopt( $ch, CURLOPT_HEADER, 0);
29
-curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
23
+$ch = curl_init($webhookurl);
24
+curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
25
+curl_setopt($ch, CURLOPT_POST, 1);
26
+curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
27
+curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
28
+curl_setopt($ch, CURLOPT_HEADER, 0);
29
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30 30
 
31
-$response = curl_exec( $ch );
32
-curl_close( $ch );
31
+$response = curl_exec($ch);
32
+curl_close($ch);
33 33
 header('Location: ' . $_SERVER['HTTP_REFERER'] . '&success=Successfully reported this video.');
34 34
 ?>
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
web/public/results.php 3 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -4,46 +4,46 @@  discard block
 block discarded – undo
4 4
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?>
5 5
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?>
6 6
 <?php
7
-   $request = (object) [
8
-      "search_term"      => htmlspecialchars($_GET['search_query']),
9
-      "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
-      "search_amount"    => 0 /* [fallback] */
11
-   ];
7
+    $request = (object) [
8
+        "search_term"      => htmlspecialchars($_GET['search_query']),
9
+        "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
+        "search_amount"    => 0 /* [fallback] */
11
+    ];
12 12
 
13
-   $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
-   $stmt->bindParam(":search", $request->like_search_term);
15
-   $stmt->execute(); 
16
-   $request->search_amount = $stmt->rowCount();
13
+    $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
+    $stmt->bindParam(":search", $request->like_search_term);
15
+    $stmt->execute(); 
16
+    $request->search_amount = $stmt->rowCount();
17 17
 
18
-   $results_per_page = 12;
19
-   $number_of_result = $request->search_amount;
20
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
18
+    $results_per_page = 12;
19
+    $number_of_result = $request->search_amount;
20
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
21 21
 
22
-   if (!isset ($_GET['page']) ) {  
23
-       $page = 1;  
24
-   } else {  
25
-       $page = (int)$_GET['page'];  
26
-   }  
22
+    if (!isset ($_GET['page']) ) {  
23
+        $page = 1;  
24
+    } else {  
25
+        $page = (int)$_GET['page'];  
26
+    }  
27 27
 
28
-   $page_first_result = ($page - 1) * $results_per_page;  
28
+    $page_first_result = ($page - 1) * $results_per_page;  
29 29
 
30
-   $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
-   $stmt6->bindParam(":search", $request->like_search_term);
32
-   $stmt6->bindParam(":pfirst", $page_first_result);
33
-   $stmt6->bindParam(":pper", $results_per_page);
34
-   $stmt6->execute();
30
+    $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
+    $stmt6->bindParam(":search", $request->like_search_term);
32
+    $stmt6->bindParam(":pfirst", $page_first_result);
33
+    $stmt6->bindParam(":pper", $results_per_page);
34
+    $stmt6->execute();
35 35
 
36
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
36
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
37 37
 ?>
38 38
 <?php $__video_h = new video_helper($__db); ?>
39 39
 <?php $__user_h = new user_helper($__db); ?>
40 40
 <?php $__db_h = new db_helper(); ?>
41 41
 <?php $__time_h = new time_helper(); ?>
42 42
 <?php
43
-	$__server->page_embeds->page_title = "SubRocks - Search";
44
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
43
+    $__server->page_embeds->page_title = "SubRocks - Search";
44
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
47 47
 ?>
48 48
 <!DOCTYPE html>
49 49
 <html>
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
                   <div id="results-main-content">
220 220
                      <ol id="search-results">
221 221
                         <?php
222
-                           while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
-                              $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
-                              $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
-                              $video['duration'] = $__time_h->timestamp($video['duration']);
226
-                              $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
-                              $video['author'] = htmlspecialchars($video['author']);		
228
-                              $video['title'] = htmlspecialchars($video['title']);
229
-                              $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
222
+                            while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
+                                $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
+                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
+                                $video['duration'] = $__time_h->timestamp($video['duration']);
226
+                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
+                                $video['author'] = htmlspecialchars($video['author']);		
228
+                                $video['title'] = htmlspecialchars($video['title']);
229
+                                $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
230 230
                         ?>
231 231
                               <li class="yt-grid-box result-item-video *sr ">
232 232
                                  <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box ">
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                               </li>
255 255
                         <?php } ?>
256 256
                         <?php if($request->search_amount == 0)
257
-                           echo "Your search query has brought no results.<br><br>";
257
+                            echo "Your search query has brought no results.<br><br>";
258 258
                         ?>
259 259
                      </ol>
260 260
                   </div>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 
18 18
    $results_per_page = 12;
19 19
    $number_of_result = $request->search_amount;
20
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
20
+   $number_of_page = ceil($number_of_result/$results_per_page);  
21 21
 
22
-   if (!isset ($_GET['page']) ) {  
22
+   if (!isset ($_GET['page'])) {  
23 23
        $page = 1;  
24 24
    } else {  
25
-       $page = (int)$_GET['page'];  
25
+       $page = (int) $_GET['page'];  
26 26
    }  
27 27
 
28
-   $page_first_result = ($page - 1) * $results_per_page;  
28
+   $page_first_result = ($page - 1)*$results_per_page;  
29 29
 
30 30
    $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31 31
    $stmt6->bindParam(":search", $request->like_search_term);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                   <div id="results-main-content">
220 220
                      <ol id="search-results">
221 221
                         <?php
222
-                           while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
222
+                           while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223 223
                               $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224 224
                               $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225 225
                               $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                                  </div>
254 254
                               </li>
255 255
                         <?php } ?>
256
-                        <?php if($request->search_amount == 0)
256
+                        <?php if ($request->search_amount == 0)
257 257
                            echo "Your search query has brought no results.<br><br>";
258 258
                         ?>
259 259
                      </ol>
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             </div>
268 268
             <div id="search-footer-box" class="searchFooterBox">
269 269
                <div class="yt-uix-pager" role="navigation">
270
-                  <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
270
+                  <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
271 271
                      <a href="/results?search_query=<?php echo $request->search_term; ?>&page=<?php echo $page; ?>">
272 272
                         <button class="yt-uix-button yt-uix-button-default"><?php echo $page; ?></button>
273 273
                      </a>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -253,8 +253,9 @@
 block discarded – undo
253 253
                                  </div>
254 254
                               </li>
255 255
                         <?php } ?>
256
-                        <?php if($request->search_amount == 0)
256
+                        <?php if($request->search_amount == 0) {
257 257
                            echo "Your search query has brought no results.<br><br>";
258
+}
258 259
                         ?>
259 260
                      </ol>
260 261
                   </div>
Please login to merge, or discard this patch.
web/public/comment_voting.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
17
+if (!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18 18
     header('Location: ' . $_SERVER['HTTP_REFERER']); 
19 19
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
20
+if (isset($_GET['a']) && $_GET['a'] == "-1") 
21 21
     $request->action = "d";
22 22
 
23 23
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 24
 $stmt->bindParam(":username", $_SESSION['siteusername']);
25 25
 $stmt->bindParam(":reciever", $request->comment_id);
26 26
 $stmt->execute();
27
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
27
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28 28
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
29 29
     $stmt->execute(array(
30 30
         ':username' => $_SESSION['siteusername'],
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $stmt->bindParam(":username", $_SESSION['siteusername']);
38 38
 $stmt->bindParam(":reciever", $request->comment_id);
39 39
 $stmt->execute();
40
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
40
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
41 41
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
42 42
     $stmt->execute(array(
43 43
         ':username' => $_SESSION['siteusername'],
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     header('Location: ' . $_SERVER['HTTP_REFERER']);
47 47
 }
48 48
 
49
-if($request->action == "l") {
49
+if ($request->action == "l") {
50 50
     $stmt = $__db->prepare("INSERT INTO comment_likes (sender, reciever, type) VALUES (:sender, :reciever, 'l')");
51 51
     $stmt->bindParam(":sender", $_SESSION['siteusername']);
52 52
     $stmt->bindParam(":reciever", $request->comment_id);
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,13 @@
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18
-    header('Location: ' . $_SERVER['HTTP_REFERER']); 
17
+if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) {
18
+    header('Location: ' . $_SERVER['HTTP_REFERER']);
19
+}
19 20
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
21
+if(isset($_GET['a']) && $_GET['a'] == "-1") {
21 22
     $request->action = "d";
23
+}
22 24
 
23 25
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 26
 $stmt->bindParam(":username", $_SESSION['siteusername']);
Please login to merge, or discard this patch.