Test Failed
Push — main ( 0c12e7...ee73bc )
by chief
04:22
created
web/public/edit_video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Edit Video";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Edit Video";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14 14
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         <b>Category</b> <br>
178 178
                                         <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
179 179
                                             <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?>
180
-                                            <?php foreach($categories as $categoryTag) { ?>
180
+                                            <?php foreach ($categories as $categoryTag) { ?>
181 181
                                                 <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
182 182
                                             <?php } ?>
183 183
                                         </select><br><br>
Please login to merge, or discard this patch.
web/public/s/mod/channel_customization.php 2 patches
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -313,14 +313,15 @@
 block discarded – undo
313 313
                             for($i = 0;$i <= $countryLength; $i++)
314 314
                             {
315 315
                                 $c = $countries[$i];
316
-                                if ($c == $_user['country'])
317
-                                //country is the same as in database
316
+                                if ($c == $_user['country']) {
317
+                                                                //country is the same as in database
318 318
                                 {
319 319
                                 ?>
320
-                                <option value="<?php echo $c; ?>" selected="selected"><?php echo $c; ?></option>
321
-                                <?php
320
+                                <option value="<?php echo $c;
322 321
                                 }
323
-                                else
322
+                                ?>" selected="selected"><?php echo $c; ?></option>
323
+                                <?php
324
+                                } else
324 325
                                 {
325 326
                                 ?>
326 327
                                 <option value="<?php echo $c;?>"><?php echo $c; ?></option>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                             </script>
287 287
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
288 288
                         <img src="/dynamic/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br>
289
-                        <?php if($_user['pfp'] != "default.png") { ?>
289
+                        <?php if ($_user['pfp'] != "default.png") { ?>
290 290
                             <a href="/get/remove_profile_pic">Remove Profile Picture</a><br>
291 291
                         <?php } ?>
292 292
                         <br><hr class="thin-line-darker" style="width:unset;">
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                             <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload">
296 296
                             <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>-->
297 297
                         </div><br>                   
298
-                        <?php if(!empty($_user['subbutton'])) { ?>
298
+                        <?php if (!empty($_user['subbutton'])) { ?>
299 299
                             <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br>
300 300
                         <?php } ?><br><hr class="thin-line-darker" style="width:unset;">
301 301
 
@@ -315,17 +315,17 @@  discard block
 block discarded – undo
315 315
 
316 316
                         <b>Featured Video</b>
317 317
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
318
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid">
318
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid">
319 319
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
320 320
 
321 321
                         <b>Featured Channels</b>
322 322
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;">
323
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']);?>" name="featuredchannels">
323
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']); ?>" name="featuredchannels">
324 324
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
325 325
 
326 326
                         <b>Website</b>
327 327
                         <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;">
328
-                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website">
328
+                        <input class="yt-uix-form-input-text" style="width: 291px;"  id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website">
329 329
                             
330 330
                         </div><br><br><hr class="thin-line-darker" style="width:unset;">
331 331
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
                         <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span>
335 335
                         <div class="customization-module" id="channellayout" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;">
336 336
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="genre">
337
-                                <?php foreach($categories as $category) { ?>
337
+                                <?php foreach ($categories as $category) { ?>
338 338
                                     <option value="<?php echo $category; ?>"><?php echo $category; ?></option>
339 339
                                 <?php } ?>
340 340
                             </select>
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"   name="transparency">
349 349
                             <?php
350 350
                             $trans = array(
351
-                                "1.1","1.0","0.9","0.8","0.7","0.6","0.5","0.4","0.3","0.2","0.1",
351
+                                "1.1", "1.0", "0.9", "0.8", "0.7", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1",
352 352
                             );
353 353
                             ?>
354 354
                                 <option value="1.0">100% (Visible)</option>
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
                             <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;"  id="country" name="country" value="<?php echo $_user['country']?>">
372 372
                             <?php
373 373
                             $countries = array(
374
-                                "Select country","Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
374
+                                "Select country", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
375 375
                             );
376 376
 
377 377
                             $countryLength = sizeof($countries);
378 378
                             $i = 0;
379
-                            for($i = 0;$i <= $countryLength; $i++)
379
+                            for ($i = 0; $i <= $countryLength; $i++)
380 380
                             {
381 381
                                 $c = $countries[$i];
382 382
                                 if ($c == $_user['country'])
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
                                 else
390 390
                                 {
391 391
                                 ?>
392
-                                <option value="<?php echo $c;?>"><?php echo $c; ?></option>
392
+                                <option value="<?php echo $c; ?>"><?php echo $c; ?></option>
393 393
                                 <?php
394 394
                                 }
395 395
                             }
Please login to merge, or discard this patch.
web/public/file_upload.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Replace me";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Replace me";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <!DOCTYPE html>
17 17
 <html>
Please login to merge, or discard this patch.
web/public/d/channel_update.php 1 patch
Spacing   +40 added lines, -40 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,71 +178,71 @@  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'], "primary_color", $_POST['solidcolor']);
199 199
         }
200 200
 
201
-        if(!empty($_POST['transparency'])) {
201
+        if (!empty($_POST['transparency'])) {
202 202
             $__user_u->update_row($_SESSION['siteusername'], "transparency", $_POST['transparency']);
203 203
         }
204 204
 
205
-        if(!empty($_POST['genre'])) {
205
+        if (!empty($_POST['genre'])) {
206 206
             $__user_u->update_row($_SESSION['siteusername'], "genre", $_POST['genre']);
207 207
         }
208 208
 
209
-        if(!empty($_POST['bordercolor'])) {
209
+        if (!empty($_POST['bordercolor'])) {
210 210
             $__user_u->update_row($_SESSION['siteusername'], "border_color", $_POST['bordercolor']);
211 211
         }
212 212
 
213
-        if(!empty($_POST['country'])) {
213
+        if (!empty($_POST['country'])) {
214 214
             $__user_u->update_row($_SESSION['siteusername'], "country", $_POST['country']);
215 215
         } // duplicate?
216 216
 
217
-        if(!empty($_POST['header'])) {
217
+        if (!empty($_POST['header'])) {
218 218
             $__user_u->update_row($_SESSION['siteusername'], "custom_header", $_POST['header']);
219 219
         }
220 220
 
221
-        if(!empty($_POST['customtext'])) {
221
+        if (!empty($_POST['customtext'])) {
222 222
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['customtext']);
223 223
         }
224 224
 
225
-        if(!empty($_POST['country'])) {
225
+        if (!empty($_POST['country'])) {
226 226
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['country']);
227 227
         } // duplicate?
228 228
 
229
-        if(!empty($_POST['website'])) {
229
+        if (!empty($_POST['website'])) {
230 230
             $__user_u->update_row($_SESSION['siteusername'], "website", $_POST['website']);
231 231
         }
232 232
     
233
-        if(!empty($_POST['channelboxcolor'])) {
233
+        if (!empty($_POST['channelboxcolor'])) {
234 234
             $__user_u->update_row($_SESSION['siteusername'], "secondary_color", $_POST['channelboxcolor']);
235 235
         }
236 236
 
237
-        if(!empty($_POST['backgroundcolor'])) {
237
+        if (!empty($_POST['backgroundcolor'])) {
238 238
             $__user_u->update_row($_SESSION['siteusername'], "third_color", $_POST['backgroundcolor']);
239 239
         }
240 240
 
241
-        if(!empty($_POST['textmaincolor'])) {
241
+        if (!empty($_POST['textmaincolor'])) {
242 242
             $__user_u->update_row($_SESSION['siteusername'], "primary_color_text", $_POST['textmaincolor']);
243 243
         }
244 244
 
245
-    if(!empty($_POST['bgoptionset'])) {
245
+    if (!empty($_POST['bgoptionset'])) {
246 246
         $bgoption = $_POST['bgoption'];
247 247
         $bgcolor = $_POST['solidcolor'];
248 248
         $default = "default.png";
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         
252 252
         $__user_u->update_row($_SESSION['siteusername'], "2009_bgcolor", $bgcolor);
253 253
 
254
-        if($bgoption == "solid") {
254
+        if ($bgoption == "solid") {
255 255
             $__user_u->update_row($_SESSION['siteusername'], "2009_bg", $default);
256 256
         }
257 257
     }
Please login to merge, or discard this patch.
web/public/report.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@
 block discarded – undo
18 18
     "username" => str_replace("@", "", $_SESSION['siteusername']),
19 19
     // "avatar_url" => "https://subrock.rocks/dynamic/pfp/",
20 20
     "tts" => false,
21
-], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
21
+], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
22 22
 
23
-$ch = curl_init( $webhookurl );
24
-curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
25
-curl_setopt( $ch, CURLOPT_POST, 1);
26
-curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data);
27
-curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
28
-curl_setopt( $ch, CURLOPT_HEADER, 0);
29
-curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
23
+$ch = curl_init($webhookurl);
24
+curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
25
+curl_setopt($ch, CURLOPT_POST, 1);
26
+curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
27
+curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
28
+curl_setopt($ch, CURLOPT_HEADER, 0);
29
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
30 30
 
31
-$response = curl_exec( $ch );
32
-curl_close( $ch );
31
+$response = curl_exec($ch);
32
+curl_close($ch);
33 33
 header('Location: ' . $_SERVER['HTTP_REFERER'] . '&success=Successfully reported this video.');
34 34
 ?>
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
web/public/results.php 3 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -4,46 +4,46 @@  discard block
 block discarded – undo
4 4
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?>
5 5
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?>
6 6
 <?php
7
-   $request = (object) [
8
-      "search_term"      => htmlspecialchars($_GET['search_query']),
9
-      "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
-      "search_amount"    => 0 /* [fallback] */
11
-   ];
7
+    $request = (object) [
8
+        "search_term"      => htmlspecialchars($_GET['search_query']),
9
+        "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
+        "search_amount"    => 0 /* [fallback] */
11
+    ];
12 12
 
13
-   $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
-   $stmt->bindParam(":search", $request->like_search_term);
15
-   $stmt->execute(); 
16
-   $request->search_amount = $stmt->rowCount();
13
+    $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
+    $stmt->bindParam(":search", $request->like_search_term);
15
+    $stmt->execute(); 
16
+    $request->search_amount = $stmt->rowCount();
17 17
 
18
-   $results_per_page = 12;
19
-   $number_of_result = $request->search_amount;
20
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
18
+    $results_per_page = 12;
19
+    $number_of_result = $request->search_amount;
20
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
21 21
 
22
-   if (!isset ($_GET['page']) ) {  
23
-       $page = 1;  
24
-   } else {  
25
-       $page = (int)$_GET['page'];  
26
-   }  
22
+    if (!isset ($_GET['page']) ) {  
23
+        $page = 1;  
24
+    } else {  
25
+        $page = (int)$_GET['page'];  
26
+    }  
27 27
 
28
-   $page_first_result = ($page - 1) * $results_per_page;  
28
+    $page_first_result = ($page - 1) * $results_per_page;  
29 29
 
30
-   $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
-   $stmt6->bindParam(":search", $request->like_search_term);
32
-   $stmt6->bindParam(":pfirst", $page_first_result);
33
-   $stmt6->bindParam(":pper", $results_per_page);
34
-   $stmt6->execute();
30
+    $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
+    $stmt6->bindParam(":search", $request->like_search_term);
32
+    $stmt6->bindParam(":pfirst", $page_first_result);
33
+    $stmt6->bindParam(":pper", $results_per_page);
34
+    $stmt6->execute();
35 35
 
36
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
36
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
37 37
 ?>
38 38
 <?php $__video_h = new video_helper($__db); ?>
39 39
 <?php $__user_h = new user_helper($__db); ?>
40 40
 <?php $__db_h = new db_helper(); ?>
41 41
 <?php $__time_h = new time_helper(); ?>
42 42
 <?php
43
-	$__server->page_embeds->page_title = "SubRocks - Search";
44
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
43
+    $__server->page_embeds->page_title = "SubRocks - Search";
44
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
47 47
 ?>
48 48
 <!DOCTYPE html>
49 49
 <html>
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
                   <div id="results-main-content">
220 220
                      <ol id="search-results">
221 221
                         <?php
222
-                           while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
-                              $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
-                              $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
-                              $video['duration'] = $__time_h->timestamp($video['duration']);
226
-                              $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
-                              $video['author'] = htmlspecialchars($video['author']);		
228
-                              $video['title'] = htmlspecialchars($video['title']);
229
-                              $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
222
+                            while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
+                                $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
+                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
+                                $video['duration'] = $__time_h->timestamp($video['duration']);
226
+                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
+                                $video['author'] = htmlspecialchars($video['author']);		
228
+                                $video['title'] = htmlspecialchars($video['title']);
229
+                                $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
230 230
                         ?>
231 231
                               <li class="yt-grid-box result-item-video *sr ">
232 232
                                  <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box ">
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                               </li>
255 255
                         <?php } ?>
256 256
                         <?php if($request->search_amount == 0)
257
-                           echo "Your search query has brought no results.<br><br>";
257
+                            echo "Your search query has brought no results.<br><br>";
258 258
                         ?>
259 259
                      </ol>
260 260
                   </div>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 
18 18
    $results_per_page = 12;
19 19
    $number_of_result = $request->search_amount;
20
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
20
+   $number_of_page = ceil($number_of_result/$results_per_page);  
21 21
 
22
-   if (!isset ($_GET['page']) ) {  
22
+   if (!isset ($_GET['page'])) {  
23 23
        $page = 1;  
24 24
    } else {  
25
-       $page = (int)$_GET['page'];  
25
+       $page = (int) $_GET['page'];  
26 26
    }  
27 27
 
28
-   $page_first_result = ($page - 1) * $results_per_page;  
28
+   $page_first_result = ($page - 1)*$results_per_page;  
29 29
 
30 30
    $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31 31
    $stmt6->bindParam(":search", $request->like_search_term);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                   <div id="results-main-content">
220 220
                      <ol id="search-results">
221 221
                         <?php
222
-                           while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
222
+                           while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223 223
                               $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224 224
                               $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225 225
                               $video['duration'] = $__time_h->timestamp($video['duration']);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                                  </div>
254 254
                               </li>
255 255
                         <?php } ?>
256
-                        <?php if($request->search_amount == 0)
256
+                        <?php if ($request->search_amount == 0)
257 257
                            echo "Your search query has brought no results.<br><br>";
258 258
                         ?>
259 259
                      </ol>
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             </div>
268 268
             <div id="search-footer-box" class="searchFooterBox">
269 269
                <div class="yt-uix-pager" role="navigation">
270
-                  <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
270
+                  <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
271 271
                      <a href="/results?search_query=<?php echo $request->search_term; ?>&page=<?php echo $page; ?>">
272 272
                         <button class="yt-uix-button yt-uix-button-default"><?php echo $page; ?></button>
273 273
                      </a>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -253,8 +253,9 @@
 block discarded – undo
253 253
                                  </div>
254 254
                               </li>
255 255
                         <?php } ?>
256
-                        <?php if($request->search_amount == 0)
256
+                        <?php if($request->search_amount == 0) {
257 257
                            echo "Your search query has brought no results.<br><br>";
258
+}
258 259
                         ?>
259 260
                      </ol>
260 261
                   </div>
Please login to merge, or discard this patch.
web/public/watch.php 3 patches
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -24,33 +24,33 @@  discard block
 block discarded – undo
24 24
         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 25
 
26 26
         if(!isset($error['message'])) {
27
-			$text = $_POST['comment'];
27
+            $text = $_POST['comment'];
28 28
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
29 29
             $stmt->bindParam(":v", $_GET['v']);
30
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
31
-			$stmt->bindParam(":comment", $text);
30
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
31
+            $stmt->bindParam(":comment", $text);
32 32
             $stmt->execute();
33 33
 
34
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
35
-			$__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
34
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
35
+            $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
36 36
         }
37 37
     }
38 38
 
39
-	/* 
39
+    /* 
40 40
 	PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) 
41 41
 	Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes 
42 42
 	Work on this tomorrow or some shit idk lol
43 43
 	*/
44 44
 
45
-	/* 
45
+    /* 
46 46
 	USE THE GOD DAMN __CONFIG MORE -- idiot
47 47
 	Work on this tomorrow or some shit
48 48
 	*/
49 49
 
50
-	$__server->page_embeds->page_title = htmlspecialchars($_video['title']);
51
-	$__server->page_embeds->page_description = htmlspecialchars($_video['description']);
52
-	$__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
53
-	$__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
50
+    $__server->page_embeds->page_title = htmlspecialchars($_video['title']);
51
+    $__server->page_embeds->page_description = htmlspecialchars($_video['description']);
52
+    $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail'];
53
+    $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']);
54 54
 ?>
55 55
 <!DOCTYPE html>
56 56
 <html>
@@ -80,29 +80,29 @@  discard block
 block discarded – undo
80 80
          if (window.yt.timing) {yt.timing.tick("ct");}    
81 81
       </script>
82 82
 		<?php
83
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
84
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
83
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
84
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
85 85
 
86
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
87
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
86
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
87
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
88 88
 
89
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
90
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
89
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
90
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
91 91
 
92
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
93
-				$_video['likeswidth'] = 50;
94
-				$_video['dislikeswidth'] = 50;
95
-			} else {
96
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
97
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
98
-			}
92
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
93
+                $_video['likeswidth'] = 50;
94
+                $_video['dislikeswidth'] = 50;
95
+            } else {
96
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
97
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
98
+            }
99 99
 
100
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
101
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
102
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
103
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
104
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
105
-		?>
100
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
101
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
102
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
103
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
104
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
105
+        ?>
106 106
 	</head>
107 107
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
108 108
 		<form name="logoutForm" method="POST" action="/logout">
@@ -324,21 +324,21 @@  discard block
 block discarded – undo
324 324
 													<hr><br>
325 325
 													<h3>Add to a Playlist</h3>
326 326
 													<?php
327
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
328
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
329
-														$stmt->execute();
330
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
331
-															$buffer = json_decode($playlist['videos']);
332
-															@$rid = $buffer[0];
333
-															if(!empty($rid)) {
334
-																@$video = $__video_h->fetch_video_rid($rid);
335
-															} else {
336
-																$video['thumbnail'] = "";
337
-																$video['duration'] = 0;
338
-															}
327
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
328
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
329
+                                                        $stmt->execute();
330
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
331
+                                                            $buffer = json_decode($playlist['videos']);
332
+                                                            @$rid = $buffer[0];
333
+                                                            if(!empty($rid)) {
334
+                                                                @$video = $__video_h->fetch_video_rid($rid);
335
+                                                            } else {
336
+                                                                $video['thumbnail'] = "";
337
+                                                                $video['duration'] = 0;
338
+                                                            }
339 339
 
340
-															$videos = count($buffer);
341
-													?>
340
+                                                            $videos = count($buffer);
341
+                                                    ?>
342 342
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a>
343 343
 													<?php } ?>
344 344
 												<?php } ?>
@@ -603,10 +603,10 @@  discard block
 block discarded – undo
603 603
 												</div>
604 604
 											</div>
605 605
 											<?php 
606
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
607
-												$stmt->bindParam(":v", $_GET['v']);
608
-												$stmt->execute();
609
-											?>
606
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
607
+                                                $stmt->bindParam(":v", $_GET['v']);
608
+                                                $stmt->execute();
609
+                                            ?>
610 610
 
611 611
 											<?php if($stmt->rowCount() != 0) { ?>
612 612
 												<div class="comments-section">
@@ -616,16 +616,16 @@  discard block
 block discarded – undo
616 616
 													<h4>Video Responses</h4>
617 617
 													<ul class="video-list">
618 618
 													<?php 
619
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
-															if($__video_h->video_exists($video['video'])) { 
621
-																$video = $__video_h->fetch_video_rid($video['video']);
622
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
623
-																$video['duration'] = $__time_h->timestamp($video['duration']);
624
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
625
-																$video['author'] = htmlspecialchars($video['author']);		
626
-																$video['title'] = htmlspecialchars($video['title']);
627
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
628
-													?>
619
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
+                                                            if($__video_h->video_exists($video['video'])) { 
621
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
622
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
623
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
624
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
625
+                                                                $video['author'] = htmlspecialchars($video['author']);		
626
+                                                                $video['title'] = htmlspecialchars($video['title']);
627
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
628
+                                                    ?>
629 629
 														<li class="video-list-item yt-tile-default">
630 630
 															<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>
631 631
 															<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">
@@ -707,35 +707,35 @@  discard block
 block discarded – undo
707 707
 												</div>
708 708
 												<ul class="comment-list" id="live_comments">
709 709
 														<?php
710
-														$results_per_page = 20;
710
+                                                        $results_per_page = 20;
711 711
 
712
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
713
-														$stmt->bindParam(":rid", $_video['rid']);
714
-														$stmt->execute();
712
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
713
+                                                        $stmt->bindParam(":rid", $_video['rid']);
714
+                                                        $stmt->execute();
715 715
 
716
-														$number_of_result = $stmt->rowCount();
717
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
716
+                                                        $number_of_result = $stmt->rowCount();
717
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
718 718
 
719
-														if (!isset ($_GET['page']) ) {  
720
-															$page = 1;  
721
-														} else {  
722
-															$page = (int)$_GET['page'];  
723
-														}  
719
+                                                        if (!isset ($_GET['page']) ) {  
720
+                                                            $page = 1;  
721
+                                                        } else {  
722
+                                                            $page = (int)$_GET['page'];  
723
+                                                        }  
724 724
 
725
-														$page_first_result = ($page - 1) * $results_per_page;  
725
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
726 726
 
727
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
728
-														$stmt->bindParam(":rid", $_video['rid']);
729
-														$stmt->bindParam(":pfirst", $page_first_result);
730
-														$stmt->bindParam(":pper", $results_per_page);
731
-														$stmt->execute();
727
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
728
+                                                        $stmt->bindParam(":rid", $_video['rid']);
729
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
730
+                                                        $stmt->bindParam(":pper", $results_per_page);
731
+                                                        $stmt->execute();
732 732
 
733
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
735
-																$comment['liked'] = true;
736
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
737
-																$comment['disliked'] = true;	
738
-													?>
733
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734
+                                                            if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
735
+                                                                $comment['liked'] = true;
736
+                                                            else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
737
+                                                                $comment['disliked'] = true;	
738
+                                                    ?>
739 739
 
740 740
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
741 741
 														<div class="comment-body">
@@ -814,16 +814,16 @@  discard block
 block discarded – undo
814 814
 											<ul id="watch-related" class="video-list">
815 815
 												<div id="ppv-container" class="hid"></div>
816 816
 												<?php
817
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
818
-													$stmt->execute();
819
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
820
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
821
-														$video['duration'] = $__time_h->timestamp($video['duration']);
822
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
823
-														$video['author'] = htmlspecialchars($video['author']);		
824
-														$video['title'] = htmlspecialchars($video['title']);
825
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
826
-												?>
817
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
818
+                                                    $stmt->execute();
819
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
820
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
821
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
822
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
823
+                                                        $video['author'] = htmlspecialchars($video['author']);		
824
+                                                        $video['title'] = htmlspecialchars($video['title']);
825
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
826
+                                                ?>
827 827
 												<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.onerror=null;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>
828 828
 													<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">
829 829
 													</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.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@  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($_SERVER['REQUEST_METHOD'] == 'POST') {
18
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
19 19
         $error = array();
20 20
 
21
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
22
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
-        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; }
21
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
22
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
+        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 25
 
26
-        if(!isset($error['message'])) {
26
+        if (!isset($error['message'])) {
27 27
 			$text = $_POST['comment'];
28 28
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
29 29
             $stmt->bindParam(":v", $_GET['v']);
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
          if (window.yt.timing) {yt.timing.tick("ct");}    
81 81
       </script>
82 82
 		<?php
83
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
83
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
84 84
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
85 85
 
86
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
87
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
86
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
87
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
88 88
 
89 89
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
90 90
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
91 91
 
92
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
92
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
93 93
 				$_video['likeswidth'] = 50;
94 94
 				$_video['dislikeswidth'] = 50;
95 95
 			} else {
96
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
96
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
97 97
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
98 98
 			}
99 99
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 									</div>
128 128
 									<div id="instream_google_companion_ad_div"></div>
129 129
 								</div>
130
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
130
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
131 131
 									<div id="watch-owner-container">
132 132
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
133 133
 											<ul class="yt-nav-aside">
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 											title="" 
163 163
 											id="subscribe-button"
164 164
 											type="button" 
165
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
165
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
166 166
 											role="button">
167 167
 											<span class="yt-uix-button-icon-wrapper">
168 168
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 											<button onclick=";like_video();return false;"
244 244
 											title="I like this" 
245 245
 											type="button" 
246
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
246
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
247 247
 											id="watch-like"  
248 248
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
249 249
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 											type="button" 
258 258
 											style="margin-left: -2px;"
259 259
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
260
-											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" 
260
+											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" 
261 261
 											id="watch-unlike" 
262 262
 											role="button">
263 263
 												<span class="yt-uix-button-icon-wrapper">
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 												not implemented ismnf
276 276
 											</div>
277 277
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
278
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
278
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
279 279
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
280 280
 													<div class="yt-alert-icon">
281 281
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 												<?php } else { ?>
292 292
 													<h3>Be friends with the creator</h3>
293 293
 
294
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
294
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
295 295
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
296 296
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
297 297
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 														</span><br><br>
306 306
 													<?php } ?>
307 307
 
308
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
309
-														<?php if($_video['friended'] == false) { ?>
308
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
309
+														<?php if ($_video['friended'] == false) { ?>
310 310
 															<a href="/friends">Send a friend request</a>
311 311
 														<?php } else { ?>
312 312
 															Your friend request is pending.
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 													<?php } ?>
317 317
 													<hr><br>
318 318
 													<h3>Add to Favorites</h3>
319
-													<?php if($_video['favorited'] == false) { ?>
319
+													<?php if ($_video['favorited'] == false) { ?>
320 320
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
321 321
 													<?php } else { ?>
322 322
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
328 328
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
329 329
 														$stmt->execute();
330
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
330
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
331 331
 															$buffer = json_decode($playlist['videos']);
332 332
 															@$rid = $buffer[0];
333
-															if(!empty($rid)) {
333
+															if (!empty($rid)) {
334 334
 																@$video = $__video_h->fetch_video_rid($rid);
335 335
 															} else {
336 336
 																$video['thumbnail'] = "";
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 												$stmt->execute();
609 609
 											?>
610 610
 
611
-											<?php if($stmt->rowCount() != 0) { ?>
611
+											<?php if ($stmt->rowCount() != 0) { ?>
612 612
 												<div class="comments-section">
613 613
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
614 614
 													see all
@@ -616,8 +616,8 @@  discard block
 block discarded – undo
616 616
 													<h4>Video Responses</h4>
617 617
 													<ul class="video-list">
618 618
 													<?php 
619
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
-															if($__video_h->video_exists($video['video'])) { 
619
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
+															if ($__video_h->video_exists($video['video'])) { 
621 621
 																$video = $__video_h->fetch_video_rid($video['video']);
622 622
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
623 623
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -648,19 +648,19 @@  discard block
 block discarded – undo
648 648
 														</h4>
649 649
 													</div>
650 650
 												</div>
651
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
651
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
652 652
 													<div class="comments-post-container clearfix">
653 653
 														<div class="comments-post-alert">
654 654
 															<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>
655 655
 														</div>
656 656
 													</div>
657
-												<?php } else if($_video['commenting'] == "d") { ?>
657
+												<?php } else if ($_video['commenting'] == "d") { ?>
658 658
 													<div class="comments-post-container clearfix">
659 659
 														<div class="comments-post-alert">
660 660
 															This video has comemnting disabled!
661 661
 														</div>
662 662
 													</div>
663
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
663
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
664 664
 													<div class="comments-post-container clearfix">
665 665
 														<div class="comments-post-alert">
666 666
 															This user has blocked you!
@@ -714,15 +714,15 @@  discard block
 block discarded – undo
714 714
 														$stmt->execute();
715 715
 
716 716
 														$number_of_result = $stmt->rowCount();
717
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
717
+														$number_of_page = ceil($number_of_result/$results_per_page);  
718 718
 
719
-														if (!isset ($_GET['page']) ) {  
719
+														if (!isset ($_GET['page'])) {  
720 720
 															$page = 1;  
721 721
 														} else {  
722
-															$page = (int)$_GET['page'];  
722
+															$page = (int) $_GET['page'];  
723 723
 														}  
724 724
 
725
-														$page_first_result = ($page - 1) * $results_per_page;  
725
+														$page_first_result = ($page - 1)*$results_per_page;  
726 726
 
727 727
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
728 728
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -730,10 +730,10 @@  discard block
 block discarded – undo
730 730
 														$stmt->bindParam(":pper", $results_per_page);
731 731
 														$stmt->execute();
732 732
 
733
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
733
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734
+															if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
735 735
 																$comment['liked'] = true;
736
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
736
+															else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
737 737
 																$comment['disliked'] = true;	
738 738
 													?>
739 739
 
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 												<?php
817 817
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
818 818
 													$stmt->execute();
819
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
819
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
820 820
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
821 821
 														$video['duration'] = $__time_h->timestamp($video['duration']);
822 822
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -731,10 +731,11 @@
 block discarded – undo
731 731
 														$stmt->execute();
732 732
 
733 733
 														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
735
-																$comment['liked'] = true;
736
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
737
-																$comment['disliked'] = true;	
734
+															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) {
735
+																															$comment['liked'] = true;
736
+															} else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) {
737
+																															$comment['disliked'] = true;
738
+															}
738 739
 													?>
739 740
 
740 741
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0">
Please login to merge, or discard this patch.
web/public/comment_voting.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
17
+if (!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18 18
     header('Location: ' . $_SERVER['HTTP_REFERER']); 
19 19
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
20
+if (isset($_GET['a']) && $_GET['a'] == "-1") 
21 21
     $request->action = "d";
22 22
 
23 23
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 24
 $stmt->bindParam(":username", $_SESSION['siteusername']);
25 25
 $stmt->bindParam(":reciever", $request->comment_id);
26 26
 $stmt->execute();
27
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
27
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
28 28
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
29 29
     $stmt->execute(array(
30 30
         ':username' => $_SESSION['siteusername'],
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $stmt->bindParam(":username", $_SESSION['siteusername']);
38 38
 $stmt->bindParam(":reciever", $request->comment_id);
39 39
 $stmt->execute();
40
-while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
40
+while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
41 41
     $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever");
42 42
     $stmt->execute(array(
43 43
         ':username' => $_SESSION['siteusername'],
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     header('Location: ' . $_SERVER['HTTP_REFERER']);
47 47
 }
48 48
 
49
-if($request->action == "l") {
49
+if ($request->action == "l") {
50 50
     $stmt = $__db->prepare("INSERT INTO comment_likes (sender, reciever, type) VALUES (:sender, :reciever, 'l')");
51 51
     $stmt->bindParam(":sender", $_SESSION['siteusername']);
52 52
     $stmt->bindParam(":reciever", $request->comment_id);
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,13 @@
 block discarded – undo
14 14
     "action" => "l" /* fallback */
15 15
 ];
16 16
 
17
-if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) 
18
-    header('Location: ' . $_SERVER['HTTP_REFERER']); 
17
+if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) {
18
+    header('Location: ' . $_SERVER['HTTP_REFERER']);
19
+}
19 20
 
20
-if(isset($_GET['a']) && $_GET['a'] == "-1") 
21
+if(isset($_GET['a']) && $_GET['a'] == "-1") {
21 22
     $request->action = "d";
23
+}
22 24
 
23 25
 $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'");
24 26
 $stmt->bindParam(":username", $_SESSION['siteusername']);
Please login to merge, or discard this patch.
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.