Completed
Push — master ( 1b4b29...5edd0c )
by mains
02:53
created
php/jodel-web.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	$db = new DatabaseConnect();  
24 24
 	$result = $db->query("SELECT * FROM accounts WHERE id='1'");
25 25
 	
26
-	if ($result->num_rows > 0)
26
+	if($result->num_rows > 0)
27 27
 	{
28 28
 			// output data of each row
29 29
 			while($row = $result->fetch_assoc()) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 	if($expiration_date <= time()) {
42 42
 		$accountCreator = new CreateUser();
43
-		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
43
+		$accountCreator->setAccessToken($access_token); //$accountData->getAccessToken());
44 44
 		$accountCreator->setDeviceUid($deviceUid);
45 45
 		$accountCreator->setLocation($location);
46 46
 		$data = $accountCreator->execute();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 									expiration_date='" . $expiration_date . "'
56 56
 								WHERE device_uid='" . $device_uid . "'");
57 57
 
58
-		if($result === false){
58
+		if($result === false) {
59 59
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
60 60
 		}	
61 61
 	}
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	$db = new DatabaseConnect();  
69 69
 	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'");
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()) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	if($expiration_date <= time()) {
87 87
 		$accountCreator = new CreateUser();
88
-		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
88
+		$accountCreator->setAccessToken($access_token); //$accountData->getAccessToken());
89 89
 		$accountCreator->setDeviceUid($deviceUid);
90 90
 		$accountCreator->setLocation($location);
91 91
 		$data = $accountCreator->execute();
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 									expiration_date='" . $expiration_date . "'
101 101
 								WHERE device_uid='" . $device_uid . "'");
102 102
 
103
-		if($result === false){
103
+		if($result === false) {
104 104
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
105 105
 		}	
106 106
 	}
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
 function getLocationByAccessToken($accessToken)
112 112
 {
113 113
 	$db = new DatabaseConnect();
114
-	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken  . "'");
114
+	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'");
115 115
 	
116 116
 	$location = new Location();
117 117
 	
118
-	if ($result->num_rows > 0)
118
+	if($result->num_rows > 0)
119 119
 	{
120 120
 		// output data of each row
121 121
 		while($row = $result->fetch_assoc())
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 	$result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
165 165
 					expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
166 166
 					VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
167
-					"','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
167
+					"','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
168 168
 					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
169 169
 
170 170
 	$success = TRUE;
171
-	if($result === false){
171
+	if($result === false) {
172 172
 			$error = db_error();
173 173
 			echo $error;
174 174
 			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
@@ -224,25 +224,25 @@  discard block
 block discarded – undo
224 224
 	$timediff_inDays = (string)$timediff->format('%d');
225 225
 	$timediff_inMonth = (string)$timediff->format('%m');
226 226
 
227
-	if($timediff_inMonth!=0)
227
+	if($timediff_inMonth != 0)
228 228
 	{
229 229
 			$timediff = $timediff_inMonth . "m";
230 230
 	}
231 231
 	else
232 232
 	{
233
-		if($timediff_inDays!=0)
233
+		if($timediff_inDays != 0)
234 234
 		{
235 235
 			$timediff = $timediff_inDays . "d";
236 236
 		}
237 237
 		else
238 238
 		{
239
-			if($timediff_inHours!=0)
239
+			if($timediff_inHours != 0)
240 240
 			{
241 241
 				$timediff = $timediff_inHours . "h";
242 242
 			}
243 243
 			else
244 244
 			{
245
-				if($timediff_inMinutes!=0)
245
+				if($timediff_inMinutes != 0)
246 246
 				{
247 247
 					$timediff = $timediff_inMinutes . "m";
248 248
 				}
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
 
258 258
 	?>
259
-	<article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"];?>;">
259
+	<article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"]; ?>;">
260 260
 		<content>
261 261
 			<?php 
262 262
 			if(isset($post["image_url"])) {
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 			?>
269 269
 		</content>
270 270
 		<aside>
271
-			<a href="index.php?vote=up&postID=<?php echo $post["post_id"];?>">
271
+			<a href="index.php?vote=up&postID=<?php echo $post["post_id"]; ?>">
272 272
 				<i class="fa fa-angle-up fa-3x"></i>
273 273
 			</a>	
274 274
 				<br />
275
-			<?php echo $post["vote_count"];?><br />
276
-			<a href="index.php?vote=down&postID=<?php echo $post["post_id"];?>">
275
+			<?php echo $post["vote_count"]; ?><br />
276
+			<a href="index.php?vote=down&postID=<?php echo $post["post_id"]; ?>">
277 277
 				<i class="fa fa-angle-down fa-3x"></i>
278 278
 			</a>
279 279
 		</aside>
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 					<td class="time">
285 285
 						<span class="tip" data-tooltip="Time">
286 286
 							<i class="fa fa-clock-o"></i>
287
-							<?php echo $timediff;?>
288
-							<span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
287
+							<?php echo $timediff; ?>
288
+							<span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
289 289
 						</span> 
290 290
 					</td>
291 291
 					<td class="comments">
292 292
 						<?php if(!$isDetailedView) {?>
293 293
 						<span data-tooltip="Comments">
294
-							<a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $post["post_id"];?>">
294
+							<a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $post["post_id"]; ?>">
295 295
 								<i class="fa fa-commenting-o"></i>
296 296
 								<?php if(array_key_exists("child_count", $post)) {
297 297
 											echo $post["child_count"];
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 									{
321 321
 							  			?>
322 322
 							  			<span data-tooltip="Author">
323
-											<i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> |
323
+											<i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> |
324 324
 										</span>
325 325
 										<?php
326 326
 									}
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 
331 331
 						<span class="tip" data-tooltip="Distance">
332 332
 							<i class="fa fa-map-marker"></i>
333
-							<?php echo $post['distance'];?> km
334
-							<span class="tiptext"><?php echo $post['location']['name'];?></span>
333
+							<?php echo $post['distance']; ?> km
334
+							<span class="tiptext"><?php echo $post['location']['name']; ?></span>
335 335
 						</span>
336 336
 					</td>
337 337
 				</tr>
Please login to merge, or discard this patch.