Test Failed
Push — main ( 00747d...5f665f )
by chief
03:00
created
web/public/get/accept_friend_request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
 $name = $friend['reciever'];
21 21
 
22
-if($name != $_SESSION['siteusername'] || !isset($_GET['id'])) {
22
+if ($name != $_SESSION['siteusername'] || !isset($_GET['id'])) {
23 23
     die("You are not logged in or you did not put in an argument");
24 24
 }
25 25
 
Please login to merge, or discard this patch.
web/public/s/classes/video_helper.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
         return true;
44 44
     }
45 45
 
46
-	public function __construct($conn){
46
+    public function __construct($conn){
47 47
         $this->__db = $conn;
48
-	}
48
+    }
49 49
 
50 50
     function fetch_video_views(string $id) {
51 51
         $stmt = $this->__db->prepare("SELECT * FROM views WHERE videoid = :id");
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,14 +12,22 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) {
14 14
         $fullcmd = $cmd;
15
-        if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
-        if($mergestderror) $fullcmd .= " 2>&1";
15
+        if(strlen($outputfile) > 0) {
16
+            $fullcmd .= " >> " . $outputfile;
17
+        }
18
+        if($mergestderror) {
19
+            $fullcmd .= " 2>&1";
20
+        }
17 21
         
18 22
         if($bg) {
19 23
             $fullcmd = "nohup " . $fullcmd . " &";
20
-            if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
24
+            if(strlen($pidfile)) {
25
+                $fullcmd .= " echo $! > " . $pidfile;
26
+            }
21 27
         } else {
22
-            if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
28
+            if(strlen($pidfile) > 0) {
29
+                $fullcmd .= "; echo $$ > " . $pidfile;
30
+            }
23 31
         }
24 32
         shell_exec($fullcmd);
25 33
     }
@@ -34,8 +42,7 @@  discard block
 block discarded – undo
34 42
             }
35 43
     
36 44
             fclose($handle);
37
-        }
38
-        catch(Exception $e) {
45
+        } catch(Exception $e) {
39 46
             trigger_error("file_get_contents_chunked::" . $e->getMessage(),E_USER_NOTICE);
40 47
             return false;
41 48
         }
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) {
14 14
         $fullcmd = $cmd;
15
-        if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
-        if($mergestderror) $fullcmd .= " 2>&1";
15
+        if (strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile;
16
+        if ($mergestderror) $fullcmd .= " 2>&1";
17 17
         
18
-        if($bg) {
18
+        if ($bg) {
19 19
             $fullcmd = "nohup " . $fullcmd . " &";
20
-            if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
20
+            if (strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile;
21 21
         } else {
22
-            if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
22
+            if (strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile;
23 23
         }
24 24
         shell_exec($fullcmd);
25 25
     }
@@ -29,21 +29,21 @@  discard block
 block discarded – undo
29 29
             $handle = fopen($file, "r");
30 30
             $i = 0;
31 31
             while (!feof($handle)) {
32
-                call_user_func_array($callback,array(fread($handle,$chunk_size),&$handle,$i));
32
+                call_user_func_array($callback, array(fread($handle, $chunk_size), &$handle, $i));
33 33
                 $i++;
34 34
             }
35 35
     
36 36
             fclose($handle);
37 37
         }
38
-        catch(Exception $e) {
39
-            trigger_error("file_get_contents_chunked::" . $e->getMessage(),E_USER_NOTICE);
38
+        catch (Exception $e) {
39
+            trigger_error("file_get_contents_chunked::" . $e->getMessage(), E_USER_NOTICE);
40 40
             return false;
41 41
         }
42 42
 
43 43
         return true;
44 44
     }
45 45
 
46
-	public function __construct($conn){
46
+	public function __construct($conn) {
47 47
         $this->__db = $conn;
48 48
 	}
49 49
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $stmt->execute();
62 62
         
63 63
         $views = 0;
64
-        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
64
+        while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
65 65
             $views = $views + $this->fetch_video_views($video['rid']);
66 66
         }
67 67
         return $views;
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
             for ($i = 0; $i < $timesc; $i++) {
86 86
                 $remaining = $timesc - $i - 1;
87 87
                 if ($i < $timesc - 1) {
88
-                    $final.=$times[$i].'*'.(60 ** $remaining).'+';
88
+                    $final .= $times[$i] . '*' . (60 ** $remaining) . '+';
89 89
                 } else {
90
-                    $final.=$times[$i];
90
+                    $final .= $times[$i];
91 91
                 }
92 92
             }
93 93
         } else {
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
     function shorten_description(string $description, int $limit, bool $newlines = false) {
100 100
         $description = trim($description);
101
-        if(strlen($description) >= $limit) {
101
+        if (strlen($description) >= $limit) {
102 102
             $description = substr($description, 0, $limit) . "...";
103 103
         } 
104 104
 
105 105
         $description = htmlspecialchars($description);
106
-        if($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
106
+        if ($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); }
107 107
         $description = preg_replace("/@([a-zA-Z0-9-]+|\\+\\])/", "<a href='/user/$1'>@$1</a>", $description);
108 108
         $description = preg_replace("/((\d{1,2}:)+\d{2})/", "<a onclick=\"yt.www.watch.player.seekTo('$1', false)\">$1</a>", $description);
109 109
         return $description;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     }
119 119
 
120 120
     function get_video_likes($reciever, $liked) {
121
-        if($liked) {
121
+        if ($liked) {
122 122
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE reciever = :reciever AND type = 'l'");
123 123
             $stmt->bindParam(":reciever", $reciever);
124 124
             $stmt->execute();
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $stmt->bindParam(":viewer", $user);
139 139
         $stmt->bindParam(":rid", $vidid);
140 140
         $stmt->execute();
141
-        if($stmt->rowCount() === 0) {
141
+        if ($stmt->rowCount() === 0) {
142 142
             $this->add_view($vidid, $user);
143 143
         }
144 144
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     }
152 152
 
153 153
     function get_comment_likes($reciever, $liked) {
154
-        if($liked) {
154
+        if ($liked) {
155 155
             $stmt = $this->__db->prepare("SELECT `sender` FROM comment_likes WHERE reciever = :reciever AND type = 'l'");
156 156
             $stmt->bindParam(":reciever", $reciever);
157 157
             $stmt->execute();
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 
169 169
     function if_liked($user, $reciever, $liked) {
170
-        if($liked) {
170
+        if ($liked) {
171 171
             $stmt = $this->__db->prepare("SELECT `sender` FROM likes WHERE sender = :sender AND reciever = :reciever AND type = 'l'");
172 172
             $stmt->bindParam(":sender", $user);
173 173
             $stmt->bindParam(":reciever", $reciever);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     }
186 186
 
187 187
     function if_comment_liked($user, $reciever, $liked) {
188
-        if($liked) {
188
+        if ($liked) {
189 189
             $stmt = $this->__db->prepare("SELECT `sender` FROM comment_likes WHERE sender = :sender AND reciever = :reciever AND type = 'l'");
190 190
             $stmt->bindParam(":sender", $user);
191 191
             $stmt->bindParam(":reciever", $reciever);
Please login to merge, or discard this patch.
web/public/get/like_video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
21 21
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
22 22
     $stmt->execute(array(
23
-      ':username' => $_SESSION['siteusername'],
24
-      ':reciever' => $name,
23
+        ':username' => $_SESSION['siteusername'],
24
+        ':reciever' => $name,
25 25
     ));
26 26
     header('Location: ' . $_SERVER['HTTP_REFERER']);
27 27
 }
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
34 34
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
35 35
     $stmt->execute(array(
36
-      ':username' => $_SESSION['siteusername'],
37
-      ':reciever' => $name,
36
+        ':username' => $_SESSION['siteusername'],
37
+        ':reciever' => $name,
38 38
     ));
39 39
     header('Location: ' . $_SERVER['HTTP_REFERER']);
40 40
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 $stmt->bindParam(":username", $_SESSION['siteusername']);
18 18
 $stmt->bindParam(":reciever", $name);
19 19
 $stmt->execute();
20
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
20
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
21 21
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
22 22
     $stmt->execute(array(
23 23
       ':username' => $_SESSION['siteusername'],
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $stmt->bindParam(":username", $_SESSION['siteusername']);
31 31
 $stmt->bindParam(":reciever", $name);
32 32
 $stmt->execute();
33
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
33
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
34 34
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
35 35
     $stmt->execute(array(
36 36
       ':username' => $_SESSION['siteusername'],
Please login to merge, or discard this patch.
web/public/get/dislike_video.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 <?php
14 14
 $name = $_GET['v'];
15 15
 
16
-if(!isset($_SESSION['siteusername']) || !isset($_GET['v'])) {
16
+if (!isset($_SESSION['siteusername']) || !isset($_GET['v'])) {
17 17
     header('Location: ' . $_SERVER['HTTP_REFERER']);
18 18
 }
19 19
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $stmt->bindParam(":username", $_SESSION['siteusername']);
22 22
 $stmt->bindParam(":reciever", $name);
23 23
 $stmt->execute();
24
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
24
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
25 25
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
26 26
     $stmt->execute(array(
27 27
       ':username' => $_SESSION['siteusername'],
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $stmt->bindParam(":username", $_SESSION['siteusername']);
35 35
 $stmt->bindParam(":reciever", $name);
36 36
 $stmt->execute();
37
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
37
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
38 38
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
39 39
     $stmt->execute(array(
40 40
       ':username' => $_SESSION['siteusername'],
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
21 21
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
22 22
     $stmt->execute(array(
23
-      ':username' => $_SESSION['siteusername'],
24
-      ':reciever' => $name,
23
+        ':username' => $_SESSION['siteusername'],
24
+        ':reciever' => $name,
25 25
     ));
26 26
     header('Location: ' . $_SERVER['HTTP_REFERER']);
27 27
 }
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
34 34
     $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever");
35 35
     $stmt->execute(array(
36
-      ':username' => $_SESSION['siteusername'],
37
-      ':reciever' => $name,
36
+        ':username' => $_SESSION['siteusername'],
37
+        ':reciever' => $name,
38 38
     ));
39 39
     header('Location: ' . $_SERVER['HTTP_REFERER']);
40 40
 }
Please login to merge, or discard this patch.
web/public/get/delete_playlist.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php $playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?>
14 14
 <?php
15
-if($playlist['author'] == $_SESSION['siteusername']) {
15
+if ($playlist['author'] == $_SESSION['siteusername']) {
16 16
     $stmt = $__db->prepare("DELETE FROM playlists WHERE rid=:rid AND author=:author");
17 17
     $stmt->execute(array(
18 18
         ':author' => $_SESSION['siteusername'],
Please login to merge, or discard this patch.
web/public/channel_videos.php 3 patches
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,11 +15,13 @@  discard block
 block discarded – undo
15 15
 <?php $__db_h = new db_helper(); ?>
16 16
 <?php $__time_h = new time_helper(); ?>
17 17
 <?php
18
-	if(isset($_SESSION['siteusername']))
19
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
18
+	if(isset($_SESSION['siteusername'])) {
19
+		    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
20
+	}
20 21
 
21
-    if(!$__user_h->user_exists($_GET['n']))
22
-        header("Location: /?userdoesntexist");
22
+    if(!$__user_h->user_exists($_GET['n'])) {
23
+            header("Location: /?userdoesntexist");
24
+    }
23 25
 
24 26
     $_user = $__user_h->fetch_user_username($_GET['n']);
25 27
 
@@ -42,10 +44,11 @@  discard block
 block discarded – undo
42 44
     
43 45
         if (
44 46
               ctype_xdigit($colorCode) &&
45
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
46
-                   return true;
47
-    
48
-        else return false;
47
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
48
+                           return true;
49
+        } else {
50
+            return false;
51
+        }
49 52
     }
50 53
 
51 54
     $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']);
@@ -77,8 +80,9 @@  discard block
 block discarded – undo
77 80
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
78 81
     if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; }
79 82
 
80
-	if(isset($_SESSION['siteusername']))
81
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
83
+	if(isset($_SESSION['siteusername'])) {
84
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
85
+	}
82 86
 
83 87
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
84 88
         $error = array();
Please login to merge, or discard this patch.
Indentation   +59 added lines, -59 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>
@@ -346,19 +346,19 @@  discard block
 block discarded – undo
346 346
                                             <div class="channel-filtered-content">
347 347
                                                 <ol class="channel-videos-list">
348 348
 													<?php
349
-														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350
-														$stmt->bindParam(":username", $_user['username']);
351
-														$stmt->execute();
352
-														if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
349
+                                                        $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350
+                                                        $stmt->bindParam(":username", $_user['username']);
351
+                                                        $stmt->execute();
352
+                                                        if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
353 353
 
354
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355
-															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356
-															$video['duration'] = $__time_h->timestamp($video['duration']);
357
-															$video['views'] = $__video_h->fetch_video_views($video['rid']);
358
-															$video['author'] = htmlspecialchars($video['author']);		
359
-															$video['title'] = htmlspecialchars($video['title']);
360
-															$video['description'] = $__video_h->shorten_description($video['description'], 50);
361
-													?>
354
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355
+                                                            $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356
+                                                            $video['duration'] = $__time_h->timestamp($video['duration']);
357
+                                                            $video['views'] = $__video_h->fetch_video_views($video['rid']);
358
+                                                            $video['author'] = htmlspecialchars($video['author']);		
359
+                                                            $video['title'] = htmlspecialchars($video['title']);
360
+                                                            $video['description'] = $__video_h->shorten_description($video['description'], 50);
361
+                                                    ?>
362 362
                                                     <li class="yt-c3-grid-item">
363 363
                                                         <a href="/watch?v=<?php echo htmlspecialchars($video['rid']); ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="feature=plcp&amp;context=C4e80d7cVDvjVQa1PpcFPHxNkhfeSQg8_nJHnhVurQf82C2OenNiw%3D"><span class="video-thumb ux-thumb yt-thumb-default-234 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" width="234"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
364 364
                                                         <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="yBlvNSfqAj0" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 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,7 +178,7 @@  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
 				<div id="content">
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 												<h1><?php echo htmlspecialchars($_user['username']); ?></h1>
234 234
 											</div>
235 235
 											<div class="upper-left-section enable-fancy-subscribe-button">
236
-											<?php if($_user['username'] != @$_SESSION['siteusername']) { ?>
236
+											<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?>
237 237
 													<div class="yt-subscription-button-hovercard yt-uix-hovercard">
238 238
 														<button 
239 239
 															href="#" 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 															title="" 
242 242
 															id="subscribe-button"
243 243
 															type="button" 
244
-															class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
244
+															class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?>  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
245 245
 															role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" 
246 246
 															src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span>
247 247
 														<span class="subscribed-label">Subscribed</span>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 												<?php } else { ?>
258 258
 
259 259
 												<?php } ?>
260
-												<?php if($__user_h->if_partner($_user['username'])) { ?>
260
+												<?php if ($__user_h->if_partner($_user['username'])) { ?>
261 261
 													<img style="width: 29px;vertical-align: middle;margin-left: 10px;" title="This user is a SubRocks partner" src="/yt/imgbin/RenderedImage.png">
262 262
 												<?php } ?>
263 263
 											</div>
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 									</div>
316 316
 								</div>
317 317
 							</div>
318
-                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
318
+                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?>
319 319
 							<div id="branded-page-body">
320 320
                                 <div class="channel-tab-content channel-layout-full-width">
321 321
                                     <div class="tab-content-body">
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 														$stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC");
350 350
 														$stmt->bindParam(":username", $_user['username']);
351 351
 														$stmt->execute();
352
-														if($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
352
+														if ($stmt->rowCount() == 0) { echo '<span style="font-size:11px;color:grey;">This user has no videos uploaded.</span>'; }
353 353
 
354
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
354
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
355 355
 															$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
356 356
 															$video['duration'] = $__time_h->timestamp($video['duration']);
357 357
 															$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/watch_ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
40 40
                     $stmt->bindParam(":username", $_video['author']);
41 41
                     $stmt->execute();
42
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
42
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
43 43
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
44 44
                         $video['duration'] = $__time_h->timestamp($video['duration']);
45 45
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/comment_ajax.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
         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; }
27 27
 
28 28
         if(!isset($error['message'])) {
29
-			$text = $_POST['comment'];
29
+            $text = $_POST['comment'];
30 30
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
31 31
             $stmt->bindParam(":v", $_GET['v']);
32
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
33
-			$stmt->bindParam(":comment", $text);
32
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
33
+            $stmt->bindParam(":comment", $text);
34 34
             $stmt->execute();
35 35
 
36
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
36
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
37 37
         }
38 38
 
39 39
         die(json_encode($request));
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
13
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14 14
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
15 15
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
16 16
 <?php
17
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
17
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18 18
         $error = array();
19 19
         $request = (object) [
20 20
             "status" => "success"
21 21
         ];
22 22
 
23
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
24
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
25
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
26
-        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; }
23
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
24
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
25
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
26
+        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; }
27 27
 
28
-        if(!isset($error['message'])) {
28
+        if (!isset($error['message'])) {
29 29
 			$text = $_POST['comment'];
30 30
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
31 31
             $stmt->bindParam(":v", $_GET['v']);
Please login to merge, or discard this patch.
web/public/playlists.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@
 block discarded – undo
26 26
         if(!isset($error['message'])) {
27 27
             $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_';
28 28
             $result = '';
29
-            for ($i = 0; $i < 11; $i++)
30
-                $rid .= $characters[mt_rand(0, 63)];
29
+            for ($i = 0; $i < 11; $i++) {
30
+                            $rid .= $characters[mt_rand(0, 63)];
31
+            }
31 32
             $stmt = $__db->prepare("INSERT INTO playlists (title, description, rid, author) VALUES (:title, :desc, :rid, :username)");
32 33
             $stmt->bindParam(":title", $_POST['title']);
33 34
             $stmt->bindParam(":desc", $_POST['comment']);
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@
 block discarded – undo
37 37
     }
38 38
 ?>
39 39
 <?php
40
-	$__server->page_embeds->page_title = "SubRocks - Your Playlists";
41
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
42
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
43
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
40
+    $__server->page_embeds->page_title = "SubRocks - Your Playlists";
41
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
42
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
43
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
44 44
 ?>
45 45
 <!DOCTYPE html>
46 46
 <html dir="ltr">
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
 <?php $__user_u = new user_update($__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
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
13
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
14 14
         $error = array();
15 15
 
16
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; }
17
-        if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
-        if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
16
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; }
17
+        if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
18
+        if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; }
19
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
20
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; }
21 21
 
22
-        if(!isset($error['message'])) {
22
+        if (!isset($error['message'])) {
23 23
             $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_';
24 24
             $result = '';
25 25
             for ($i = 0; $i < 11; $i++)
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
                                 <?php
200 200
 
201 201
                                     $number_of_result = $stmt->rowCount();
202
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
202
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
203 203
 
204
-                                    if (!isset ($_GET['page']) ) {  
204
+                                    if (!isset ($_GET['page'])) {  
205 205
                                         $page = 1;  
206 206
                                     } else {  
207
-                                        $page = (int)$_GET['page'];  
207
+                                        $page = (int) $_GET['page'];  
208 208
                                     }  
209 209
 
210
-                                    $page_first_result = ($page - 1) * $results_per_page;  
210
+                                    $page_first_result = ($page - 1)*$results_per_page;  
211 211
                                 ?>
212 212
                                 <?php 
213 213
                                     $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper");
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
                                     </tr>
249 249
                                     
250 250
                                     <?php
251
-                                        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
251
+                                        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
252 252
                                             $playlist['videos'] = json_decode($playlist['videos']);
253
-                                            if($__video_h->video_exists(@$playlist['videos'][0])) {
254
-                                                if(count($playlist['videos']) != 0) {
253
+                                            if ($__video_h->video_exists(@$playlist['videos'][0])) {
254
+                                                if (count($playlist['videos']) != 0) {
255 255
                                                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
256 256
                                                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
257 257
                                                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                                     </div>
334 334
                                 </center>
335 335
                                         
336
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
336
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
337 337
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button>
338 338
                                 <?php } ?>   
339 339
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                                 </script>
380 380
 
381 381
                                 <?php 
382
-                                    if($stmt6->rowCount() == 0) { echo "
382
+                                    if ($stmt6->rowCount() == 0) { echo "
383 383
                                         <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br>
384 384
                                     "; 
385 385
                                 } ?>
Please login to merge, or discard this patch.