Test Failed
Pull Request — main (#24)
by
unknown
03:12
created
web/public/comment_voting.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
17
+if (!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18 18
     header('Location: ' . $_SERVER['HTTP_REFERER']); 
19 19
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
20
+if (isset($_GET['a']) && $_GET['a'] == "-1") 
21 21
     $request->action = "d";
22 22
 
23 23
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 24
 $stmt->bindParam(":username", $_SESSION['siteusername']);
25 25
 $stmt->bindParam(":reciever", $request->comment_id);
26 26
 $stmt->execute();
27
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
27
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28 28
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
29 29
     $stmt->execute(array(
30 30
         ':username' => $_SESSION['siteusername'],
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $stmt->bindParam(":username", $_SESSION['siteusername']);
38 38
 $stmt->bindParam(":reciever", $request->comment_id);
39 39
 $stmt->execute();
40
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
40
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
41 41
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
42 42
     $stmt->execute(array(
43 43
         ':username' => $_SESSION['siteusername'],
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     header('Location: ' . $_SERVER['HTTP_REFERER']);
47 47
 }
48 48
 
49
-if($request->action == "l") {
49
+if ($request->action == "l") {
50 50
     $stmt = $__db->prepare("INSERT INTO comment_likes (sender, reciever, type) VALUES (:sender, :reciever, 'l')");
51 51
     $stmt->bindParam(":sender", $_SESSION['siteusername']);
52 52
     $stmt->bindParam(":reciever", $request->comment_id);
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,13 @@
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18
-    header('Location: ' . $_SERVER['HTTP_REFERER']); 
17
+if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) {
18
+    header('Location: ' . $_SERVER['HTTP_REFERER']);
19
+}
19 20
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
21
+if(isset($_GET['a']) && $_GET['a'] == "-1") {
21 22
     $request->action = "d";
23
+}
22 24
 
23 25
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 26
 $stmt->bindParam(":username", $_SESSION['siteusername']);
Please login to merge, or discard this patch.
web/public/upload.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
  
3 3
 if (empty($_FILES) || $_FILES["file"]["error"]) {
4
-  die('{"OK": 0}');
4
+    die('{"OK": 0}');
5 5
 }
6 6
  
7 7
 $fileName = $_FILES["file"]["name"];
Please login to merge, or discard this patch.
web/public/comment_service_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@  discard block
 block discarded – undo
14 14
 <?php
15 15
 $_video = $__video_h->fetch_video_rid($_SESSION['current_video']);
16 16
 
17
-if($_SERVER['REQUEST_METHOD'] == 'POST') {
17
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18 18
     $error = array();
19 19
 
20
-    if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
21
-    if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
-    if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
-    if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
20
+    if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
21
+    if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
+    if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
+    if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
24 24
 
25
-    if(!isset($error['message'])) {
25
+    if (!isset($error['message'])) {
26 26
         $text = $_POST['comment'];
27 27
         $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
         $stmt->bindParam(":v", $_SESSION['current_video']);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 header("Content-type: text/xml");
39 39
 // ugly solution
40
-if(!isset($error['status'])) {
40
+if (!isset($error['status'])) {
41 41
     $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="420" data-score="0"><div class="comment-body"><div class="content-container"><div class="content"><div class="comment-text" dir="ltr"><p>' . $__video_h->shorten_description($_POST['comment'], 2048, true) . '</p></div><p class="metadata"><span class="author "><a href="/user/' . htmlspecialchars($_SESSION['siteusername']) . '" class="yt-uix-sessionlink yt-user-name " data-sessionlink="' . htmlspecialchars($_SESSION['siteusername']) . '" dir="ltr">' . htmlspecialchars($_SESSION['siteusername']) . '</a></span><span class="time" dir="ltr"><span dir="ltr">just now<span></span></span></span></p></div><div class="comment-actions"><span class="yt-uix-button-group"><button type="button" class="start comment-action-vote-up comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Up" data-action="vote-up" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-up" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Up"><span class="yt-valign-trick"></span></span></button><button type="button" class="end comment-action-vote-down comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Down" data-action="vote-down" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-down" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Down"><span class="yt-valign-trick"></span></span></button></span><span class="yt-uix-button-group"><!--<button type="button" class="start comment-action yt-uix-button yt-uix-button-default" onclick=";return false;" data-action="reply" role="button"><span class="yt-uix-button-content">Reply </span></button>--><button type="button" class="end flip yt-uix-button yt-uix-button-default yt-uix-button-empty" onclick=";return false;" data-button-has-sibling-menu="true" role="button" aria-pressed="false" aria-expanded="false" aria-haspopup="true" aria-activedescendant=""><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""><div class=" yt-uix-button-menu yt-uix-button-menu-default" style="display: none;"><ul><li class="comment-action" data-action="share"><span class="yt-uix-button-menu-item">Share</span></li><li class="comment-action-remove comment-action" data-action="remove"><span class="yt-uix-button-menu-item">Remove</span></li><li class="comment-action" data-action="flag"><span class="yt-uix-button-menu-item">Flag for spam</span></li><li class="comment-action-block comment-action" data-action="block"><span class="yt-uix-button-menu-item">Block User</span></li><li class="comment-action-unblock comment-action" data-action="unblock"><span class="yt-uix-button-menu-item">Unblock User</span></li></ul></div></button></span></div></div></div></li>]]></html_content><return_code><![CDATA[0]]></return_code></root>';
42 42
 } else {
43 43
     $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"></div><div class="yt-alert-buttons"></div><div class="yt-alert-content" role="alert"><span class="yt-alert-vertical-trick"></span><div class="yt-alert-message">You are under a cooldown!</div></div></div>]]></html_content><return_code><![CDATA[0]]></return_code></root>';
Please login to merge, or discard this patch.
web/public/playlists_ajax.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,36 +8,36 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ob_start(); ?>
10 10
 <?php
11
-   $request = (object) [
12
-      "search_term"      => $_SESSION['siteusername'],
13
-      "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
-      "search_amount"    => 0 /* [fallback] */
15
-   ];
11
+    $request = (object) [
12
+        "search_term"      => $_SESSION['siteusername'],
13
+        "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
+        "search_amount"    => 0 /* [fallback] */
15
+    ];
16 16
 
17
-   $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
-   $stmt->bindParam(":search", $request->like_search_term);
19
-   $stmt->execute(); 
20
-   $request->search_amount = $stmt->rowCount();
17
+    $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
+    $stmt->bindParam(":search", $request->like_search_term);
19
+    $stmt->execute(); 
20
+    $request->search_amount = $stmt->rowCount();
21 21
 
22
-   $results_per_page = 12;
23
-   $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
22
+    $results_per_page = 12;
23
+    $number_of_result = $request->search_amount;
24
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
27
-       $page = 1;  
28
-   } else {  
29
-       $page = (int)$_GET['page'];  
30
-   }  
26
+    if (!isset ($_GET['page']) ) {  
27
+        $page = 1;  
28
+    } else {  
29
+        $page = (int)$_GET['page'];  
30
+    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+    $page_first_result = ($page - 1) * $results_per_page;  
33 33
 
34
-   $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
-   $stmt6->bindParam(":search", $request->like_search_term);
36
-   $stmt6->bindParam(":pfirst", $page_first_result);
37
-   $stmt6->bindParam(":pper", $results_per_page);
38
-   $stmt6->execute();
34
+    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
+    $stmt6->bindParam(":search", $request->like_search_term);
36
+    $stmt6->bindParam(":pfirst", $page_first_result);
37
+    $stmt6->bindParam(":pper", $results_per_page);
38
+    $stmt6->execute();
39 39
 
40
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
40
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
41 41
 ?>               
42 42
 <table style="width: 100%;">
43 43
     <tr>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
 
22 22
    $results_per_page = 12;
23 23
    $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
24
+   $number_of_page = ceil($number_of_result/$results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
26
+   if (!isset ($_GET['page'])) {  
27 27
        $page = 1;  
28 28
    } else {  
29
-       $page = (int)$_GET['page'];  
29
+       $page = (int) $_GET['page'];  
30 30
    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+   $page_first_result = ($page - 1)*$results_per_page;  
33 33
 
34 34
    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35 35
    $stmt6->bindParam(":search", $request->like_search_term);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
     </tr>
51 51
     
52 52
     <?php
53
-        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
53
+        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
54 54
             $playlist['videos'] = json_decode($playlist['videos']);
55
-            if($__video_h->video_exists(@$playlist['videos'][0])) {
56
-                if(count($playlist['videos']) != 0) {
55
+            if ($__video_h->video_exists(@$playlist['videos'][0])) {
56
+                if (count($playlist['videos']) != 0) {
57 57
                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
58 58
                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
59 59
                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
Please login to merge, or discard this patch.
web/public/d/channel_update.php 2 patches
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
16 16
     }
17 17
 
18
-        if(isset($_POST['layout'])) { 
18
+        if (isset($_POST['layout'])) { 
19 19
             $stmt = $__db->prepare("UPDATE users SET layout = :layout WHERE username = :username");
20 20
             $stmt->bindParam(":layout", $_POST['layout']);
21 21
             $stmt->bindParam(":username", $_SESSION['siteusername']);
22 22
             $stmt->execute();
23 23
         }
24 24
 
25
-        if(isset($_POST['left'])) {
25
+        if (isset($_POST['left'])) {
26 26
             $clean = $_POST['left'];
27 27
             $stmt = $__db->prepare("UPDATE users SET 2009_user_left = :clean WHERE username = :username");
28 28
             $stmt->bindParam(":clean", $clean);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             $stmt->execute();
31 31
         }
32 32
 
33
-        if(isset($_POST['right'])) {
33
+        if (isset($_POST['right'])) {
34 34
             $clean = $_POST['right'];
35 35
             $stmt = $__db->prepare("UPDATE users SET 2009_user_right = :clean WHERE username = :username");
36 36
             $stmt->bindParam(":clean", $clean);
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         }
40 40
 
41 41
 
42
-        if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_GET['n']) {
43
-            if(!empty($_GET["n"]) && $_GET['n'] == "pfp") {
42
+        if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_GET['n']) {
43
+            if (!empty($_GET["n"]) && $_GET['n'] == "pfp") {
44 44
                 $target_dir = "../dynamic/pfp/";
45 45
                 $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION));
46 46
                 $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType;
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
                 $uploadOk = true;
51 51
                 $movedFile = false;
52 52
         
53
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
54
-                    && $imageFileType != "gif" ) {
53
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
54
+                    && $imageFileType != "gif") {
55 55
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
56 56
                     $uploadOk = false;
57 57
                     goto skip;
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
                     }
75 75
                 }
76 76
             }
77
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
78
-            if(!empty($_FILES["backgroundbgset"]["name"])) {
77
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
78
+            if (!empty($_FILES["backgroundbgset"]["name"])) {
79 79
                 $target_dir = "../dynamic/banners/";
80 80
                 $imageFileType = strtolower(pathinfo($_FILES["backgroundbgset"]["name"], PATHINFO_EXTENSION));
81 81
                 $target_name = md5_file($_FILES["backgroundbgset"]["tmp_name"]) . "." . $imageFileType;
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
                 $uploadOk = true;
86 86
                 $movedFile = false;
87 87
     
88
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
89
-                    && $imageFileType != "gif" ) {
88
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
89
+                    && $imageFileType != "gif") {
90 90
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
91 91
                     $uploadOk = false;
92 92
                     goto skip;
93 93
                 }
94 94
     
95
-                if($uploadOk) { 
95
+                if ($uploadOk) { 
96 96
                     if (file_exists($target_file)) {
97 97
                         $movedFile = true;
98 98
                     } else {
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
                     }
109 109
                 }
110 110
             }
111
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
112
-            if(!empty($_FILES["file"]["name"])) {
111
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
112
+            if (!empty($_FILES["file"]["name"])) {
113 113
                 $target_dir = "../dynamic/banners/";
114 114
                 $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION));
115 115
                 $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType;
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
                 $uploadOk = true;
120 120
                 $movedFile = false;
121 121
     
122
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
123
-                    && $imageFileType != "gif" ) {
122
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
123
+                    && $imageFileType != "gif") {
124 124
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
125 125
                     $uploadOk = false;
126 126
                     goto skip;
127 127
                 }
128 128
     
129
-                if($uploadOk) { 
129
+                if ($uploadOk) { 
130 130
                     if (file_exists($target_file)) {
131 131
                         $movedFile = true;
132 132
                     } else {
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
                     }
143 143
                 } 
144 144
             }
145
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
146
-            if(!empty($_FILES["videopagebanner"]["name"])) {
145
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
146
+            if (!empty($_FILES["videopagebanner"]["name"])) {
147 147
                 $target_dir = "/dynamic/subscribe/";
148 148
                 $imageFileType = strtolower(pathinfo($_FILES["videopagebanner"]["name"], PATHINFO_EXTENSION));
149 149
                 $target_name = md5_file($_FILES["videopagebanner"]["tmp_name"]) . "." . $imageFileType;
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
                 $uploadOk = true;
154 154
                 $movedFile = false;
155 155
     
156
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
157
-                    && $imageFileType != "gif" ) {
156
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
157
+                    && $imageFileType != "gif") {
158 158
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
159 159
                     $uploadOk = false;
160 160
                     goto skip;
161 161
                 }
162 162
     
163
-                if($uploadOk) { 
163
+                if ($uploadOk) { 
164 164
                     if (file_exists($target_file)) {
165 165
                         $movedFile = true;
166 166
                     } else {
@@ -178,76 +178,76 @@  discard block
 block discarded – undo
178 178
             }
179 179
         }
180 180
 
181
-        if(!empty($_POST['bio'])) { 
181
+        if (!empty($_POST['bio'])) { 
182 182
             $__user_u->update_row($_SESSION['siteusername'], "bio", $_POST['bio']);
183 183
         }
184 184
 
185
-        if(!empty($_POST['featuredchannels'])) { 
185
+        if (!empty($_POST['featuredchannels'])) { 
186 186
             $__user_u->update_row($_SESSION['siteusername'], "featured_channels", $_POST['featuredchannels']);
187 187
         }
188 188
     
189
-        if(!empty($_POST['css'])) {
189
+        if (!empty($_POST['css'])) {
190 190
             $__user_u->update_row($_SESSION['siteusername'], "css", $_POST['css']);
191 191
         }
192 192
 
193
-        if(!empty($_POST['videoid'])) {
193
+        if (!empty($_POST['videoid'])) {
194 194
             $__user_u->update_row($_SESSION['siteusername'], "featured", $_POST['videoid']);
195 195
         }
196 196
 
197
-        if(!empty($_POST['solidcolor'])) {
197
+        if (!empty($_POST['solidcolor'])) {
198 198
             $__user_u->update_row($_SESSION['siteusername'], "2012_bgoption", $_POST['bgoption']);
199 199
 
200
-            if($_POST['bgoption'] == "solid")
200
+            if ($_POST['bgoption'] == "solid")
201 201
                 $__user_u->update_row($_SESSION['siteusername'], "2009_bg", "");
202 202
 
203 203
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
204 204
         }
205 205
 
206
-        if(!empty($_POST['transparency'])) {
206
+        if (!empty($_POST['transparency'])) {
207 207
             $__user_u->update_row($_SESSION['siteusername'], "transparency", $_POST['transparency']);
208 208
         }
209 209
 
210
-        if(!empty($_POST['genre'])) {
210
+        if (!empty($_POST['genre'])) {
211 211
             $__user_u->update_row($_SESSION['siteusername'], "genre", $_POST['genre']);
212 212
         }
213 213
 
214
-        if(!empty($_POST['bordercolor'])) {
214
+        if (!empty($_POST['bordercolor'])) {
215 215
             $__user_u->update_row($_SESSION['siteusername'], "border_color", $_POST['bordercolor']);
216 216
         }
217 217
 
218
-        if(!empty($_POST['country'])) {
218
+        if (!empty($_POST['country'])) {
219 219
             $__user_u->update_row($_SESSION['siteusername'], "country", $_POST['country']);
220 220
         } // duplicate?
221 221
 
222
-        if(!empty($_POST['header'])) {
222
+        if (!empty($_POST['header'])) {
223 223
             $__user_u->update_row($_SESSION['siteusername'], "custom_header", $_POST['header']);
224 224
         }
225 225
 
226
-        if(!empty($_POST['customtext'])) {
226
+        if (!empty($_POST['customtext'])) {
227 227
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['customtext']);
228 228
         }
229 229
 
230
-        if(!empty($_POST['country'])) {
230
+        if (!empty($_POST['country'])) {
231 231
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['country']);
232 232
         } // duplicate?
233 233
 
234
-        if(!empty($_POST['website'])) {
234
+        if (!empty($_POST['website'])) {
235 235
             $__user_u->update_row($_SESSION['siteusername'], "website", $_POST['website']);
236 236
         }
237 237
     
238
-        if(!empty($_POST['channelboxcolor'])) {
238
+        if (!empty($_POST['channelboxcolor'])) {
239 239
             $__user_u->update_row($_SESSION['siteusername'], "secondary_color", $_POST['channelboxcolor']);
240 240
         }
241 241
 
242
-        if(!empty($_POST['backgroundcolor'])) {
242
+        if (!empty($_POST['backgroundcolor'])) {
243 243
             $__user_u->update_row($_SESSION['siteusername'], "third_color", $_POST['backgroundcolor']);
244 244
         }
245 245
 
246
-        if(!empty($_POST['textmaincolor'])) {
246
+        if (!empty($_POST['textmaincolor'])) {
247 247
             $__user_u->update_row($_SESSION['siteusername'], "primary_color_text", $_POST['textmaincolor']);
248 248
         }
249 249
 
250
-    if(!empty($_POST['bgoptionset'])) {
250
+    if (!empty($_POST['bgoptionset'])) {
251 251
         $bgoption = $_POST['bgoption'];
252 252
         $bgcolor = $_POST['solidcolor'];
253 253
         $default = "default.png";
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         
257 257
         $__user_u->update_row($_SESSION['siteusername'], "2009_bgcolor", $bgcolor);
258 258
 
259
-        if($bgoption == "solid") {
259
+        if ($bgoption == "solid") {
260 260
             $__user_u->update_row($_SESSION['siteusername'], "2009_bg", $default);
261 261
         }
262 262
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -197,8 +197,9 @@
 block discarded – undo
197 197
         if(!empty($_POST['solidcolor'])) {
198 198
             $__user_u->update_row($_SESSION['siteusername'], "2012_bgoption", $_POST['bgoption']);
199 199
 
200
-            if($_POST['bgoption'] == "solid")
201
-                $__user_u->update_row($_SESSION['siteusername'], "2009_bg", "");
200
+            if($_POST['bgoption'] == "solid") {
201
+                            $__user_u->update_row($_SESSION['siteusername'], "2009_bg", "");
202
+            }
202 203
 
203 204
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
204 205
         }
Please login to merge, or discard this patch.
web/public/watch.php 3 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,23 +11,23 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if(isset($_SESSION['siteusername']))
18
+	if (isset($_SESSION['siteusername']))
19 19
 		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
20 20
 
21 21
 	$_SESSION['current_video'] = $_video['rid'];
22
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
22
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
23 23
         $error = array();
24 24
 
25
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
26
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
27
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
28
-        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; }
25
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
26
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
27
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
28
+        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; }
29 29
 
30
-        if(!isset($error['message'])) {
30
+        if (!isset($error['message'])) {
31 31
 			$text = $_POST['comment'];
32 32
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
33 33
             $stmt->bindParam(":v", $_GET['v']);
@@ -84,20 +84,20 @@  discard block
 block discarded – undo
84 84
          if (window.yt.timing) {yt.timing.tick("ct");}    
85 85
       </script>
86 86
 		<?php
87
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
87
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
88 88
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
89 89
 
90
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
91
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
90
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
91
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
92 92
 
93 93
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
94 94
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
95 95
 
96
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
96
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
97 97
 				$_video['likeswidth'] = 0;
98 98
 				$_video['dislikeswidth'] = 0;
99 99
 			} else {
100
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
100
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
101 101
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
102 102
 			}
103 103
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 									</div>
132 132
 									<div id="instream_google_companion_ad_div"></div>
133 133
 								</div>
134
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
134
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
135 135
 									<div id="watch-owner-container">
136 136
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
137 137
 											<ul class="yt-nav-aside">
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 											title="" 
167 167
 											id="subscribe-button"
168 168
 											type="button" 
169
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
169
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
170 170
 											role="button">
171 171
 											<span class="yt-uix-button-icon-wrapper">
172 172
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 											<button onclick=";like_video();return false;"
248 248
 											title="I like this" 
249 249
 											type="button" 
250
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
250
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
251 251
 											id="watch-like"  
252 252
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
253 253
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 											type="button" 
262 262
 											style="margin-left: -2px;"
263 263
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
264
-											class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
264
+											class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
265 265
 											id="watch-unlike" 
266 266
 											role="button">
267 267
 												<span class="yt-uix-button-icon-wrapper">
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 												not implemented ismnf
280 280
 											</div>
281 281
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
282
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
282
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
283 283
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
284 284
 													<div class="yt-alert-icon">
285 285
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 												<?php } else { ?>
296 296
 													<h3>Be friends with the creator</h3>
297 297
 
298
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
298
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
299 299
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
300 300
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
301 301
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 														</span><br><br>
310 310
 													<?php } ?>
311 311
 
312
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
313
-														<?php if($_video['friended'] == false) { ?>
312
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
313
+														<?php if ($_video['friended'] == false) { ?>
314 314
 															<a href="/friends">Send a friend request</a>
315 315
 														<?php } else { ?>
316 316
 															Your friend request is pending.
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 													<?php } ?>
321 321
 													<hr><br>
322 322
 													<h3>Add to Favorites</h3>
323
-													<?php if($_video['favorited'] == false) { ?>
323
+													<?php if ($_video['favorited'] == false) { ?>
324 324
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
325 325
 													<?php } else { ?>
326 326
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -331,10 +331,10 @@  discard block
 block discarded – undo
331 331
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
332 332
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
333 333
 														$stmt->execute();
334
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
334
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
335 335
 															$buffer = json_decode($playlist['videos']);
336 336
 															@$rid = $buffer[0];
337
-															if(!empty($rid)) {
337
+															if (!empty($rid)) {
338 338
 																@$video = $__video_h->fetch_video_rid($rid);
339 339
 															} else {
340 340
 																$video['thumbnail'] = "";
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 												$stmt->execute();
613 613
 											?>
614 614
 
615
-											<?php if($stmt->rowCount() != 0) { ?>
615
+											<?php if ($stmt->rowCount() != 0) { ?>
616 616
 												<div class="comments-section">
617 617
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
618 618
 													see all
@@ -620,8 +620,8 @@  discard block
 block discarded – undo
620 620
 													<h4>Video Responses</h4>
621 621
 													<ul class="video-list">
622 622
 													<?php 
623
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
624
-															if($__video_h->video_exists($video['video'])) { 
623
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
624
+															if ($__video_h->video_exists($video['video'])) { 
625 625
 																$video = $__video_h->fetch_video_rid($video['video']);
626 626
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
627 627
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -652,19 +652,19 @@  discard block
 block discarded – undo
652 652
 														</h4>
653 653
 													</div>
654 654
 												</div>
655
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
655
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
656 656
 													<div class="comments-post-container clearfix">
657 657
 														<div class="comments-post-alert">
658 658
 															<a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span>
659 659
 														</div>
660 660
 													</div>
661
-												<?php } else if($_video['commenting'] == "d") { ?>
661
+												<?php } else if ($_video['commenting'] == "d") { ?>
662 662
 													<div class="comments-post-container clearfix">
663 663
 														<div class="comments-post-alert">
664 664
 															This video has comemnting disabled!
665 665
 														</div>
666 666
 													</div>
667
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
667
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
668 668
 													<div class="comments-post-container clearfix">
669 669
 														<div class="comments-post-alert">
670 670
 															This user has blocked you!
@@ -718,15 +718,15 @@  discard block
 block discarded – undo
718 718
 														$stmt->execute();
719 719
 
720 720
 														$number_of_result = $stmt->rowCount();
721
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
721
+														$number_of_page = ceil($number_of_result/$results_per_page);  
722 722
 
723
-														if (!isset ($_GET['page']) ) {  
723
+														if (!isset ($_GET['page'])) {  
724 724
 															$page = 1;  
725 725
 														} else {  
726
-															$page = (int)$_GET['page'];  
726
+															$page = (int) $_GET['page'];  
727 727
 														}  
728 728
 
729
-														$page_first_result = ($page - 1) * $results_per_page;  
729
+														$page_first_result = ($page - 1)*$results_per_page;  
730 730
 
731 731
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
732 732
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -734,10 +734,10 @@  discard block
 block discarded – undo
734 734
 														$stmt->bindParam(":pper", $results_per_page);
735 735
 														$stmt->execute();
736 736
 
737
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
738
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
737
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
738
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
739 739
 																$comment['liked'] = true;
740
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
740
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
741 741
 																$comment['disliked'] = true;
742 742
 																
743 743
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 																		<span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span>
760 760
 																		</span>
761 761
 																		</span></span>
762
-																		<?php if($comment['likes'] != 0) { ?>
762
+																		<?php if ($comment['likes'] != 0) { ?>
763 763
 																		<span dir="ltr" class="comments-rating-positive" title="9 up, 1 down">
764 764
 																			<?php echo $comment['likes']; ?>
765 765
 																			<img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif">
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 												<?php
830 830
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
831 831
 													$stmt->execute();
832
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
832
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
833 833
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
834 834
 														$video['duration'] = $__time_h->timestamp($video['duration']);
835 835
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if(isset($_SESSION['siteusername']))
19
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
18
+	if(isset($_SESSION['siteusername'])) {
19
+			$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
20
+	}
20 21
 
21 22
 	$_SESSION['current_video'] = $_video['rid'];
22 23
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
@@ -735,10 +736,11 @@  discard block
 block discarded – undo
735 736
 														$stmt->execute();
736 737
 
737 738
 														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
738
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
739
-																$comment['liked'] = true;
740
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
741
-																$comment['disliked'] = true;
739
+															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) {
740
+																															$comment['liked'] = true;
741
+															} else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) {
742
+																															$comment['disliked'] = true;
743
+															}
742 744
 																
743 745
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
744 746
 															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
Please login to merge, or discard this patch.
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if(isset($_SESSION['siteusername']))
19
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
18
+    if(isset($_SESSION['siteusername']))
19
+        $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
20 20
 
21
-	$_SESSION['current_video'] = $_video['rid'];
21
+    $_SESSION['current_video'] = $_video['rid'];
22 22
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
23 23
         $error = array();
24 24
 
@@ -28,33 +28,33 @@  discard block
 block discarded – undo
28 28
         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; }
29 29
 
30 30
         if(!isset($error['message'])) {
31
-			$text = $_POST['comment'];
31
+            $text = $_POST['comment'];
32 32
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
33 33
             $stmt->bindParam(":v", $_GET['v']);
34
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
35
-			$stmt->bindParam(":comment", $text);
34
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
35
+            $stmt->bindParam(":comment", $text);
36 36
             $stmt->execute();
37 37
 
38
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
39
-			$__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
38
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
39
+            $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
40 40
         }
41 41
     }
42 42
 
43
-	/* 
43
+    /* 
44 44
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
45 45
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
46 46
 	Work on this tomorrow or some shit idk lol
47 47
 	*/
48 48
 
49
-	/* 
49
+    /* 
50 50
 	USE THE GOD DAMN __CONFIG MORE -- idiot
51 51
 	Work on this tomorrow or some shit
52 52
 	*/
53 53
 
54
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
55
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
56
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
57
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
54
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
55
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
56
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
57
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
58 58
 ?>
59 59
 <!DOCTYPE html>
60 60
 <html>
@@ -84,29 +84,29 @@  discard block
 block discarded – undo
84 84
          if (window.yt.timing) {yt.timing.tick("ct");}    
85 85
       </script>
86 86
 		<?php
87
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
88
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
87
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
88
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
89 89
 
90
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
91
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
90
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
91
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
92 92
 
93
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
94
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
93
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
94
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
95 95
 
96
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
97
-				$_video['likeswidth'] = 0;
98
-				$_video['dislikeswidth'] = 0;
99
-			} else {
100
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
101
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
102
-			}
96
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
97
+                $_video['likeswidth'] = 0;
98
+                $_video['dislikeswidth'] = 0;
99
+            } else {
100
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
101
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
102
+            }
103 103
 
104
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
105
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
106
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
107
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
108
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
109
-		?>
104
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
105
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
106
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
107
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
108
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
109
+        ?>
110 110
 	</head>
111 111
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
112 112
 		<form name="logoutForm" method="POST" action="/logout">
@@ -328,21 +328,21 @@  discard block
 block discarded – undo
328 328
 													<hr><br>
329 329
 													<h3>Add to a Playlist</h3>
330 330
 													<?php
331
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
332
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
333
-														$stmt->execute();
334
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
335
-															$buffer = json_decode($playlist['videos']);
336
-															@$rid = $buffer[0];
337
-															if(!empty($rid)) {
338
-																@$video = $__video_h->fetch_video_rid($rid);
339
-															} else {
340
-																$video['thumbnail'] = "";
341
-																$video['duration'] = 0;
342
-															}
331
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
332
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
333
+                                                        $stmt->execute();
334
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
335
+                                                            $buffer = json_decode($playlist['videos']);
336
+                                                            @$rid = $buffer[0];
337
+                                                            if(!empty($rid)) {
338
+                                                                @$video = $__video_h->fetch_video_rid($rid);
339
+                                                            } else {
340
+                                                                $video['thumbnail'] = "";
341
+                                                                $video['duration'] = 0;
342
+                                                            }
343 343
 
344
-															$videos = count($buffer);
345
-													?>
344
+                                                            $videos = count($buffer);
345
+                                                    ?>
346 346
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br>
347 347
 													<?php } ?>
348 348
 												<?php } ?>
@@ -607,10 +607,10 @@  discard block
 block discarded – undo
607 607
 												</div>
608 608
 											</div>
609 609
 											<?php 
610
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
611
-												$stmt->bindParam(":v", $_GET['v']);
612
-												$stmt->execute();
613
-											?>
610
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
611
+                                                $stmt->bindParam(":v", $_GET['v']);
612
+                                                $stmt->execute();
613
+                                            ?>
614 614
 
615 615
 											<?php if($stmt->rowCount() != 0) { ?>
616 616
 												<div class="comments-section">
@@ -620,16 +620,16 @@  discard block
 block discarded – undo
620 620
 													<h4>Video Responses</h4>
621 621
 													<ul class="video-list">
622 622
 													<?php 
623
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
624
-															if($__video_h->video_exists($video['video'])) { 
625
-																$video = $__video_h->fetch_video_rid($video['video']);
626
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
627
-																$video['duration'] = $__time_h->timestamp($video['duration']);
628
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
629
-																$video['author'] = htmlspecialchars($video['author']);		
630
-																$video['title'] = htmlspecialchars($video['title']);
631
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
632
-													?>
623
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
624
+                                                            if($__video_h->video_exists($video['video'])) { 
625
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
626
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
627
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
628
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
629
+                                                                $video['author'] = htmlspecialchars($video['author']);		
630
+                                                                $video['title'] = htmlspecialchars($video['title']);
631
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
632
+                                                    ?>
633 633
 														<li class="video-list-item yt-tile-default">
634 634
 															<a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
635 635
 															<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="cjls0QsHOBE" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
@@ -711,38 +711,38 @@  discard block
 block discarded – undo
711 711
 												</div>
712 712
 												<ul class="comment-list" id="live_comments">
713 713
 														<?php
714
-														$results_per_page = 20;
714
+                                                        $results_per_page = 20;
715 715
 
716
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
717
-														$stmt->bindParam(":rid", $_video['rid']);
718
-														$stmt->execute();
716
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
717
+                                                        $stmt->bindParam(":rid", $_video['rid']);
718
+                                                        $stmt->execute();
719 719
 
720
-														$number_of_result = $stmt->rowCount();
721
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
720
+                                                        $number_of_result = $stmt->rowCount();
721
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
722 722
 
723
-														if (!isset ($_GET['page']) ) {  
724
-															$page = 1;  
725
-														} else {  
726
-															$page = (int)$_GET['page'];  
727
-														}  
723
+                                                        if (!isset ($_GET['page']) ) {  
724
+                                                            $page = 1;  
725
+                                                        } else {  
726
+                                                            $page = (int)$_GET['page'];  
727
+                                                        }  
728 728
 
729
-														$page_first_result = ($page - 1) * $results_per_page;  
729
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
730 730
 
731
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
732
-														$stmt->bindParam(":rid", $_video['rid']);
733
-														$stmt->bindParam(":pfirst", $page_first_result);
734
-														$stmt->bindParam(":pper", $results_per_page);
735
-														$stmt->execute();
731
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
732
+                                                        $stmt->bindParam(":rid", $_video['rid']);
733
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
734
+                                                        $stmt->bindParam(":pper", $results_per_page);
735
+                                                        $stmt->execute();
736 736
 
737
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
738
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
739
-																$comment['liked'] = true;
740
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
741
-																$comment['disliked'] = true;
737
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
738
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
739
+                                                                $comment['liked'] = true;
740
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
741
+                                                                $comment['disliked'] = true;
742 742
 																
743
-															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
744
-															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
745
-													?>
743
+                                                            $comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
744
+                                                            $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
745
+                                                    ?>
746 746
 
747 747
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
748 748
 														<div class="comment-body">
@@ -827,16 +827,16 @@  discard block
 block discarded – undo
827 827
 											<ul id="watch-related" class="video-list">
828 828
 												<div id="ppv-container" class="hid"></div>
829 829
 												<?php
830
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
831
-													$stmt->execute();
832
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
833
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
834
-														$video['duration'] = $__time_h->timestamp($video['duration']);
835
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
836
-														$video['author'] = htmlspecialchars($video['author']);		
837
-														$video['title'] = htmlspecialchars($video['title']);
838
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
839
-												?>
830
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
831
+                                                    $stmt->execute();
832
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
833
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
834
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
835
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
836
+                                                        $video['author'] = htmlspecialchars($video['author']);		
837
+                                                        $video['title'] = htmlspecialchars($video['title']);
838
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
839
+                                                ?>
840 840
 												<li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink  yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&amp;<?php echo htmlspecialchars($_video['author']); ?>&amp;feature=relmfu"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" onerror=";this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span>
841 841
 													<button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="gyAaIKF6tSQ" role="button"><span class="yt-uix-button-content">  <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later">
842 842
 													</span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button>
Please login to merge, or discard this patch.
web/public/edit_playlist.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Edit Video";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Edit Video";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14 14
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/get/toggle_comment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 <?php
14 14
 $video = $__video_h->fetch_video_rid($_GET['id']);
15 15
 
16
-if($video['author'] == $_SESSION['siteusername']) {
17
-    if($video['commenting'] == "a") {
16
+if ($video['author'] == $_SESSION['siteusername']) {
17
+    if ($video['commenting'] == "a") {
18 18
         $__video_u->update_row($_GET['id'], "commenting", "d");
19 19
     } else {
20 20
         $__video_u->update_row($_GET['id'], "commenting", "a");
Please login to merge, or discard this patch.
web/public/get/delete_video.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 <?php
13 13
 
14 14
 if($video['author'] == $_SESSION['siteusername']) {
15
-  $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16
-  $stmt->execute(array(
15
+    $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16
+    $stmt->execute(array(
17 17
     ':author' => $video['author'],
18 18
     ':rid' => $video['rid'],
19
-  ));
19
+    ));
20 20
 }
21 21
 
22 22
 header('Location: /my_videos');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $video = $__video_h->fetch_video_rid($_GET['id']); ?>
12 12
 <?php
13 13
 
14
-if($video['author'] == $_SESSION['siteusername']) {
14
+if ($video['author'] == $_SESSION['siteusername']) {
15 15
   $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16 16
   $stmt->execute(array(
17 17
     ':author' => $video['author'],
Please login to merge, or discard this patch.