Completed
Pull Request — master (#10)
by
unknown
02:50
created
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
 $config = parse_ini_file('config/config.ini.php');
4 4
 if(!isset($_GET['pw']) || $config['pw'] != $_GET['pw'])
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
 	
10 10
 	die();
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		}
71 71
 	}
72 72
 
73
-if (isset($captcha))
73
+if(isset($captcha))
74 74
 {
75 75
 	$response = array("success" => $success, "message" => $message, "captcha" => $captcha, "accessToken" => $token);
76 76
 }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +5 added lines, -105 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 		if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId']))
37 37
 		{
38 38
 			$deviceUid = createAccount();
39
-			setcookie('JodelDeviceId', $deviceUid, time()+60*60*24*365*10);
40
-			error_log('Created account with JodelDeviceId:' . $deviceUid .  ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
39
+			setcookie('JodelDeviceId', $deviceUid, time() + 60 * 60 * 24 * 365 * 10);
40
+			error_log('Created account with JodelDeviceId:' . $deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
41 41
 			
42 42
 		}
43 43
 		else
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	//Set View
58 58
 	if(isset($_GET['view']))
59 59
 	{
60
-		switch ($_GET['view']) {
60
+		switch($_GET['view']) {
61 61
 			case 'comment':
62 62
 				$view = 'comment';
63 63
 				break;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	//Vote
92 92
 	if(isset($_GET['vote']) && isset($_GET['postID']))
93 93
 	{
94
-<<<<<<< HEAD
94
+<< << <<< HEAD
95 95
 		if(!deviceUidHasVotedThisPostId($deviceUid_forId1, $_GET['postID']))
96 96
 		{
97 97
 			if($_GET['vote'] == "up")
@@ -416,104 +416,4 @@  discard block
 block discarded – undo
416 416
 
417 417
 				var win = $(window);
418 418
 				var lastPostId = "<?php echo $lastPostId; ?>";
419
-				var view = "<?php echo $view; ?>"
420
-				var old_lastPostId = "";
421
-				var morePostsAvailable = true;
422
-
423
-				if(window.location.hash)
424
-				{
425
-					var hash = window.location.hash.slice(1);
426
-
427
-					if(!$("article[id='"+ hash +"']").length)
428
-					{
429
-						for (var i = 5; i >= 0; i--)
430
-						{
431
-							if(!$("article[id='"+ hash +"']").length)
432
-							{
433
-								$.ajax({
434
-									url: 'get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
435
-									dataType: 'html',
436
-									async: false,
437
-									success: function(html) {
438
-										var div = document.createElement('div');
439
-										div.innerHTML = html;
440
-										var elements = div.childNodes;
441
-										old_lastPostId = lastPostId;
442
-										lastPostId = elements[3].textContent;
443
-										lastPostId = lastPostId.replace(/\s+/g, '');
444
-										//alert('Neu: ' + lastPostId + " Alt: " + old_lastPostId);
445
-										if(lastPostId == old_lastPostId) {
446
-											
447
-											//morePostsAvailable = false;
448
-										}
449
-										else {
450
-											//alert(elements[3].textContent);
451
-											$('#posts').append(elements[1].innerHTML);
452
-											$('#posts').hide().show(0);
453
-										}
454
-										$('#loading').hide();
455
-									}
456
-								});
457
-
458
-								$('.jodel > content').Emoji();
459
-							}
460
-							
461
-						}
462
-						scrollToAnchor(hash);
463
-
464
-					}						
465
-				}
466
-
467
-				// Each time the user scrolls
468
-				win.scroll(function() {
469
-
470
-
471
-					// End of the document reached?
472
-					if ($(window).scrollTop() + $(window).height() > $(document).height() - 100 && morePostsAvailable)
473
-					{
474
-						$('#loading').show();
475
-
476
-						$.ajax({
477
-							url: 'get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
478
-							dataType: 'html',
479
-							async: false,
480
-							success: function(html) {
481
-								var div = document.createElement('div');
482
-								div.innerHTML = html;
483
-								var elements = div.childNodes;
484
-								old_lastPostId = lastPostId;
485
-								lastPostId = elements[3].textContent;
486
-								lastPostId = lastPostId.replace(/\s+/g, '');
487
-								//alert('Neu: ' + lastPostId + " Alt: " + old_lastPostId);
488
-								if(lastPostId == old_lastPostId)
489
-								{
490
-									
491
-									//morePostsAvailable = false;
492
-								}
493
-								else
494
-								{
495
-									//alert(elements[3].textContent);
496
-									$('#posts').append(elements[1].innerHTML);
497
-								}
498
-								$('#loading').hide();
499
-							}
500
-						});
501
-
502
-						$('.jodel > content').Emoji();
503
-					}
504
-				});
505
-			<?php } ?>
506
-			});	
507
-
508
-		</script>
509
-
510
-		<?php  
511
-			if(is_file('./piwik-script.html'))
512
-			{
513
-			    require_once('./piwik-script.html');
514
-			}
515
-		?>
516
-
517
-	</body>
518
-</html>
519
-
419
+				var view = "<?php echo $view
520 420
\ No newline at end of file
Please login to merge, or discard this patch.