Completed
Pull Request — master (#8)
by
unknown
02:39
created
php/jodel-web.php 3 patches
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 function isDeviceUidInDatabase($deviceUid)
22 22
 {
23 23
 	$db = new DatabaseConnect();  
24
-	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
24
+	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
25 25
 
26
-	if ($result->num_rows > 0)
26
+	if($result->num_rows > 0)
27 27
 	{
28 28
 		return TRUE;
29 29
 	}
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	
41 41
 	$access_token;
42 42
 
43
-	if ($result->num_rows > 0)
43
+	if($result->num_rows > 0)
44 44
 	{
45 45
 			// output data of each row
46 46
 			while($row = $result->fetch_assoc()) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	if($expiration_date <= time()) {
59 59
 		$accountCreator = new CreateUser();
60
-		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
60
+		$accountCreator->setAccessToken($access_token); //$accountData->getAccessToken());
61 61
 		$accountCreator->setDeviceUid($deviceUid);
62 62
 		$accountCreator->setLocation($location);
63 63
 		$data = $accountCreator->execute();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 									expiration_date='" . $expiration_date . "'
73 73
 								WHERE device_uid='" . $device_uid . "'");
74 74
 
75
-		if($result === false){
75
+		if($result === false) {
76 76
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
77 77
 		}	
78 78
 	}
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	$db = new DatabaseConnect();  
86 86
 	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'");
87 87
 	
88
-	if ($result->num_rows > 0)
88
+	if($result->num_rows > 0)
89 89
 	{
90 90
 			// output data of each row
91 91
 			while($row = $result->fetch_assoc()) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 	if($expiration_date <= time()) {
104 104
 		$accountCreator = new CreateUser();
105
-		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
105
+		$accountCreator->setAccessToken($access_token); //$accountData->getAccessToken());
106 106
 		$accountCreator->setDeviceUid($deviceUid);
107 107
 		$accountCreator->setLocation($location);
108 108
 		$data = $accountCreator->execute();
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 									expiration_date='" . $expiration_date . "'
118 118
 								WHERE device_uid='" . $device_uid . "'");
119 119
 
120
-		if($result === false){
120
+		if($result === false) {
121 121
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
122 122
 		}	
123 123
 	}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 	$access_token;
134 134
 
135
-	if ($result->num_rows > 0)
135
+	if($result->num_rows > 0)
136 136
 	{
137 137
 			// output data of each row
138 138
 			while($row = $result->fetch_assoc()) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 									expiration_date='" . $expiration_date . "'
165 165
 								WHERE device_uid='" . $device_uid . "'");
166 166
 
167
-		if($result === false){
167
+		if($result === false) {
168 168
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
169 169
 		}	
170 170
 	}
@@ -175,11 +175,11 @@  discard block
 block discarded – undo
175 175
 function getLocationByAccessToken($accessToken)
176 176
 {
177 177
 	$db = new DatabaseConnect();
178
-	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken  . "'");
178
+	$result = $db->query("SELECT * FROM accounts WHERE access_token='" . $accessToken . "'");
179 179
 	
180 180
 	$location = new Location();
181 181
 	
182
-	if ($result->num_rows > 0)
182
+	if($result->num_rows > 0)
183 183
 	{
184 184
 		// output data of each row
185 185
 		while($row = $result->fetch_assoc())
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 function getLocationByDeviceUid($deviceUid)
201 201
 {
202 202
 	$db = new DatabaseConnect();
203
-	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
203
+	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
204 204
 	
205 205
 	$location = new Location();
206 206
 	
207
-	if ($result->num_rows > 0)
207
+	if($result->num_rows > 0)
208 208
 	{
209 209
 		// output data of each row
210 210
 		while($row = $result->fetch_assoc())
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 function getDeviceUidByAccessToken($accesstoken)
226 226
 {
227 227
 	$db = new DatabaseConnect();
228
-	$result = $db->query("SELECT device_uid FROM accounts WHERE access_token='" . $accesstoken  . "'");
228
+	$result = $db->query("SELECT device_uid FROM accounts WHERE access_token='" . $accesstoken . "'");
229 229
 	
230 230
 	$deviceUid;
231 231
 	
232
-	if ($result->num_rows > 0)
232
+	if($result->num_rows > 0)
233 233
 	{
234 234
 		// output data of each row
235 235
 		while($row = $result->fetch_assoc())
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
 function getAccessTokenByDeviceUid($deviceUid)
249 249
 {
250 250
 	$db = new DatabaseConnect();
251
-	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
251
+	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
252 252
 	
253 253
 	$accessToken;
254 254
 	
255
-	if ($result->num_rows > 0)
255
+	if($result->num_rows > 0)
256 256
 	{
257 257
 		// output data of each row
258 258
 		while($row = $result->fetch_assoc())
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	$result = $db->query("INSERT INTO votes (device_uid, postId, type)
320 320
 					VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')");
321 321
 	
322
-	if($result === false){
322
+	if($result === false) {
323 323
 			$error = db_error();
324 324
 			echo $error;
325 325
 			echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -348,11 +348,11 @@  discard block
 block discarded – undo
348 348
 	$result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
349 349
 					expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
350 350
 					VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
351
-					"','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
351
+					"','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
352 352
 					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
353 353
 
354 354
 	$success = TRUE;
355
-	if($result === false){
355
+	if($result === false) {
356 356
 			$error = db_error();
357 357
 			echo $error;
358 358
 			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 {
399 399
 	preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
400 400
 
401
-    return (isset($matches[0])) ? true : false;
401
+    return (isset($matches[0]))?true : false;
402 402
 }
403 403
 
404 404
 function botDeviceUidIsSet($config)
@@ -429,25 +429,25 @@  discard block
 block discarded – undo
429 429
 	$timediff_inDays = (string)$timediff->format('%d');
430 430
 	$timediff_inMonth = (string)$timediff->format('%m');
431 431
 
432
-	if($timediff_inMonth!=0)
432
+	if($timediff_inMonth != 0)
433 433
 	{
434 434
 			$timediff = $timediff_inMonth . "m";
435 435
 	}
436 436
 	else
437 437
 	{
438
-		if($timediff_inDays!=0)
438
+		if($timediff_inDays != 0)
439 439
 		{
440 440
 			$timediff = $timediff_inDays . "d";
441 441
 		}
442 442
 		else
443 443
 		{
444
-			if($timediff_inHours!=0)
444
+			if($timediff_inHours != 0)
445 445
 			{
446 446
 				$timediff = $timediff_inHours . "h";
447 447
 			}
448 448
 			else
449 449
 			{
450
-				if($timediff_inMinutes!=0)
450
+				if($timediff_inMinutes != 0)
451 451
 				{
452 452
 					$timediff = $timediff_inMinutes . "m";
453 453
 				}
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 
462 462
 
463 463
 	?>
464
-	<article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"];?>;">
464
+	<article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"]; ?>;">
465 465
 		<content>
466 466
 			<?php 
467 467
 			if(isset($post["image_url"])) {
@@ -476,24 +476,24 @@  discard block
 block discarded – undo
476 476
 			<?php
477 477
 				if($isDetailedView)
478 478
 				{?>
479
-					<a href="index.php?vote=up&getPostDetails=true&postID=<?php echo $post['post_id'];?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']);?>">
479
+					<a href="index.php?vote=up&getPostDetails=true&postID=<?php echo $post['post_id']; ?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']); ?>">
480 480
 		  <?php }
481 481
 				else
482 482
 				{?>
483
-					<a href="index.php?vote=up&postID=<?php echo $post['post_id'];?>">
483
+					<a href="index.php?vote=up&postID=<?php echo $post['post_id']; ?>">
484 484
 		  <?php } ?>
485 485
 						<i class="fa fa-angle-up fa-3x"></i>
486 486
 					</a>	
487 487
 						<br />
488
-					<?php echo $post["vote_count"];?><br />
488
+					<?php echo $post["vote_count"]; ?><br />
489 489
 			<?php
490 490
 				if($isDetailedView)
491 491
 				{?>
492
-					<a href="index.php?vote=down&getPostDetails=true&postID=<?php echo $post['post_id'];?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']);?>">
492
+					<a href="index.php?vote=down&getPostDetails=true&postID=<?php echo $post['post_id']; ?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']); ?>">
493 493
 		  <?php }
494 494
 				else
495 495
 				{?>
496
-					<a href="index.php?vote=down&postID=<?php echo $post['post_id'];?>">
496
+					<a href="index.php?vote=down&postID=<?php echo $post['post_id']; ?>">
497 497
 		  <?php } ?>
498 498
 						<i class="fa fa-angle-down fa-3x"></i>
499 499
 					</a>
@@ -505,14 +505,14 @@  discard block
 block discarded – undo
505 505
 					<td class="time">
506 506
 						<span class="tip" data-tooltip="Time">
507 507
 							<i class="fa fa-clock-o"></i>
508
-							<?php echo $timediff;?>
509
-							<span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
508
+							<?php echo $timediff; ?>
509
+							<span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
510 510
 						</span> 
511 511
 					</td>
512 512
 					<td class="comments">
513 513
 						<?php if(!$isDetailedView) {?>
514 514
 						<span data-tooltip="Comments">
515
-							<a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $post["post_id"];?>">
515
+							<a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postID=<?php echo $post["post_id"]; ?>">
516 516
 								<i class="fa fa-commenting-o"></i>
517 517
 								<?php if(array_key_exists("child_count", $post)) {
518 518
 											echo $post["child_count"];
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 									{
542 542
 							  			?>
543 543
 							  			<span data-tooltip="Author">
544
-											<i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> |
544
+											<i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> |
545 545
 										</span>
546 546
 										<?php
547 547
 									}
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
 
552 552
 						<span class="tip" data-tooltip="Distance">
553 553
 							<i class="fa fa-map-marker"></i>
554
-							<?php echo $post['distance'];?> km
555
-							<span class="tiptext"><?php echo $post['location']['name'];?></span>
554
+							<?php echo $post['distance']; ?> km
555
+							<span class="tiptext"><?php echo $post['location']['name']; ?></span>
556 556
 						</span>
557 557
 					</td>
558 558
 				</tr>
Please login to merge, or discard this patch.
Braces   +50 added lines, -25 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  discard block
 block discarded – undo
43 43
 	if ($result->num_rows > 0)
44 44
 	{
45 45
 			// output data of each row
46
-			while($row = $result->fetch_assoc()) {
46
+			while($row = $result->fetch_assoc())
47
+			{
47 48
 					//$access_token = $row["access_token"];
48 49
 					$expiration_date = $row["expiration_date"];
49 50
 					$deviceUid = $row["device_uid"];
@@ -55,7 +56,8 @@  discard block
 block discarded – undo
55 56
 			echo '0 results';
56 57
 	}
57 58
 
58
-	if($expiration_date <= time()) {
59
+	if($expiration_date <= time())
60
+	{
59 61
 		$accountCreator = new CreateUser();
60 62
 		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
61 63
 		$accountCreator->setDeviceUid($deviceUid);
@@ -72,7 +74,8 @@  discard block
 block discarded – undo
72 74
 									expiration_date='" . $expiration_date . "'
73 75
 								WHERE device_uid='" . $device_uid . "'");
74 76
 
75
-		if($result === false){
77
+		if($result === false)
78
+		{
76 79
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
77 80
 		}	
78 81
 	}
@@ -88,7 +91,8 @@  discard block
 block discarded – undo
88 91
 	if ($result->num_rows > 0)
89 92
 	{
90 93
 			// output data of each row
91
-			while($row = $result->fetch_assoc()) {
94
+			while($row = $result->fetch_assoc())
95
+			{
92 96
 					//$access_token = $row["access_token"];
93 97
 					$expiration_date = $row["expiration_date"];
94 98
 					$deviceUid = $row["device_uid"];
@@ -100,7 +104,8 @@  discard block
 block discarded – undo
100 104
 			echo '0 results';
101 105
 	}
102 106
 
103
-	if($expiration_date <= time()) {
107
+	if($expiration_date <= time())
108
+	{
104 109
 		$accountCreator = new CreateUser();
105 110
 		$accountCreator->setAccessToken($access_token);//$accountData->getAccessToken());
106 111
 		$accountCreator->setDeviceUid($deviceUid);
@@ -117,7 +122,8 @@  discard block
 block discarded – undo
117 122
 									expiration_date='" . $expiration_date . "'
118 123
 								WHERE device_uid='" . $device_uid . "'");
119 124
 
120
-		if($result === false){
125
+		if($result === false)
126
+		{
121 127
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
122 128
 		}	
123 129
 	}
@@ -135,7 +141,8 @@  discard block
 block discarded – undo
135 141
 	if ($result->num_rows > 0)
136 142
 	{
137 143
 			// output data of each row
138
-			while($row = $result->fetch_assoc()) {
144
+			while($row = $result->fetch_assoc())
145
+			{
139 146
 					//$access_token = $row["access_token"];
140 147
 					$expiration_date = $row["expiration_date"];
141 148
 					$deviceUid = $row["device_uid"];
@@ -147,7 +154,8 @@  discard block
 block discarded – undo
147 154
 			echo '0 results';
148 155
 	}
149 156
 
150
-	if($expiration_date <= time()) {
157
+	if($expiration_date <= time())
158
+	{
151 159
 		$accountCreator = new CreateUser();
152 160
 		$accountCreator->setAccessToken($access_token);
153 161
 		$accountCreator->setDeviceUid($deviceUid);
@@ -164,7 +172,8 @@  discard block
 block discarded – undo
164 172
 									expiration_date='" . $expiration_date . "'
165 173
 								WHERE device_uid='" . $device_uid . "'");
166 174
 
167
-		if($result === false){
175
+		if($result === false)
176
+		{
168 177
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
169 178
 		}	
170 179
 	}
@@ -319,7 +328,8 @@  discard block
 block discarded – undo
319 328
 	$result = $db->query("INSERT INTO votes (device_uid, postId, type)
320 329
 					VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')");
321 330
 	
322
-	if($result === false){
331
+	if($result === false)
332
+	{
323 333
 			$error = db_error();
324 334
 			echo $error;
325 335
 			echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -327,7 +337,8 @@  discard block
 block discarded – undo
327 337
 	
328 338
 }
329 339
 
330
-function registerAccount(Location $location) {
340
+function registerAccount(Location $location)
341
+{
331 342
 	$accountCreator = new CreateUser();
332 343
 	$accountCreator->setLocation($location);
333 344
 	$data = $accountCreator->execute();
@@ -352,7 +363,8 @@  discard block
 block discarded – undo
352 363
 					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
353 364
 
354 365
 	$success = TRUE;
355
-	if($result === false){
366
+	if($result === false)
367
+	{
356 368
 			$error = db_error();
357 369
 			echo $error;
358 370
 			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
@@ -363,7 +375,7 @@  discard block
 block discarded – undo
363 375
 }
364 376
 
365 377
 function getPosts($lastPostId, $accessToken, $url, $version = 'v2')
366
-{	
378
+{
367 379
 	$accountCreator = new GetPosts();
368 380
 	$accountCreator->setLastPostId($lastPostId);
369 381
 	$accountCreator->setAccessToken($accessToken);
@@ -414,7 +426,8 @@  discard block
 block discarded – undo
414 426
 }
415 427
 
416 428
 function jodelToHtml($post, $view = 'time', $isDetailedView = FALSE)
417
-{	//ToDO
429
+{
430
+//ToDO
418 431
 	//Replace # with link
419 432
 	//preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text);
420 433
 
@@ -464,10 +477,12 @@  discard block
 block discarded – undo
464 477
 	<article id ="postId-<?php echo $post["post_id"]; ?>" class="jodel" style="background-color: #<?php echo $post["color"];?>;">
465 478
 		<content>
466 479
 			<?php 
467
-			if(isset($post["image_url"])) {
480
+			if(isset($post["image_url"]))
481
+			{
468 482
 				echo '<img src="' . $post["image_url"] . '">';
469 483
 			}
470
-			else {
484
+			else
485
+			{
471 486
 				echo str_replace('  ', ' &nbsp;', nl2br(htmlspecialchars($post["message"])));
472 487
 			}
473 488
 			?>
@@ -475,11 +490,13 @@  discard block
 block discarded – undo
475 490
 		<aside>
476 491
 			<?php
477 492
 				if($isDetailedView)
478
-				{?>
493
+				{
494
+?>
479 495
 					<a href="index.php?vote=up&getPostDetails=true&postID=<?php echo $post['post_id'];?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']);?>">
480 496
 		  <?php }
481
-				else
482
-				{?>
497
+else
498
+				{
499
+?>
483 500
 					<a href="index.php?vote=up&postID=<?php echo $post['post_id'];?>">
484 501
 		  <?php } ?>
485 502
 						<i class="fa fa-angle-up fa-3x"></i>
@@ -488,11 +505,13 @@  discard block
 block discarded – undo
488 505
 					<?php echo $post["vote_count"];?><br />
489 506
 			<?php
490 507
 				if($isDetailedView)
491
-				{?>
508
+				{
509
+?>
492 510
 					<a href="index.php?vote=down&getPostDetails=true&postID=<?php echo $post['post_id'];?>&postID_parent=<?php echo htmlspecialchars($_GET['postID']);?>">
493 511
 		  <?php }
494
-				else
495
-				{?>
512
+else
513
+				{
514
+?>
496 515
 					<a href="index.php?vote=down&postID=<?php echo $post['post_id'];?>">
497 516
 		  <?php } ?>
498 517
 						<i class="fa fa-angle-down fa-3x"></i>
@@ -510,13 +529,19 @@  discard block
 block discarded – undo
510 529
 						</span> 
511 530
 					</td>
512 531
 					<td class="comments">
513
-						<?php if(!$isDetailedView) {?>
532
+						<?php if(!$isDetailedView)
533
+{
534
+?>
514 535
 						<span data-tooltip="Comments">
515 536
 							<a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postID=<?php echo $post["post_id"];?>">
516 537
 								<i class="fa fa-commenting-o"></i>
517
-								<?php if(array_key_exists("child_count", $post)) {
538
+								<?php if(array_key_exists("child_count", $post))
539
+{
518 540
 											echo $post["child_count"];
519
-										} else echo "0";
541
+										}
542
+										else {
543
+											echo "0";
544
+										}
520 545
 								?>
521 546
 								</a>
522 547
 						</span>
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 									expiration_date='" . $expiration_date . "'
73 73
 								WHERE device_uid='" . $device_uid . "'");
74 74
 
75
-		if($result === false){
75
+		if($result === FALSE){
76 76
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
77 77
 		}	
78 78
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 									expiration_date='" . $expiration_date . "'
118 118
 								WHERE device_uid='" . $device_uid . "'");
119 119
 
120
-		if($result === false){
120
+		if($result === FALSE){
121 121
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
122 122
 		}	
123 123
 	}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 									expiration_date='" . $expiration_date . "'
165 165
 								WHERE device_uid='" . $device_uid . "'");
166 166
 
167
-		if($result === false){
167
+		if($result === FALSE){
168 168
 				echo "Adding account failed: (" . $db->errno . ") " . $db->error;
169 169
 		}	
170 170
 	}
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 						  FROM votes
289 289
 						  WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')");
290 290
 	
291
-	if($result === false)
291
+	if($result === FALSE)
292 292
 	{
293 293
 		$error = db_error();
294 294
 		echo $error;
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	$result = $db->query("INSERT INTO votes (device_uid, postId, type)
320 320
 					VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')");
321 321
 	
322
-	if($result === false){
322
+	if($result === FALSE){
323 323
 			$error = db_error();
324 324
 			echo $error;
325 325
 			echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
353 353
 
354 354
 	$success = TRUE;
355
-	if($result === false){
355
+	if($result === FALSE){
356 356
 			$error = db_error();
357 357
 			echo $error;
358 358
 			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 {
399 399
 	preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
400 400
 
401
-    return (isset($matches[0])) ? true : false;
401
+    return (isset($matches[0])) ? TRUE : FALSE;
402 402
 }
403 403
 
404 404
 function botDeviceUidIsSet($config)
Please login to merge, or discard this patch.