Test Failed
Push — main ( 241bcb...01cf0c )
by chief
03:08
created
web/public/s/mod/header.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 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 8
 
9
-	if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10
-		die("<a href='/logout'>Your user has been deleted. Logout</a>");
11
-	}
9
+    if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10
+        die("<a href='/logout'>Your user has been deleted. Logout</a>");
11
+    }
12 12
 ?>
13 13
 <!-- begin masthead -->
14 14
 <div id="masthead" class="" dir="ltr">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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 8
 
9
-	if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
9
+	if (isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) {
10 10
 		die("<a href='/logout'>Your user has been deleted. Logout</a>");
11 11
 	}
12 12
 ?>
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	<a id="logo-container" href="/" title="SubRocks home">
16 16
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks home">
17 17
 	</a>
18
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
18
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
19 19
 	<div id="yt-masthead-signin">
20 20
 		<div id="masthead-user-display"><span id="masthead-user-wrapper"><button href="/sign_in" type="button" id="masthead-user-button" onclick=";window.location.href=this.getAttribute('href');return false;" class=" yt-uix-button yt-uix-button-text" role="button"><span class="yt-uix-button-content">  <span id="masthead-user-image">
21 21
 			<span class="clip">
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 			<div id="masthead-user-bar">
34 34
 				<div id="masthead-user">
35 35
 					<span id="masthead-gaia-user-expander" class="masthead-user-menu-expander masthead-expander" onclick="yt.www.masthead.toggleExpandedMasthead()"><span id="masthead-gaia-user-wrapper" class="yt-rounded" tabindex="0"><?php echo htmlspecialchars($_SESSION['siteusername']); ?></span></span>
36
-							<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
36
+							<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
37 37
 							<button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-on yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button>
38 38
 					<?php } else { ?>
39 39
 							<button type="button" onclick=";window.location.href=this.getAttribute('href');return false;" href="/inbox/" class="sb-button sb-notif-off yt-uix-button" id="sb-button-notify" role="button"><span class="yt-uix-button-content"><?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?></span></button>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	<div class="alerts-2012">
56 56
 	
57 57
 	</div>
58
-	<?php if(isset($error['status'])) { ?>
58
+	<?php if (isset($error['status'])) { ?>
59 59
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
60 60
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
61 61
 		</div>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			</div>
66 66
 		</div></div></div>
67 67
 	<?php } ?>
68
-	<?php if(isset($_GET['error'])) { ?>
68
+	<?php if (isset($_GET['error'])) { ?>
69 69
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon">
70 70
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
71 71
 		</div>
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 			</div>
76 76
 		</div></div></div>
77 77
 	<?php } ?>
78
-	<?php if(isset($_GET['success'])) { ?>
78
+	<?php if (isset($_GET['success'])) { ?>
79 79
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-success ">  <div class="yt-alert-icon">
80 80
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
81 81
 		</div>
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			</div>
86 86
 		</div></div></div>
87 87
 	<?php } ?>
88
-	<?php if(isset($_SESSION['error'])) { ?>
88
+	<?php if (isset($_SESSION['error'])) { ?>
89 89
 		<div id="masthead_child_div" style="width: 970px;margin: auto;"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
90 90
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
91 91
 		</div>
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		<b>New minor update: <pre style="display:inline-block;">1fe1fa4</pre></b> <pre style="display:inline-block;font-size:10px;margin-left:35px;">This is a part of the Communications update. The inbox has been updated with a cleaner look.</pre>
102 102
 	</div></div></div></div><br>
103 103
 	-->
104
-<?php if(isset($_SESSION['siteusername'])) { ?>
104
+<?php if (isset($_SESSION['siteusername'])) { ?>
105 105
 <div id="masthead-expanded" class="hid" style="display: none;">
106 106
 	<div id="masthead-expanded-container" class="with-sandbar">
107 107
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4"
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
123 123
                     $stmt->bindParam(":username", $_SESSION['siteusername']);
124 124
                     $stmt->execute();
125
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
125
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
126 126
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
127 127
                         $video['duration'] = $__time_h->timestamp($video['duration']);
128 128
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/d/signup.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
 
39
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
39
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
40 40
         $request = (object) [
41 41
             "username" => $_POST['username'],
42 42
             "password" => $_POST['password'],
@@ -56,30 +56,30 @@  discard block
 block discarded – undo
56 56
         $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]);
57 57
         $stmt->execute();
58 58
 
59
-        while($ip = $stmt->fetch(PDO::FETCH_ASSOC)) { $request->error->message = "You cannot make alt accounts."; $request->error->status = "";  }
59
+        while ($ip = $stmt->fetch(PDO::FETCH_ASSOC)) { $request->error->message = "You cannot make alt accounts."; $request->error->status = ""; }
60 60
 
61 61
         if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) 
62
-            { $request->error->message = "Your email is invalid!"; $request->error->status = "";  }
63
-        if(strlen($request->username) > 21) 
62
+            { $request->error->message = "Your email is invalid!"; $request->error->status = ""; }
63
+        if (strlen($request->username) > 21) 
64 64
             { $request->error->message = "Your username must be shorter than 20 characters."; $request->error->status = ""; }
65
-        if(strlen($request->password) < 8) 
65
+        if (strlen($request->password) < 8) 
66 66
             { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; }
67
-        if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
67
+        if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
68 68
             { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; }
69
-        if(preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username))
69
+        if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $request->username))
70 70
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
71
-        if(!preg_match('/^\S+\w\S{1,}/', $request->username)) 
71
+        if (!preg_match('/^\S+\w\S{1,}/', $request->username)) 
72 72
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
73
-        if(empty(trim($request->username))) 
73
+        if (empty(trim($request->username))) 
74 74
             { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; }
75 75
         
76 76
         $stmt = $__db->prepare("SELECT username FROM users WHERE username = lower(:username)");
77 77
         $stmt->bindParam(":username", $request->username);
78 78
         $stmt->execute();
79
-        if($stmt->rowCount()) 
79
+        if ($stmt->rowCount()) 
80 80
             { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; }
81 81
         
82
-        if($request->error->status == "OK") {
82
+        if ($request->error->status == "OK") {
83 83
             $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)");
84 84
             $stmt->bindParam(":username", $request->username);
85 85
             $stmt->bindParam(":email", $request->email);
Please login to merge, or discard this patch.
web/public/get/feature_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "video" => $_GET['v'],
Please login to merge, or discard this patch.
web/public/inbox_ajax.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,29 +16,29 @@  discard block
 block discarded – undo
16 16
 
17 17
     $results_per_page = 12;
18 18
     $number_of_result = $stmt->rowCount();
19
-    $number_of_page = ceil ($number_of_result / $results_per_page);  
19
+    $number_of_page = ceil($number_of_result/$results_per_page);  
20 20
 
21
-    if (!isset ($_GET['page']) ) {  
21
+    if (!isset ($_GET['page'])) {  
22 22
         $page = 1;  
23 23
     } else {  
24
-        $page = (int)$_GET['page'];  
24
+        $page = (int) $_GET['page'];  
25 25
     }  
26 26
 
27
-    $page_first_result = ($page - 1) * $results_per_page;  
27
+    $page_first_result = ($page - 1)*$results_per_page;  
28 28
 
29
-    if($_GET['filter'] == "notification") {
29
+    if ($_GET['filter'] == "notification") {
30 30
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nt' AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
31 31
         $stmt6->bindParam(":search", $search);
32 32
         $stmt6->bindParam(":pfirst", $page_first_result);
33 33
         $stmt6->bindParam(":pper", $results_per_page);
34 34
         $stmt6->execute();
35
-    } else if($_GET['filter'] == "sent") {
35
+    } else if ($_GET['filter'] == "sent") {
36 36
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE owner = :search AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
37 37
         $stmt6->bindParam(":search", $search);
38 38
         $stmt6->bindParam(":pfirst", $page_first_result);
39 39
         $stmt6->bindParam(":pper", $results_per_page);
40 40
         $stmt6->execute(); 
41
-    } else if($_GET['filter'] == "pm") {
41
+    } else if ($_GET['filter'] == "pm") {
42 42
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nm' AND readed = 'y' ORDER BY id DESC LIMIT :pfirst, :pper");
43 43
         $stmt6->bindParam(":search", $search);
44 44
         $stmt6->bindParam(":pfirst", $page_first_result);
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
     </tr>
68 68
     
69 69
     <?php
70
-        while($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
71
-            if($__video_h->video_exists($inbox['video_attribute'])) {
70
+        while ($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
71
+            if ($__video_h->video_exists($inbox['video_attribute'])) {
72 72
                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
73 73
                 $inbox['video_attr_exists'] = true;
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     ?> 
83 83
     <tr style="margin-top: 5px;" id="videoslist">
84 84
             <!--
85
-            <?php if($inbox['readed'] == "n") { ?>
85
+            <?php if ($inbox['readed'] == "n") { ?>
86 86
                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
87 87
                 NEW
88 88
                 </a>
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             <p style="width:475px;">
114 114
             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
115 115
             </p>
116
-            <?php if($inbox['video_attr_exists']) { ?>
116
+            <?php if ($inbox['video_attr_exists']) { ?>
117 117
                 <hr>
118 118
                 <ul>
119 119
                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
Please login to merge, or discard this patch.
web/public/inbox/markasread.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15 15
     $request = (object) [
16 16
         "username" => $_SESSION['siteusername'],
17 17
 
Please login to merge, or discard this patch.
web/public/inbox/delete_message.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15 15
 
16 16
     $request = (object) [
17 17
         "id" => $_GET['id'],
Please login to merge, or discard this patch.
web/public/channel_discussion.php 3 patches
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.
Spacing   +25 added lines, -25 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']);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	$stmt->bindParam(":username", $_user['username']);
25 25
 	$stmt->execute();
26 26
 
27
-	while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
27
+	while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28 28
 		header("Location: /?error=This user has been terminated for violating SubRock's Community Guidelines.");
29 29
 	}
30 30
 
@@ -76,28 +76,28 @@  discard block
 block discarded – undo
76 76
     $_user['genre'] = strtolower($_user['genre']);
77 77
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
78 78
 
79
-    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
80
-    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
81
-    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
82
-    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
83
-    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84
-    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
79
+    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; }
80
+    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; }
81
+    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; }
82
+    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; }
83
+    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
84
+    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
85 85
 
86
-	if(isset($_SESSION['siteusername']))
86
+	if (isset($_SESSION['siteusername']))
87 87
     	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
88 88
 
89
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
89
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
90 90
         $error = array();
91 91
 
92
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
93
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
94
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
92
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
93
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
94
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
95 95
         //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; }
96 96
         //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; }
97
-        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; }
97
+        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; }
98 98
         //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } 
99 99
 
100
-        if(!isset($error['message'])) {
100
+        if (!isset($error['message'])) {
101 101
 			$text = $_POST['comment'];
102 102
             $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)");
103 103
 			$stmt->bindParam(":id", $_user['username']);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']);
109 109
 
110
-            if(@$_SESSION['siteusername'] != $_user['username']) { 
110
+            if (@$_SESSION['siteusername'] != $_user['username']) { 
111 111
                 $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']);
112 112
             }
113 113
         }
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
 		<link rel="stylesheet" href="/yt/cssbin/www-extra.css">
142 142
 		<style>
143 143
 			#content-container {
144
-				background-color: <?php echo $_user['primary_color'];  ?>;
144
+				background-color: <?php echo $_user['primary_color']; ?>;
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']) {
148
+					switch ($_user['2012_bgoption']) {
149 149
 						case "stretch":
150 150
 						echo "background-size: cover;";
151 151
 						break;
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 			<div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div>
179 179
 			<div id="content-container">
180 180
 				<!-- begin content -->
181
-				<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
181
+				<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?>
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'])))
185
+					if (empty(trim($_user['bio'])))
186 186
 						$_user['bio'] = "This user has no description.";
187 187
 				?>
188 188
 				<div id="content">
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
238 238
 											</div>
239 239
 											<div class="upper-left-section enable-fancy-subscribe-button">
240
-											<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
240
+											<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
241 241
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
242 242
 														<button 
243 243
 															href="#" 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 															title="" 
246 246
 															id="subscribe-button"
247 247
 															type="button" 
248
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
248
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
249 249
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
250 250
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
251 251
 														<span class="subscribed-label">Subscribed</span>
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 												<?php } else { ?>
262 262
 
263 263
 												<?php } ?>
264
-												<?php if($__user_h->if_partner($_user['username'])) { ?>
264
+												<?php if ($__user_h->if_partner($_user['username'])) { ?>
265 265
 													<img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png">
266 266
 												<?php } ?>
267 267
 											</div>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 									</div>
320 320
 								</div>
321 321
 							</div>
322
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
322
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
323 323
 							<div id="branded-page-body">
324 324
 								<div class="channel-tab-content channel-layout-two-column selected blogger-template"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_discussion.php"); ?></div>
325 325
 							</div>
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,11 +13,13 @@  discard block
 block discarded – undo
13 13
 <?php $__db_h = new db_helper(); ?>
14 14
 <?php $__time_h = new time_helper(); ?>
15 15
 <?php
16
-	if(isset($_SESSION['siteusername']))
17
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
16
+	if(isset($_SESSION['siteusername'])) {
17
+		    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
18
+	}
18 19
 
19
-    if(!$__user_h->user_exists($_GET['n']))
20
-        header("Location: /?userdoesntexist");
20
+    if(!$__user_h->user_exists($_GET['n'])) {
21
+            header("Location: /?userdoesntexist");
22
+    }
21 23
 
22 24
     $_user = $__user_h->fetch_user_username($_GET['n']);
23 25
 
@@ -40,10 +42,11 @@  discard block
 block discarded – undo
40 42
     
41 43
         if (
42 44
               ctype_xdigit($colorCode) &&
43
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
44
-                   return true;
45
-    
46
-        else return false;
45
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
46
+                           return true;
47
+        } else {
48
+            return false;
49
+        }
47 50
     }
48 51
 
49 52
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
@@ -76,8 +79,9 @@  discard block
 block discarded – undo
76 79
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
77 80
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
78 81
 
79
-	if(isset($_SESSION['siteusername']))
80
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
82
+	if(isset($_SESSION['siteusername'])) {
83
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
84
+	}
81 85
 
82 86
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
83 87
         $error = array();
@@ -146,8 +150,9 @@  discard block
 block discarded – undo
146 150
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
147 151
 				<?php } ?> 
148 152
 				<?php
149
-					if(empty(trim($_user['bio'])))
150
-						$_user['bio'] = "This user has no description.";
153
+					if(empty(trim($_user['bio']))) {
154
+											$_user['bio'] = "This user has no description.";
155
+					}
151 156
 				?>
152 157
 				<div id="content">
153 158
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
Please login to merge, or discard this patch.
web/public/s/mod/channel_discussion.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 												<div class="module-view other-channels-view">
216 216
 													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
217 217
 													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
218
-														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
-													} ?>
218
+                                                        echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
219
+                                                    } ?>
220 220
 													<ul class="channel-summary-list ">
221 221
 														<?php 
222
-															foreach($_user['featured_channels'] as $user) {
223
-																if($__user_h->user_exists($user)) {
224
-														?>
222
+                                                            foreach($_user['featured_channels'] as $user) {
223
+                                                                if($__user_h->user_exists($user)) {
224
+                                                        ?>
225 225
 															<li class="yt-tile-visible yt-uix-tile">
226 226
 																<div class="channel-summary clearfix channel-summary-compact">
227 227
 																	<div class="channel-summary-thumb">
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 											</div>
246 246
 
247 247
 											<?php 
248
-												$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
-												$stmt->bindParam(":search", $_user['username']);
250
-												$stmt->execute();
248
+                                                $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10");
249
+                                                $stmt->bindParam(":search", $_user['username']);
250
+                                                $stmt->execute();
251 251
 
252
-												if($stmt->rowCount() != 0) {
253
-											?>
252
+                                                if($stmt->rowCount() != 0) {
253
+                                            ?>
254 254
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
255 255
 													<div class="module-view gh-featured">
256 256
 														<h2>Featured Playlists</h2>     
257 257
 														<?php
258
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
-															$playlist['videos'] = json_decode($playlist['videos']);
260
-														?> 
258
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
259
+                                                            $playlist['videos'] = json_decode($playlist['videos']);
260
+                                                        ?> 
261 261
 															<div class="playlist yt-tile-visible yt-uix-tile">
262 262
 																<a href="/view_playlist?v=<?php echo $playlist['rid']; ?>">
263 263
 																<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   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
                                                     <div class="activity-feed">
26 26
                                                         <div class="feed-list-container">
27 27
                                                             <div class="feed-item-list">
28
-                                                            <?php if(isset($_SESSION['siteusername'])) { ?>
28
+                                                            <?php if (isset($_SESSION['siteusername'])) { ?>
29 29
                                                             <form method="post" action="/d/comment_profile?u=<?php echo htmlspecialchars($_user['username']); ?>">
30 30
                                                                 <img style="width: 50px;" src="">
31 31
                                                                 <textarea style="resize:none;padding:5px;border-radius:5px;background-color:white;border: 1px solid #d3d3d3; width: 577px; resize: none;"cols="32" id="com" placeholder="Share your thoughts" name="comment"></textarea><br>
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
                                                                 $stmt->execute();
42 42
 
43 43
                                                                 $number_of_result = $stmt->rowCount();
44
-                                                                $number_of_page = ceil ($number_of_result / $results_per_page);  
44
+                                                                $number_of_page = ceil($number_of_result/$results_per_page);  
45 45
 
46
-                                                                if (!isset ($_GET['page']) ) {  
46
+                                                                if (!isset ($_GET['page'])) {  
47 47
                                                                     $page = 1;  
48 48
                                                                 } else {  
49
-                                                                    $page = (int)$_GET['page'];  
49
+                                                                    $page = (int) $_GET['page'];  
50 50
                                                                 }  
51 51
 
52
-                                                                $page_first_result = ($page - 1) * $results_per_page;  
52
+                                                                $page_first_result = ($page - 1)*$results_per_page;  
53 53
 
54 54
                                                                 $stmt = $__db->prepare("SELECT * FROM profile_comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
55 55
                                                                 $stmt->bindParam(":rid", $_user['username']);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                                                                 $stmt->bindParam(":pper", $results_per_page);
58 58
                                                                 $stmt->execute();
59 59
 
60
-                                                                while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
60
+                                                                while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
61 61
 
62 62
                                                             ?>
63 63
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                                                                                     <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
77 77
                                                                                     </span>
78 78
                                                                                     </span></span>
79
-                                                                                    <?php if($comment['likes'] != 0) { ?>
79
+                                                                                    <?php if ($comment['likes'] != 0) { ?>
80 80
                                                                                     <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
81 81
                                                                                         <?php echo $comment['likes']; ?>
82 82
                                                                                         <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                                                                                     </button>
105 105
                                                                                 </span>
106 106
                                                                             </div>
107
-                                                                        <?php if(isset($_SESSION['siteusername'])) { ?> 
107
+                                                                        <?php if (isset($_SESSION['siteusername'])) { ?> 
108 108
                                                                             <li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default  child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>">
109 109
 
110 110
                                                                             <div class="comment-body">
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 														</div>
180 180
 														<hr class="yt-horizontal-rule ">
181 181
 													</div>
182
-													<?php if(!empty($_user['website'])) { ?>
182
+													<?php if (!empty($_user['website'])) { ?>
183 183
 														<div class="user-profile-item">
184 184
 															<div class="yt-c3-profile-custom-url field-container ">
185 185
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 															<h5>Country</h5>
229 229
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
230 230
 														</div>
231
-														<?php if($_user['genre'] != "none") { ?>
231
+														<?php if ($_user['genre'] != "none") { ?>
232 232
 															<div class="user-profile-item ">
233 233
 																<h5>Channel Genre</h5>
234 234
 																<span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span>
@@ -240,16 +240,16 @@  discard block
 block discarded – undo
240 240
 											</div>
241 241
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
242 242
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
243
-												<?php if(count($_user['featured_channels']) != 0) { ?>
243
+												<?php if (count($_user['featured_channels']) != 0) { ?>
244 244
 												<div class="module-view other-channels-view">
245
-													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
246
-													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
245
+													<h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
246
+													<?php if (@$_SESSION['siteusername'] == $_user['username']) { 
247 247
 														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
248 248
 													} ?>
249 249
 													<ul class="channel-summary-list ">
250 250
 														<?php 
251
-															foreach($_user['featured_channels'] as $user) {
252
-																if($__user_h->user_exists($user)) {
251
+															foreach ($_user['featured_channels'] as $user) {
252
+																if ($__user_h->user_exists($user)) {
253 253
 														?>
254 254
 															<li class="yt-tile-visible yt-uix-tile">
255 255
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -278,13 +278,13 @@  discard block
 block discarded – undo
278 278
 												$stmt->bindParam(":search", $_user['username']);
279 279
 												$stmt->execute();
280 280
 
281
-												if($stmt->rowCount() != 0) {
281
+												if ($stmt->rowCount() != 0) {
282 282
 											?>
283 283
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
284 284
 													<div class="module-view gh-featured">
285 285
 														<h2>Featured Playlists</h2>     
286 286
 														<?php
287
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
287
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
288 288
 															$playlist['videos'] = json_decode($playlist['videos']);
289 289
 														?> 
290 290
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/d/comment_profile.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     ]
26 26
 ]; 
27 27
 
28
-if($_SERVER['REQUEST_METHOD'] == 'POST') {
29
-    if(!isset($request->username)){ $request->error->message = "you are not logged in"; $request->error->status = ""; }
30
-    if(!$request->touser){ $request->error->message = "your comment cannot be blank"; $request->error->status = ""; }
31
-    if(strlen($request->touser) > 1000){ $request->error->message = "your comment must be shorter than 1000 characters"; $request->error->status = ""; }
32
-    if($__user_h->if_cooldown($request->username)) { $request->error->message = "You are on a cooldown! Wait for a minute before posting another comment."; $request->error->status = ""; }
28
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
29
+    if (!isset($request->username)) { $request->error->message = "you are not logged in"; $request->error->status = ""; }
30
+    if (!$request->touser) { $request->error->message = "your comment cannot be blank"; $request->error->status = ""; }
31
+    if (strlen($request->touser) > 1000) { $request->error->message = "your comment must be shorter than 1000 characters"; $request->error->status = ""; }
32
+    if ($__user_h->if_cooldown($request->username)) { $request->error->message = "You are on a cooldown! Wait for a minute before posting another comment."; $request->error->status = ""; }
33 33
 
34
-    if($request->error->status == "OK") {
34
+    if ($request->error->status == "OK") {
35 35
         $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:username, :from, :comment)");
36 36
         $stmt->bindParam(":username", $request->touser);
37 37
         $stmt->bindParam(":from", $request->username);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $stmt->execute();
40 40
 
41 41
         $__user_u->update_cooldown_time($request->username, "cooldown_comment");
42
-        if(@$request->username != $_user['author'])
42
+        if (@$request->username != $_user['author'])
43 43
             $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
44 44
         
45 45
         header("Location: /user/" . $request->touser . "/discussion");
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
         $stmt->execute();
40 40
 
41 41
         $__user_u->update_cooldown_time($request->username, "cooldown_comment");
42
-        if(@$request->username != $_user['author'])
43
-            $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
42
+        if(@$request->username != $_user['author']) {
43
+                    $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt");
44
+        }
44 45
         
45 46
         header("Location: /user/" . $request->touser . "/discussion");
46 47
     } else {
Please login to merge, or discard this patch.