Test Failed
Push — main ( cb6120...71a77e )
by chief
07:27
created
web/public/s/mod/header.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	<a id="logo-container" href="/" title="YouTube home">
6 6
 	<img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="YouTube home">
7 7
 	</a>
8
-	<?php if(!isset($_SESSION['siteusername'])) { ?>
8
+	<?php if (!isset($_SESSION['siteusername'])) { ?>
9 9
 	<div id="yt-masthead-signin">
10 10
 		<a style="color: white; text-decoration: none;" href="/sign_in">
11 11
 		<button type="button" class=" yt-uix-button yt-uix-button-primary yt-uix-button-size-default" href="/sign_up" role="button">
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		<span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();">
21 21
 		<?php echo htmlspecialchars($_SESSION['siteusername']); ?>
22 22
 		</span>
23
-		<?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
23
+		<?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?>
24 24
 		<a style="position:relative;top:1px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
25 25
 		<?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> 
26 26
 		</a>
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			</form>
43 43
 		</div>
44 44
 	</div></div>
45
-<?php if(isset($_SESSION['siteusername'])) { ?>
45
+<?php if (isset($_SESSION['siteusername'])) { ?>
46 46
 <div id="masthead-expanded" class="hid" style="display: none;">
47 47
 	<div id="masthead-expanded-container" class="with-sandbar">
48 48
 	<div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4"
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20");
64 64
                     $stmt->bindParam(":username", $_SESSION['siteusername']);
65 65
                     $stmt->execute();
66
-                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
66
+                    while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
67 67
                         $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
68 68
                         $video['duration'] = $__time_h->timestamp($video['duration']);
69 69
                         $video['views'] = $__video_h->fetch_video_views($video['rid']);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 <?php } ?>
208 208
 </div>
209 209
 <div id="alerts">
210
-	<?php if(isset($error['status'])) { ?>
210
+	<?php if (isset($error['status'])) { ?>
211 211
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error  yt-alert-player">  <div class="yt-alert-icon">
212 212
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
213 213
 		</div>
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			</div>
218 218
 		</div></div></div>
219 219
 	<?php } ?>
220
-	<?php if(isset($_GET['error'])) { ?>
220
+	<?php if (isset($_GET['error'])) { ?>
221 221
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error ">  <div class="yt-alert-icon">
222 222
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
223 223
 		</div>
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			</div>
228 228
 		</div></div></div>
229 229
 	<?php } ?>
230
-	<?php if(isset($_GET['success'])) { ?>
230
+	<?php if (isset($_GET['success'])) { ?>
231 231
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-success ">  <div class="yt-alert-icon">
232 232
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
233 233
 		</div>
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			</div>
238 238
 		</div></div></div>
239 239
 	<?php } ?>
240
-	<?php if(isset($_SESSION['error'])) { ?>
240
+	<?php if (isset($_SESSION['error'])) { ?>
241 241
 		<div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error">  <div class="yt-alert-icon">
242 242
 			<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
243 243
 		</div>
Please login to merge, or discard this patch.
web/public/inbox_ajax.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,29 +17,29 @@  discard block
 block discarded – undo
17 17
 
18 18
     $results_per_page = 12;
19 19
     $number_of_result = $stmt->rowCount();
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
-    if($_GET['filter'] == "notification") {
30
+    if ($_GET['filter'] == "notification") {
31 31
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nt' ORDER BY id DESC LIMIT :pfirst, :pper");
32 32
         $stmt6->bindParam(":search", $search);
33 33
         $stmt6->bindParam(":pfirst", $page_first_result);
34 34
         $stmt6->bindParam(":pper", $results_per_page);
35 35
         $stmt6->execute();
36
-    } else if($_GET['filter'] == "sent") {
36
+    } else if ($_GET['filter'] == "sent") {
37 37
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE owner = :search ORDER BY id DESC LIMIT :pfirst, :pper");
38 38
         $stmt6->bindParam(":search", $search);
39 39
         $stmt6->bindParam(":pfirst", $page_first_result);
40 40
         $stmt6->bindParam(":pper", $results_per_page);
41 41
         $stmt6->execute(); 
42
-    } else if($_GET['filter'] == "pm") {
42
+    } else if ($_GET['filter'] == "pm") {
43 43
         $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nm' ORDER BY id DESC LIMIT :pfirst, :pper");
44 44
         $stmt6->bindParam(":search", $search);
45 45
         $stmt6->bindParam(":pfirst", $page_first_result);
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     </tr>
69 69
     
70 70
     <?php
71
-        while($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
72
-            if($__video_h->video_exists($inbox['video_attribute'])) {
71
+        while ($inbox = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
72
+            if ($__video_h->video_exists($inbox['video_attribute'])) {
73 73
                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
74 74
                 $inbox['video_attr_exists'] = true;
75 75
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     ?> 
84 84
     <tr style="margin-top: 5px;" id="videoslist">
85 85
             <!--
86
-            <?php if($inbox['readed'] == "n") { ?>
86
+            <?php if ($inbox['readed'] == "n") { ?>
87 87
                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
88 88
                 NEW
89 89
                 </a>
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
107 107
             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
108 108
             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
109
-            <?php if($inbox['video_attr_exists']) { ?>
109
+            <?php if ($inbox['video_attr_exists']) { ?>
110 110
                 <hr>
111 111
                 <ul>
112 112
                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
Please login to merge, or discard this patch.
web/public/inbox/compose.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,18 +10,18 @@
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <?php
15
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
15
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
16 16
         $error = array();
17 17
 
18
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; }
19
-        if(!$_POST['contents']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
20
-        if(empty(trim($_POST['subject']))){ $error['message'] = "Your subject cannot be blank"; $error['status'] = true; }
21
-        if(strlen($_POST['contents']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
22
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before sending a private message."; $error['status'] = true; }
18
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; }
19
+        if (!$_POST['contents']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; }
20
+        if (empty(trim($_POST['subject']))) { $error['message'] = "Your subject cannot be blank"; $error['status'] = true; }
21
+        if (strlen($_POST['contents']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; }
22
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before sending a private message."; $error['status'] = true; }
23 23
 
24
-        if(!isset($error['message'])) {
24
+        if (!isset($error['message'])) {
25 25
             $stmt = $__db->prepare("INSERT INTO pms (touser, subject, message, owner) VALUES (:touser, :subject, :message, :owner)");
26 26
             $stmt->bindParam(":subject", $_POST['subject']);
27 27
             $stmt->bindParam(":message", $_POST['contents']);
Please login to merge, or discard this patch.
web/public/inbox/notifications.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
                                     $stmt->execute();
166 166
 
167 167
                                     $number_of_result = $stmt->rowCount();
168
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
168
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
169 169
 
170
-                                    if (!isset ($_GET['page']) ) {  
170
+                                    if (!isset ($_GET['page'])) {  
171 171
                                         $page = 1;  
172 172
                                     } else {  
173
-                                        $page = (int)$_GET['page'];  
173
+                                        $page = (int) $_GET['page'];  
174 174
                                     }  
175 175
 
176
-                                    $page_first_result = ($page - 1) * $results_per_page;  
176
+                                    $page_first_result = ($page - 1)*$results_per_page;  
177 177
 
178 178
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nt' ORDER BY id DESC LIMIT :pfirst, :pper");
179 179
                                     $stmt6->bindParam(":search", $search);
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                                     </tr>
199 199
                                     
200 200
                                     <?php
201
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
201
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
203 203
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
204 204
                                                 $inbox['video_attr_exists'] = true;
205 205
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                                     ?> 
214 214
                                     <tr style="margin-top: 5px;" id="videoslist">
215 215
                                             <!--
216
-                                            <?php if($inbox['readed'] == "n") { ?>
216
+                                            <?php if ($inbox['readed'] == "n") { ?>
217 217
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
218 218
                                                 NEW
219 219
                                                 </a>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                                         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
237 237
                                             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
238 238
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
239
-                                            <?php if($inbox['video_attr_exists']) { ?>
239
+                                            <?php if ($inbox['video_attr_exists']) { ?>
240 240
                                                 <hr>
241 241
                                                 <ul>
242 242
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                                     </div>
264 264
                                 </center><br>
265 265
 
266
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
266
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
267 267
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
268 268
                                 <?php } ?>   
269 269
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                                 </script>
288 288
 
289 289
                                 <?php 
290
-                                    if($stmt6->rowCount() == 0) { echo "
290
+                                    if ($stmt6->rowCount() == 0) { echo "
291 291
                                         You currently have no notifications in your inbox.
292 292
                                     "; 
293 293
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/index.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
                                     $stmt->execute();
166 166
 
167 167
                                     $number_of_result = $stmt->rowCount();
168
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
168
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
169 169
 
170
-                                    if (!isset ($_GET['page']) ) {  
170
+                                    if (!isset ($_GET['page'])) {  
171 171
                                         $page = 1;  
172 172
                                     } else {  
173
-                                        $page = (int)$_GET['page'];  
173
+                                        $page = (int) $_GET['page'];  
174 174
                                     }  
175 175
 
176
-                                    $page_first_result = ($page - 1) * $results_per_page;  
176
+                                    $page_first_result = ($page - 1)*$results_per_page;  
177 177
 
178 178
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search ORDER BY id DESC LIMIT :pfirst, :pper");
179 179
                                     $stmt6->bindParam(":search", $search);
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                                     </tr>
199 199
                                     
200 200
                                     <?php
201
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
201
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
203 203
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
204 204
                                                 $inbox['video_attr_exists'] = true;
205 205
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                                     ?> 
214 214
                                     <tr style="margin-top: 5px;" id="videoslist">
215 215
                                             <!--
216
-                                            <?php if($inbox['readed'] == "n") { ?>
216
+                                            <?php if ($inbox['readed'] == "n") { ?>
217 217
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
218 218
                                                 NEW
219 219
                                                 </a>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                                         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
237 237
                                             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
238 238
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
239
-                                            <?php if($inbox['video_attr_exists']) { ?>
239
+                                            <?php if ($inbox['video_attr_exists']) { ?>
240 240
                                                 <hr>
241 241
                                                 <ul>
242 242
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                                     </div>
264 264
                                 </center><br>
265 265
 
266
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
266
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
267 267
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
268 268
                                 <?php } ?>   
269 269
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                                 </script>
288 288
 
289 289
                                 <?php 
290
-                                    if($stmt6->rowCount() == 0) { echo "
290
+                                    if ($stmt6->rowCount() == 0) { echo "
291 291
                                         You currently have no messages in your inbox.
292 292
                                     "; 
293 293
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/sent.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
                                     $stmt->execute();
166 166
 
167 167
                                     $number_of_result = $stmt->rowCount();
168
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
168
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
169 169
 
170
-                                    if (!isset ($_GET['page']) ) {  
170
+                                    if (!isset ($_GET['page'])) {  
171 171
                                         $page = 1;  
172 172
                                     } else {  
173
-                                        $page = (int)$_GET['page'];  
173
+                                        $page = (int) $_GET['page'];  
174 174
                                     }  
175 175
 
176
-                                    $page_first_result = ($page - 1) * $results_per_page;  
176
+                                    $page_first_result = ($page - 1)*$results_per_page;  
177 177
 
178 178
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE owner = :search ORDER BY id DESC LIMIT :pfirst, :pper");
179 179
                                     $stmt6->bindParam(":search", $search);
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                                     </tr>
199 199
                                     
200 200
                                     <?php
201
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
201
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
203 203
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
204 204
                                                 $inbox['video_attr_exists'] = true;
205 205
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                                     ?> 
214 214
                                     <tr style="margin-top: 5px;" id="videoslist">
215 215
                                             <!--
216
-                                            <?php if($inbox['readed'] == "n") { ?>
216
+                                            <?php if ($inbox['readed'] == "n") { ?>
217 217
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
218 218
                                                 NEW
219 219
                                                 </a>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                                         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
237 237
                                             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
238 238
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
239
-                                            <?php if($inbox['video_attr_exists']) { ?>
239
+                                            <?php if ($inbox['video_attr_exists']) { ?>
240 240
                                                 <hr>
241 241
                                                 <ul>
242 242
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                                     </div>
264 264
                                 </center><br>
265 265
 
266
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
266
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
267 267
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
268 268
                                 <?php } ?>   
269 269
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                                 </script>
288 288
 
289 289
                                 <?php 
290
-                                    if($stmt6->rowCount() == 0) { echo "
290
+                                    if ($stmt6->rowCount() == 0) { echo "
291 291
                                         You currently have no sent messages in your inbox.
292 292
                                     "; 
293 293
                                 } ?>
Please login to merge, or discard this patch.
web/public/inbox/pm.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
                                     $stmt->execute();
166 166
 
167 167
                                     $number_of_result = $stmt->rowCount();
168
-                                    $number_of_page = ceil ($number_of_result / $results_per_page);  
168
+                                    $number_of_page = ceil($number_of_result/$results_per_page);  
169 169
 
170
-                                    if (!isset ($_GET['page']) ) {  
170
+                                    if (!isset ($_GET['page'])) {  
171 171
                                         $page = 1;  
172 172
                                     } else {  
173
-                                        $page = (int)$_GET['page'];  
173
+                                        $page = (int) $_GET['page'];  
174 174
                                     }  
175 175
 
176
-                                    $page_first_result = ($page - 1) * $results_per_page;  
176
+                                    $page_first_result = ($page - 1)*$results_per_page;  
177 177
 
178 178
                                     $stmt6 = $__db->prepare("SELECT * FROM pms WHERE touser = :search AND type = 'nm' ORDER BY id DESC LIMIT :pfirst, :pper");
179 179
                                     $stmt6->bindParam(":search", $search);
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                                     </tr>
199 199
                                     
200 200
                                     <?php
201
-                                        while($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
-                                            if($__video_h->video_exists($inbox['video_attribute'])) {
201
+                                        while ($inbox = $stmt->fetch(PDO::FETCH_ASSOC)) { 
202
+                                            if ($__video_h->video_exists($inbox['video_attribute'])) {
203 203
                                                 $inbox['video'] = $__video_h->fetch_video_rid($inbox['video_attribute']);
204 204
                                                 $inbox['video_attr_exists'] = true;
205 205
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                                     ?> 
214 214
                                     <tr style="margin-top: 5px;" id="videoslist">
215 215
                                             <!--
216
-                                            <?php if($inbox['readed'] == "n") { ?>
216
+                                            <?php if ($inbox['readed'] == "n") { ?>
217 217
                                                 <a style="position:relative;top:7px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/">
218 218
                                                 NEW
219 219
                                                 </a>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                                         <td class="video-manager-stats" style="background: none;padding-left: 8px;">
237 237
                                             <h3><?php echo htmlspecialchars($inbox['subject']); ?></h3>
238 238
                                             <?php echo $__video_h->shorten_description($inbox['message'], 300, true); ?>
239
-                                            <?php if($inbox['video_attr_exists']) { ?>
239
+                                            <?php if ($inbox['video_attr_exists']) { ?>
240 240
                                                 <hr>
241 241
                                                 <ul>
242 242
                                                     <li class="video-list-item "><a href="/watch?v=<?php echo $inbox['video']['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&amp;feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $inbox['video']['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $inbox['video']['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $inbox['video']['duration']; ?></span>
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                                     </div>
264 264
                                 </center><br>
265 265
 
266
-                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?>
266
+                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?>
267 267
                                     <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch(<?php echo $page; ?>)"><?php echo $page; ?></button>
268 268
                                 <?php } ?>   
269 269
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                                 </script>
288 288
 
289 289
                                 <?php 
290
-                                    if($stmt6->rowCount() == 0) { echo "
290
+                                    if ($stmt6->rowCount() == 0) { echo "
291 291
                                         You currently have no personal messages in your inbox.
292 292
                                     "; 
293 293
                                 } ?>
Please login to merge, or discard this patch.
web/public/watch.php 2 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
         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; }
26 26
 
27 27
         if(!isset($error['message'])) {
28
-			$text = $_POST['comment'];
28
+            $text = $_POST['comment'];
29 29
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
30 30
             $stmt->bindParam(":v", $_GET['v']);
31
-			$stmt->bindParam(":username", $_SESSION['siteusername']);
32
-			$stmt->bindParam(":comment", $text);
31
+            $stmt->bindParam(":username", $_SESSION['siteusername']);
32
+            $stmt->bindParam(":comment", $text);
33 33
             $stmt->execute();
34 34
 
35
-			$__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
36
-			$__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
35
+            $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment");
36
+            $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt");
37 37
         }
38 38
     }
39 39
 ?>
@@ -65,29 +65,29 @@  discard block
 block discarded – undo
65 65
          if (window.yt.timing) {yt.timing.tick("ct");}    
66 66
       </script>
67 67
 		<?php
68
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
69
-			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
68
+            $_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
69
+            $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
70 70
 
71
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
72
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
71
+            $_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
72
+            $_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
73 73
 
74
-			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
75
-			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
74
+            $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
75
+            $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
76 76
 
77
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
78
-				$_video['likeswidth'] = 50;
79
-				$_video['dislikeswidth'] = 50;
80
-			} else {
81
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
82
-				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
83
-			}
77
+            if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
78
+                $_video['likeswidth'] = 50;
79
+                $_video['dislikeswidth'] = 50;
80
+            } else {
81
+                $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
82
+                $_video['dislikeswidth'] = 100 - $_video['likeswidth'];
83
+            }
84 84
 
85
-			$_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
86
-			$_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
87
-			$_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
88
-			$_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
89
-			$_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
90
-		?>
85
+            $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true);
86
+            $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false);
87
+            $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']);
88
+            $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']);
89
+            $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']);
90
+        ?>
91 91
 	</head>
92 92
 	<body id="" class="date-20120927 en_US ltr   ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr">
93 93
 		<form name="logoutForm" method="POST" action="/logout">
@@ -306,21 +306,21 @@  discard block
 block discarded – undo
306 306
 													<hr><br>
307 307
 													<h3>Add to a Playlist</h3>
308 308
 													<?php
309
-														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
310
-														$stmt->bindParam(":username", $_SESSION['siteusername']);
311
-														$stmt->execute();
312
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
313
-															$buffer = json_decode($playlist['videos']);
314
-															@$rid = $buffer[0];
315
-															if(!empty($rid)) {
316
-																@$video = $__video_h->fetch_video_rid($rid);
317
-															} else {
318
-																$video['thumbnail'] = "";
319
-																$video['duration'] = 0;
320
-															}
309
+                                                        $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
310
+                                                        $stmt->bindParam(":username", $_SESSION['siteusername']);
311
+                                                        $stmt->execute();
312
+                                                        while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
313
+                                                            $buffer = json_decode($playlist['videos']);
314
+                                                            @$rid = $buffer[0];
315
+                                                            if(!empty($rid)) {
316
+                                                                @$video = $__video_h->fetch_video_rid($rid);
317
+                                                            } else {
318
+                                                                $video['thumbnail'] = "";
319
+                                                                $video['duration'] = 0;
320
+                                                            }
321 321
 
322
-															$videos = count($buffer);
323
-													?>
322
+                                                            $videos = count($buffer);
323
+                                                    ?>
324 324
 														<a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a>
325 325
 													<?php } ?>
326 326
 												<?php } ?>
@@ -585,10 +585,10 @@  discard block
 block discarded – undo
585 585
 												</div>
586 586
 											</div>
587 587
 											<?php 
588
-												$stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
589
-												$stmt->bindParam(":v", $_GET['v']);
590
-												$stmt->execute();
591
-											?>
588
+                                                $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4");
589
+                                                $stmt->bindParam(":v", $_GET['v']);
590
+                                                $stmt->execute();
591
+                                            ?>
592 592
 
593 593
 											<?php if($stmt->rowCount() != 0) { ?>
594 594
 												<div class="comments-section">
@@ -598,16 +598,16 @@  discard block
 block discarded – undo
598 598
 													<h4>Video Responses</h4>
599 599
 													<ul class="video-list">
600 600
 													<?php 
601
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
602
-															if($__video_h->video_exists($video['video'])) { 
603
-																$video = $__video_h->fetch_video_rid($video['video']);
604
-																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
605
-																$video['duration'] = $__time_h->timestamp($video['duration']);
606
-																$video['views'] = $__video_h->fetch_video_views($video['rid']);
607
-																$video['author'] = htmlspecialchars($video['author']);		
608
-																$video['title'] = htmlspecialchars($video['title']);
609
-																$video['description'] = $__video_h->shorten_description($video['description'], 50);
610
-													?>
601
+                                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
602
+                                                            if($__video_h->video_exists($video['video'])) { 
603
+                                                                $video = $__video_h->fetch_video_rid($video['video']);
604
+                                                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
605
+                                                                $video['duration'] = $__time_h->timestamp($video['duration']);
606
+                                                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
607
+                                                                $video['author'] = htmlspecialchars($video['author']);		
608
+                                                                $video['title'] = htmlspecialchars($video['title']);
609
+                                                                $video['description'] = $__video_h->shorten_description($video['description'], 50);
610
+                                                    ?>
611 611
 														<li class="video-list-item yt-tile-default">
612 612
 															<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>
613 613
 															<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">
@@ -689,31 +689,31 @@  discard block
 block discarded – undo
689 689
 												</div>
690 690
 												<ul class="comment-list" id="live_comments">
691 691
 														<?php
692
-														$results_per_page = 20;
692
+                                                        $results_per_page = 20;
693 693
 
694
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
695
-														$stmt->bindParam(":rid", $_video['rid']);
696
-														$stmt->execute();
694
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC");
695
+                                                        $stmt->bindParam(":rid", $_video['rid']);
696
+                                                        $stmt->execute();
697 697
 
698
-														$number_of_result = $stmt->rowCount();
699
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
698
+                                                        $number_of_result = $stmt->rowCount();
699
+                                                        $number_of_page = ceil ($number_of_result / $results_per_page);  
700 700
 
701
-														if (!isset ($_GET['page']) ) {  
702
-															$page = 1;  
703
-														} else {  
704
-															$page = (int)$_GET['page'];  
705
-														}  
701
+                                                        if (!isset ($_GET['page']) ) {  
702
+                                                            $page = 1;  
703
+                                                        } else {  
704
+                                                            $page = (int)$_GET['page'];  
705
+                                                        }  
706 706
 
707
-														$page_first_result = ($page - 1) * $results_per_page;  
707
+                                                        $page_first_result = ($page - 1) * $results_per_page;  
708 708
 
709
-														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
710
-														$stmt->bindParam(":rid", $_video['rid']);
711
-														$stmt->bindParam(":pfirst", $page_first_result);
712
-														$stmt->bindParam(":pper", $results_per_page);
713
-														$stmt->execute();
709
+                                                        $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
710
+                                                        $stmt->bindParam(":rid", $_video['rid']);
711
+                                                        $stmt->bindParam(":pfirst", $page_first_result);
712
+                                                        $stmt->bindParam(":pper", $results_per_page);
713
+                                                        $stmt->execute();
714 714
 
715
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
716
-													?>
715
+                                                        while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
716
+                                                    ?>
717 717
 
718 718
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
719 719
 														<div class="comment-body">
@@ -792,16 +792,16 @@  discard block
 block discarded – undo
792 792
 											<ul id="watch-related" class="video-list">
793 793
 												<div id="ppv-container" class="hid"></div>
794 794
 												<?php
795
-													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
796
-													$stmt->execute();
797
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
798
-														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
799
-														$video['duration'] = $__time_h->timestamp($video['duration']);
800
-														$video['views'] = $__video_h->fetch_video_views($video['rid']);
801
-														$video['author'] = htmlspecialchars($video['author']);		
802
-														$video['title'] = htmlspecialchars($video['title']);
803
-														$video['description'] = $__video_h->shorten_description($video['description'], 50);
804
-												?>
795
+                                                    $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
796
+                                                    $stmt->execute();
797
+                                                    while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
798
+                                                        $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
799
+                                                        $video['duration'] = $__time_h->timestamp($video['duration']);
800
+                                                        $video['views'] = $__video_h->fetch_video_views($video['rid']);
801
+                                                        $video['author'] = htmlspecialchars($video['author']);		
802
+                                                        $video['title'] = htmlspecialchars($video['title']);
803
+                                                        $video['description'] = $__video_h->shorten_description($video['description'], 50);
804
+                                                ?>
805 805
 												<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']; ?>" 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>
806 806
 													<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">
807 807
 													</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   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@  discard block
 block discarded – undo
12 12
 <?php $__user_u = new user_update($__db); ?>
13 13
 <?php $__db_h = new db_helper(); ?>
14 14
 <?php $__time_h = new time_helper(); ?>
15
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
15
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
16 16
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
17 17
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
18 18
 <?php
19
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
19
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
20 20
         $error = array();
21 21
 
22
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
23
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
24
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
25
-        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; }
22
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
23
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
24
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
25
+        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; }
26 26
 
27
-        if(!isset($error['message'])) {
27
+        if (!isset($error['message'])) {
28 28
 			$text = $_POST['comment'];
29 29
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
30 30
             $stmt->bindParam(":v", $_GET['v']);
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
          if (window.yt.timing) {yt.timing.tick("ct");}    
66 66
       </script>
67 67
 		<?php
68
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
68
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
69 69
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
70 70
 
71
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
72
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
71
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
72
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
73 73
 
74 74
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
75 75
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
76 76
 
77
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
77
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
78 78
 				$_video['likeswidth'] = 50;
79 79
 				$_video['dislikeswidth'] = 50;
80 80
 			} else {
81
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
81
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
82 82
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
83 83
 			}
84 84
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 									</div>
113 113
 									<div id="instream_google_companion_ad_div"></div>
114 114
 								</div>
115
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
115
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
116 116
 									<div id="watch-owner-container">
117 117
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
118 118
 											<ul class="yt-nav-aside">
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 											title="" 
148 148
 											id="subscribe-button"
149 149
 											type="button" 
150
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
150
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
151 151
 											role="button">
152 152
 											<span class="yt-uix-button-icon-wrapper">
153 153
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 											<button onclick=";window.location.href=this.getAttribute('href');return false;"
226 226
 											title="I like this" 
227 227
 											type="button" 
228
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
228
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
229 229
 											id="watch-like"  
230 230
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
231 231
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 											type="button" 
240 240
 											style="margin-left: -2px;"
241 241
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
242
-											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" 
242
+											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" 
243 243
 											id="watch-unlike" 
244 244
 											role="button">
245 245
 												<span class="yt-uix-button-icon-wrapper">
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 												not implemented ismnf
258 258
 											</div>
259 259
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
260
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
260
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
261 261
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
262 262
 													<div class="yt-alert-icon">
263 263
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 												<?php } else { ?>
274 274
 													<h3>Be friends with the creator</h3>
275 275
 
276
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
276
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
277 277
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
278 278
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
279 279
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
 														</span><br><br>
288 288
 													<?php } ?>
289 289
 
290
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
291
-														<?php if($_video['friended'] == false) { ?>
290
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
291
+														<?php if ($_video['friended'] == false) { ?>
292 292
 															<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Send a friend request</a>
293 293
 														<?php } else { ?>
294 294
 															Your friend request is pending.
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 													<?php } ?>
299 299
 													<hr><br>
300 300
 													<h3>Add to Favorites</h3>
301
-													<?php if($_video['favorited'] == false) { ?>
301
+													<?php if ($_video['favorited'] == false) { ?>
302 302
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
303 303
 													<?php } else { ?>
304 304
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
310 310
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
311 311
 														$stmt->execute();
312
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
312
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
313 313
 															$buffer = json_decode($playlist['videos']);
314 314
 															@$rid = $buffer[0];
315
-															if(!empty($rid)) {
315
+															if (!empty($rid)) {
316 316
 																@$video = $__video_h->fetch_video_rid($rid);
317 317
 															} else {
318 318
 																$video['thumbnail'] = "";
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 												$stmt->execute();
591 591
 											?>
592 592
 
593
-											<?php if($stmt->rowCount() != 0) { ?>
593
+											<?php if ($stmt->rowCount() != 0) { ?>
594 594
 												<div class="comments-section">
595 595
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
596 596
 													see all
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
 													<h4>Video Responses</h4>
599 599
 													<ul class="video-list">
600 600
 													<?php 
601
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
602
-															if($__video_h->video_exists($video['video'])) { 
601
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
602
+															if ($__video_h->video_exists($video['video'])) { 
603 603
 																$video = $__video_h->fetch_video_rid($video['video']);
604 604
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
605 605
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -630,19 +630,19 @@  discard block
 block discarded – undo
630 630
 														</h4>
631 631
 													</div>
632 632
 												</div>
633
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
633
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
634 634
 													<div class="comments-post-container clearfix">
635 635
 														<div class="comments-post-alert">
636 636
 															<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>
637 637
 														</div>
638 638
 													</div>
639
-												<?php } else if($_video['commenting'] == "d") { ?>
639
+												<?php } else if ($_video['commenting'] == "d") { ?>
640 640
 													<div class="comments-post-container clearfix">
641 641
 														<div class="comments-post-alert">
642 642
 															This video has comemnting disabled!
643 643
 														</div>
644 644
 													</div>
645
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
645
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
646 646
 													<div class="comments-post-container clearfix">
647 647
 														<div class="comments-post-alert">
648 648
 															This user has blocked you!
@@ -696,15 +696,15 @@  discard block
 block discarded – undo
696 696
 														$stmt->execute();
697 697
 
698 698
 														$number_of_result = $stmt->rowCount();
699
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
699
+														$number_of_page = ceil($number_of_result/$results_per_page);  
700 700
 
701
-														if (!isset ($_GET['page']) ) {  
701
+														if (!isset ($_GET['page'])) {  
702 702
 															$page = 1;  
703 703
 														} else {  
704
-															$page = (int)$_GET['page'];  
704
+															$page = (int) $_GET['page'];  
705 705
 														}  
706 706
 
707
-														$page_first_result = ($page - 1) * $results_per_page;  
707
+														$page_first_result = ($page - 1)*$results_per_page;  
708 708
 
709 709
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
710 710
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 														$stmt->bindParam(":pper", $results_per_page);
713 713
 														$stmt->execute();
714 714
 
715
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
715
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
716 716
 													?>
717 717
 
718 718
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 												<?php
795 795
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
796 796
 													$stmt->execute();
797
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
797
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
798 798
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
799 799
 														$video['duration'] = $__time_h->timestamp($video['duration']);
800 800
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/subscriptions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_h = new user_helper($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <!DOCTYPE html>
15 15
 <html dir="ltr">
16 16
 	<head>
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                                 ?>                    
161 161
                                 
162 162
                                 <div class="my_videos_ajax">                                  
163
-                                    <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
163
+                                    <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
164 164
                                         <div>
165 165
                                             <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>">
166 166
                                             <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;">
Please login to merge, or discard this patch.