Completed
Push — master ( 2b2543...142619 )
by mains
04:12 queued 01:31
created
index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
111 111
 								<h2>Comment on Jodel</h2>
112 112
 								<form method="POST">				
113
-										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
113
+										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" />
114 114
 										<textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> 
115 115
 									<br />
116 116
 									<input type="submit" value="SEND" /> 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 					</div>
144 144
 				</aside>
145 145
 			</div>
146
-			<?php include 'templates/nav-bottom.php';?>
146
+			<?php include 'templates/nav-bottom.php'; ?>
147 147
 		</div>
148 148
 		<?php
149 149
 			$includeEmojiAndAjax = TRUE;
Please login to merge, or discard this patch.
error-pages/404.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 		</article>
67 67
 	</div>
68 68
 </div>
69
-<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php');?>
70 69
\ No newline at end of file
70
+<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php'); ?>
71 71
\ No newline at end of file
Please login to merge, or discard this patch.
error-pages/410.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 		</article>
67 67
 	</div>
68 68
 </div>
69
-<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php');?>
70 69
\ No newline at end of file
70
+<?php include(realpath(__DIR__ . '/..') . '/templates/footer.php'); ?>
71 71
\ No newline at end of file
Please login to merge, or discard this patch.
admin.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 
5 5
 if((!isset($_GET['pw']) || $config['pw'] != $_GET['pw']) && !isUserAdmin())
6 6
 {
7
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on admin.php');
7
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on admin.php');
8 8
 	die();
9 9
 }
10
-else if (isset($_GET['pw']))
10
+else if(isset($_GET['pw']))
11 11
 {
12
-	setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10);
12
+	setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10);
13 13
 	error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
14 14
 }
15 15
 
@@ -61,42 +61,42 @@  discard block
 block discarded – undo
61 61
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client">
62 62
 		
63 63
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
64
-				<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
65
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
64
+				<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
65
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
66 66
 		
67
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
68
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
69
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
70
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
71
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
72
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
73
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
74
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
75
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
76
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
77
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
78
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
79
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
80
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
81
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
82
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
83
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
84
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
85
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
86
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
87
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
88
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
89
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
67
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
68
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
69
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
70
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
71
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
72
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
73
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
74
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
75
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
76
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
77
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
78
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
79
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
80
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
81
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
82
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
83
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
84
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
85
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
86
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
87
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
88
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
89
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
90 90
 		<meta name="msapplication-TileColor" content="#5682a3"> 
91 91
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
92 92
 		<meta name="application-name" content="JodelBlue"/> 
93 93
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
94 94
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
95
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
96
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
97
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
98
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
99
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
95
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
96
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
97
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
98
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
99
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
100 100
 	</head>
101 101
 	
102 102
 	<body>
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 			{
200 200
 				$.ajax({
201 201
 				  type: "POST",
202
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
202
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>",
203 203
 				  data: {"vote" : data["vote"],
204 204
 						 "postId" : data["id"]},
205 205
 				  success: function(result){
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				console.log(solution);
247 247
 				$.ajax({
248 248
 				  type: "POST",
249
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
249
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?pw=<?php echo $_GET["pw"]?>&solution=" + solution + "&key="+key,
250 250
 				  data: {"deviceUid" : deviceUid},
251 251
 				  success: function(result){
252 252
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.
vote-ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 if((!isset($_GET['pw']) || $config['pw'] != $_GET['pw']) && !isUserAdmin())
5 5
 {
6
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php');
7
-	$respone = array("message" => $_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php',"success" => false);
6
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php');
7
+	$respone = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false);
8 8
 	echo json_encode($response);
9 9
 	die();
10 10
 }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		}
55 55
 	}
56 56
 
57
-if (isset($captcha))
57
+if(isset($captcha))
58 58
 {
59 59
 	$response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid);
60 60
 }
Please login to merge, or discard this patch.
php/View.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -49,25 +49,25 @@  discard block
 block discarded – undo
49 49
         $timediff_inDays = (string)$timediff->format('%d');
50 50
         $timediff_inMonth = (string)$timediff->format('%m');
51 51
 
52
-        if($timediff_inMonth!=0)
52
+        if($timediff_inMonth != 0)
53 53
         {
54 54
                 $timediff = $timediff_inMonth . "m";
55 55
         }
56 56
         else
57 57
         {
58
-            if($timediff_inDays!=0)
58
+            if($timediff_inDays != 0)
59 59
             {
60 60
                 $timediff = $timediff_inDays . "d";
61 61
             }
62 62
             else
63 63
             {
64
-                if($timediff_inHours!=0)
64
+                if($timediff_inHours != 0)
65 65
                 {
66 66
                     $timediff = $timediff_inHours . "h";
67 67
                 }
68 68
                 else
69 69
                 {
70
-                    if($timediff_inMinutes!=0)
70
+                    if($timediff_inMinutes != 0)
71 71
                     {
72 72
                         $timediff = $timediff_inMinutes . "m";
73 73
                     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 
83 83
         ?>
84
-        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
84
+        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;">
85 85
             <content>
86 86
                 <?php 
87 87
                 if(isset($post['image_url']))
@@ -99,24 +99,24 @@  discard block
 block discarded – undo
99 99
                 <?php
100 100
                     if($this->isDetailedView)
101 101
                     {?>
102
-                        <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
102
+                        <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow">
103 103
               <?php }
104 104
                     else
105 105
                     {?>
106
-                        <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow">
106
+                        <a href="index.php?vote=up&postId=<?php echo $post['post_id']; ?>" rel="nofollow">
107 107
               <?php } ?>
108 108
                             <i class="fa fa-angle-up fa-3x"></i>
109 109
                         </a>    
110 110
                             <br />
111
-                        <?php echo $post["vote_count"];?><br />
111
+                        <?php echo $post["vote_count"]; ?><br />
112 112
                 <?php
113 113
                     if($this->isDetailedView)
114 114
                     {?>
115
-                        <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
115
+                        <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow">
116 116
               <?php }
117 117
                     else
118 118
                     {?>
119
-                        <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow">
119
+                        <a href="index.php?vote=down&postId=<?php echo $post['post_id']; ?>" rel="nofollow">
120 120
               <?php } ?>
121 121
                             <i class="fa fa-angle-down fa-3x"></i>
122 122
                         </a>
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
                         <span class="time">
129 129
                             <span class="tip" data-tooltip="Time">
130 130
                                 <i class="fa fa-clock-o"></i>
131
-                                <?php echo $timediff;?>
132
-                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
131
+                                <?php echo $timediff; ?>
132
+                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
133 133
                             </span> 
134 134
                         </span>
135 135
 						<?php if(!$this->isDetailedView) {?>
136 136
                         <span class="comments">
137 137
                             <span data-tooltip="Comments">
138
-                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
138
+                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>">
139 139
                                     <i class="fa fa-commenting-o"></i>
140 140
                                     <?php if(array_key_exists("child_count", $post)) {
141 141
                                                 echo $post["child_count"];
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         </span>
148 148
 						<?php
149 149
 						}															  
150
-						if (isUserAdmin())
150
+						if(isUserAdmin())
151 151
 						{
152 152
 						?>
153 153
 						<span class="voting">
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         {
178 178
                                             ?>
179 179
                                             <span data-tooltip="Author">
180
-                                                <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> |
180
+                                                <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> |
181 181
                                             </span>
182 182
                                             <?php
183 183
                                         }
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 
188 188
                             <span class="tip" data-tooltip="Distance">
189 189
                                 <i class="fa fa-map-marker"></i>
190
-                                <?php echo $post['distance'];?> km
191
-                                <span class="tiptext"><?php echo $post['location']['name'];?></span>
190
+                                <?php echo $post['distance']; ?> km
191
+                                <span class="tiptext"><?php echo $post['location']['name']; ?></span>
192 192
                             </span>
193 193
                         </span>
194 194
                     
Please login to merge, or discard this patch.
php/jodel-web.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 function user_log($msg)
41 41
 {
42
-    $log  = $msg . PHP_EOL;
42
+    $log = $msg . PHP_EOL;
43 43
     error_log(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt');
44 44
     file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND);
45 45
 }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 {
49 49
     preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
50 50
 
51
-    return (isset($matches[0])) ? true : false;
51
+    return (isset($matches[0]))?true : false;
52 52
 }
53 53
 
54 54
 function configPropertyExists($config, $property)
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 }
65 65
 function isUserAdmin() {
66 66
 	global $config;
67
-	if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
67
+	if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
68 68
 	{
69 69
 		return TRUE;
70 70
 	}
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 function isDeviceUidInDatabase($deviceUid)
78 78
 {
79 79
     $db = new DatabaseConnect();  
80
-    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
80
+    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
81 81
 
82
-    if ($result->num_rows > 0)
82
+    if($result->num_rows > 0)
83 83
     {
84 84
         return TRUE;
85 85
     }
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 		if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId']))
102 102
 		{
103 103
 			$jodelAccountForView = new JodelAccount();
104
-			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10);
105
-			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid .  ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
104
+			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10);
105
+			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
106 106
 			
107 107
 		}
108 108
 		else
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	
184 184
 	if(isset($_GET['view']))
185 185
 	{
186
-		switch ($_GET['view']) {
186
+		switch($_GET['view']) {
187 187
 			case 'discussed':
188 188
 				$view = 'discussed';
189 189
 				break;
Please login to merge, or discard this patch.
php/JodelAccount.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         {
36 36
             $this->refreshToken();
37 37
         }
38
-        $this->accessToken  = $this->getAccessToken();
38
+        $this->accessToken = $this->getAccessToken();
39 39
     }
40 40
 
41 41
     function isAccountVerified()
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         $db = new DatabaseConnect();
67
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
67
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
68 68
         
69 69
         $location = new Location();
70 70
         
71
-        if ($result->num_rows > 0)
71
+        if($result->num_rows > 0)
72 72
         {
73 73
             // output data of each row
74 74
             while($row = $result->fetch_assoc())
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     }
142 142
                     else
143 143
                     {
144
-                        user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
144
+                        user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
145 145
                     }
146 146
                 }
147 147
 
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
     function getLocation()
154 154
     {
155 155
         $db = new DatabaseConnect();
156
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
156
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
157 157
         
158 158
         $location = new Location();
159 159
         
160
-        if ($result->num_rows > 0)
160
+        if($result->num_rows > 0)
161 161
         {
162 162
             // output data of each row
163 163
             while($row = $result->fetch_assoc())
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         if(isset($_POST['color']))
263 263
         {
264 264
             $color = $_POST['color'];
265
-            switch ($color) {
265
+            switch($color) {
266 266
                 case '8ABDB0':
267 267
                     $color = '8ABDB0';
268 268
                     break;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $db = new DatabaseConnect();  
316 316
         $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
317 317
 
318
-        if ($result->num_rows > 0)
318
+        if($result->num_rows > 0)
319 319
         {
320 320
             // output data of each row
321 321
             while($row = $result->fetch_assoc())
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                                     expiration_date='" . $expiration_date . "'
355 355
                                 WHERE device_uid='" . $device_uid . "'");
356 356
 
357
-        if($result === false){
357
+        if($result === false) {
358 358
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
359 359
         }   
360 360
     }
@@ -364,11 +364,11 @@  discard block
 block discarded – undo
364 364
     function getAccessToken()
365 365
     {
366 366
         $db = new DatabaseConnect();
367
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
367
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
368 368
         
369 369
         $accessToken;
370 370
         
371
-        if ($result->num_rows > 0)
371
+        if($result->num_rows > 0)
372 372
         {
373 373
             // output data of each row
374 374
             while($row = $result->fetch_assoc())
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
435 435
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
436 436
         
437
-        if($result === false){
437
+        if($result === false) {
438 438
                 $error = db_error();
439 439
                 echo $error;
440 440
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -462,11 +462,11 @@  discard block
 block discarded – undo
462 462
         $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
463 463
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
464 464
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
465
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
465
+                        "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
466 466
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
467 467
 
468 468
         $success = TRUE;
469
-        if($result === false){
469
+        if($result === false) {
470 470
                 $error = db_error();
471 471
                 echo $error;
472 472
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.