| @@ -110,7 +110,7 @@ discard block | ||
| 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,6 +143,6 @@ discard block | ||
| 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 | - <?php include 'templates/footer.php';?> | |
| 149 | 148 | \ No newline at end of file | 
| 149 | + <?php include 'templates/footer.php'; ?> | |
| 150 | 150 | \ No newline at end of file | 
| @@ -20,7 +20,8 @@ discard block | ||
| 20 | 20 | |
| 21 | 21 | $posts[0] = $data; | 
| 22 | 22 | |
| 23 | -		if(array_key_exists('children', $data)) { | |
| 23 | +		if(array_key_exists('children', $data)) | |
| 24 | +		{ | |
| 24 | 25 | foreach($data['children'] as $key => $child) | 
| 25 | 26 |  			{ | 
| 26 | 27 | |
| @@ -78,7 +79,9 @@ discard block | ||
| 78 | 79 | } ?> | 
| 79 | 80 | </content> | 
| 80 | 81 | |
| 81 | -					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> | |
| 82 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) | |
| 83 | +{ | |
| 84 | +?> | |
| 82 | 85 | <p id="loading"> | 
| 83 | 86 | Loading… | 
| 84 | 87 | </p> | 
| @@ -91,7 +94,11 @@ discard block | ||
| 91 | 94 | <div> | 
| 92 | 95 | <h2>Position / Hashtag</h2> | 
| 93 | 96 | <form method="get"> | 
| 94 | - <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> | |
| 97 | + <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) | |
| 98 | +{ | |
| 99 | + echo $newPositionStatus; | |
| 100 | +} | |
| 101 | +?>" required> | |
| 95 | 102 | <label>try: #jhj</label><br> | 
| 96 | 103 | <input type="submit" value="Set Location" /> | 
| 97 | 104 | </form> | 
| @@ -107,7 +114,9 @@ discard block | ||
| 107 | 114 | |
| 108 | 115 | <article> | 
| 109 | 116 | <div> | 
| 110 | -								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> | |
| 117 | + <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) | |
| 118 | +{ | |
| 119 | +?> | |
| 111 | 120 | <h2>Comment on Jodel</h2> | 
| 112 | 121 | <form method="POST"> | 
| 113 | 122 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> | 
| @@ -115,7 +124,10 @@ discard block | ||
| 115 | 124 | <br /> | 
| 116 | 125 | <input type="submit" value="SEND" /> | 
| 117 | 126 | </form> | 
| 118 | -									<?php } else { ?> | |
| 127 | + <?php } | |
| 128 | +else | |
| 129 | +{ | |
| 130 | +?> | |
| 119 | 131 | <h2>New Jodel</h2> | 
| 120 | 132 | <form method="POST"> | 
| 121 | 133 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> | 
| @@ -49,7 +49,7 @@ | ||
| 49 | 49 | } | 
| 50 | 50 | if(!isset($posts[0])) | 
| 51 | 51 |  	{ | 
| 52 | -		error_log('Fehler: ' . print_r($posts, true) . print_r($posts['recent'], true) . print_r($posts['posts'], true)); | |
| 52 | +		error_log('Fehler: ' . print_r($posts, TRUE) . print_r($posts['recent'], TRUE) . print_r($posts['posts'], TRUE)); | |
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | $title = $view->getTitle($posts[0]); | 
| @@ -66,4 +66,4 @@ | ||
| 66 | 66 | </article> | 
| 67 | 67 | </div> | 
| 68 | 68 | </div> | 
| 69 | - <?php include '../templates/footer.php';?> | |
| 70 | 69 | \ No newline at end of file | 
| 70 | + <?php include '../templates/footer.php'; ?> | |
| 71 | 71 | \ No newline at end of file | 
| @@ -1,16 +1,16 @@ | ||
| 1 | 1 | <div id="sortJodelBy" class="row"> | 
| 2 | 2 | <div class="col-3"> | 
| 3 | -		<a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> | |
| 3 | +		<a <?php if($view->view == 'combo')echo 'class="active"'; ?> href="<?php echo $view->changeView('combo')->back()->toUrl(); ?>"><i class="fa fa-clock-o fa-3x"></i></a> | |
| 4 | 4 | </div> | 
| 5 | 5 | <div class="col-3"> | 
| 6 | -		<a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> | |
| 6 | +		<a <?php if($view->view == 'discussed') echo 'class="active"'; ?> href="<?php echo $view->changeView('discussed')->back()->toUrl(); ?>"><i class="fa fa-commenting-o fa-3x"></i></a> | |
| 7 | 7 | </div> | 
| 8 | 8 | <div class="col-3"> | 
| 9 | -		<a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> | |
| 9 | +		<a <?php if($view->view == 'popular') echo 'class="active"'; ?> href="<?php echo $view->changeView('popular')->back()->toUrl(); ?>"><i class="fa fa-angle-up fa-3x"></i></a> | |
| 10 | 10 | </div> | 
| 11 | 11 | <div class="col-3"> | 
| 12 | 12 | <nav> | 
| 13 | - <a href="<?php echo $baseUrl;?>about-us.php">about us</a> | |
| 13 | + <a href="<?php echo $baseUrl; ?>about-us.php">about us</a> | |
| 14 | 14 | </nav> | 
| 15 | 15 | </div> | 
| 16 | 16 | </div> | 
| 17 | 17 | \ No newline at end of file | 
| @@ -1,12 +1,24 @@ | ||
| 1 | 1 | <div id="sortJodelBy" class="row"> | 
| 2 | 2 | <div class="col-3"> | 
| 3 | -		<a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> | |
| 3 | + <a <?php if($view->view == 'combo') | |
| 4 | +{ | |
| 5 | + echo 'class="active"'; | |
| 6 | +} | |
| 7 | +?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> | |
| 4 | 8 | </div> | 
| 5 | 9 | <div class="col-3"> | 
| 6 | -		<a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> | |
| 10 | + <a <?php if($view->view == 'discussed') | |
| 11 | +{ | |
| 12 | + echo 'class="active"'; | |
| 13 | +} | |
| 14 | +?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> | |
| 7 | 15 | </div> | 
| 8 | 16 | <div class="col-3"> | 
| 9 | -		<a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> | |
| 17 | + <a <?php if($view->view == 'popular') | |
| 18 | +{ | |
| 19 | + echo 'class="active"'; | |
| 20 | +} | |
| 21 | +?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> | |
| 10 | 22 | </div> | 
| 11 | 23 | <div class="col-3"> | 
| 12 | 24 | <nav> | 
| @@ -5,7 +5,7 @@ discard block | ||
| 5 | 5 | crossorigin="anonymous"></script> | 
| 6 | 6 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> | 
| 7 | 7 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> | 
| 8 | - <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script> | |
| 8 | + <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script> | |
| 9 | 9 | |
| 10 | 10 | <script> | 
| 11 | 11 | //BackButton | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 |  							if(!$("article[id='"+ hash +"']").length) | 
| 50 | 50 |  							{ | 
| 51 | 51 |  								$.ajax({ | 
| 52 | - url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURI(hashtag), | |
| 52 | + url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURI(hashtag), | |
| 53 | 53 | dataType: 'html', | 
| 54 | 54 | async: false, | 
| 55 | 55 |  									success: function(html) { | 
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 |  						$('#loading').show(); | 
| 93 | 93 | |
| 94 | 94 |  						$.ajax({ | 
| 95 | - url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURI(hashtag), | |
| 95 | + url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURI(hashtag), | |
| 96 | 96 | dataType: 'html', | 
| 97 | 97 | async: false, | 
| 98 | 98 |  							success: function(html) { | 
| @@ -29,7 +29,9 @@ | ||
| 29 | 29 |  				    $('html,body').animate({scrollTop: aTag.offset().top-90},'slow'); | 
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | -				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> | |
| 32 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) | |
| 33 | +{ | |
| 34 | +?> | |
| 33 | 35 | |
| 34 | 36 | var win = $(window); | 
| 35 | 37 | var lastPostId = "<?php echo $view->lastPostId; ?>"; | 
| @@ -1,52 +1,52 @@ | ||
| 1 | 1 | <!DOCTYPE html> | 
| 2 | 2 | <html lang="en"> | 
| 3 | 3 | <head> | 
| 4 | - <title><?php echo $title;?></title> | |
| 4 | + <title><?php echo $title; ?></title> | |
| 5 | 5 | |
| 6 | 6 | <meta charset="utf-8"> | 
| 7 | 7 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 
| 8 | 8 | <meta http-equiv="x-ua-compatible" content="ie=edge"> | 
| 9 | 9 | |
| 10 | - <meta name="description" content="<?php echo $description;?>"> | |
| 10 | + <meta name="description" content="<?php echo $description; ?>"> | |
| 11 | 11 | <meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client, web-app, browser, app"> | 
| 12 | 12 | |
| 13 | 13 | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> | 
| 14 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css"> | |
| 15 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css"> | |
| 14 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css"> | |
| 15 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css"> | |
| 16 | 16 | |
| 17 | - <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> | |
| 18 | - <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> | |
| 19 | - <link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif"> | |
| 20 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png"> | |
| 21 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png"> | |
| 22 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> | |
| 23 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> | |
| 24 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> | |
| 25 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> | |
| 26 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> | |
| 27 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> | |
| 28 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> | |
| 29 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> | |
| 30 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> | |
| 31 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> | |
| 32 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png"> | |
| 33 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16"> | |
| 34 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32"> | |
| 35 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96"> | |
| 36 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160"> | |
| 37 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192"> | |
| 38 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196"> | |
| 39 | - <meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> | |
| 17 | + <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> | |
| 18 | + <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> | |
| 19 | + <link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif"> | |
| 20 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png"> | |
| 21 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png"> | |
| 22 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> | |
| 23 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> | |
| 24 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> | |
| 25 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> | |
| 26 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> | |
| 27 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> | |
| 28 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> | |
| 29 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> | |
| 30 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> | |
| 31 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> | |
| 32 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png"> | |
| 33 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16"> | |
| 34 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32"> | |
| 35 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96"> | |
| 36 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160"> | |
| 37 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192"> | |
| 38 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196"> | |
| 39 | + <meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> | |
| 40 | 40 | <meta name="msapplication-TileColor" content="#5682a3"> | 
| 41 | 41 | <meta name="msapplication-navbutton-color" content="#5682a3"> | 
| 42 | 42 | <meta name="application-name" content="JodelBlue"/> | 
| 43 | 43 | <meta name="msapplication-tooltip" content="JodelBlue"/> | 
| 44 | 44 | <meta name="apple-mobile-web-app-title" content="JodelBlue"/> | 
| 45 | - <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> | |
| 46 | - <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> | |
| 47 | - <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> | |
| 48 | - <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> | |
| 49 | - <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> | |
| 45 | + <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> | |
| 46 | + <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> | |
| 47 | + <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> | |
| 48 | + <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> | |
| 49 | + <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> | |
| 50 | 50 | </head> | 
| 51 | 51 | |
| 52 | 52 | <body> | 
| @@ -74,7 +74,11 @@ | ||
| 74 | 74 | |
| 75 | 75 | <div id="location_mobile" class="hidden-sm-up"> | 
| 76 | 76 | <form method="get"> | 
| 77 | - <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> | |
| 77 | + <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) | |
| 78 | +{ | |
| 79 | + echo $newPositionStatus; | |
| 80 | +} | |
| 81 | +?>" required> | |
| 78 | 82 | |
| 79 | 83 | <input type="submit" id="submit_mobile" class="fa" value="" /> | 
| 80 | 84 | </form> | 
| @@ -2,107 +2,107 @@ discard block | ||
| 2 | 2 | |
| 3 | 3 | class View | 
| 4 | 4 |  { | 
| 5 | - public $country; | |
| 6 | - public $city; | |
| 7 | - public $hashtag; | |
| 5 | + public $country; | |
| 6 | + public $city; | |
| 7 | + public $hashtag; | |
| 8 | 8 | public $view; | 
| 9 | - public $postId; | |
| 10 | - public $isDetailedView; | |
| 11 | - public $baseUrl; | |
| 9 | + public $postId; | |
| 10 | + public $isDetailedView; | |
| 11 | + public $baseUrl; | |
| 12 | 12 | |
| 13 | 13 | public $lastPostId = ''; | 
| 14 | 14 | |
| 15 | - function __construct($baseUrl, $country, $city, $hashtag = '#all', $view = 'time', $postId = '') | |
| 16 | -    { | |
| 17 | - $this->baseUrl = $baseUrl; | |
| 18 | - $this->country = $country; | |
| 19 | - $this->city = $city; | |
| 20 | - $this->hashtag = $hashtag; | |
| 21 | - $this->view = $view; | |
| 22 | - $this->postId = $postId; | |
| 23 | - | |
| 24 | - if($postId == '') | |
| 25 | -        { | |
| 26 | - $this->isDetailedView = FALSE; | |
| 27 | - } | |
| 28 | - else | |
| 29 | -        { | |
| 30 | - $this->isDetailedView = TRUE; | |
| 31 | - } | |
| 32 | - } | |
| 15 | + function __construct($baseUrl, $country, $city, $hashtag = '#all', $view = 'time', $postId = '') | |
| 16 | +	{ | |
| 17 | + $this->baseUrl = $baseUrl; | |
| 18 | + $this->country = $country; | |
| 19 | + $this->city = $city; | |
| 20 | + $this->hashtag = $hashtag; | |
| 21 | + $this->view = $view; | |
| 22 | + $this->postId = $postId; | |
| 23 | + | |
| 24 | + if($postId == '') | |
| 25 | +		{ | |
| 26 | + $this->isDetailedView = FALSE; | |
| 27 | + } | |
| 28 | + else | |
| 29 | +		{ | |
| 30 | + $this->isDetailedView = TRUE; | |
| 31 | + } | |
| 32 | + } | |
| 33 | 33 | /** | 
| 34 | 34 | * Compute HTML Code | 
| 35 | 35 | */ | 
| 36 | 36 | function jodelToHtml($post) | 
| 37 | -    {   //ToDO | |
| 38 | - //Replace # with link | |
| 39 | -        //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); | |
| 40 | - | |
| 41 | - //Time to time difference | |
| 42 | - $now = new DateTime(); | |
| 43 | - $d = new DateTime($post['created_at']); | |
| 44 | - $timediff = $now->diff($d); | |
| 45 | - | |
| 46 | -        $timediff_inSeconds = (string)$timediff->format('%s'); | |
| 47 | -        $timediff_inMinutes = (string)$timediff->format('%i'); | |
| 48 | -        $timediff_inHours = (string)$timediff->format('%h'); | |
| 49 | -        $timediff_inDays = (string)$timediff->format('%d'); | |
| 50 | -        $timediff_inMonth = (string)$timediff->format('%m'); | |
| 51 | - | |
| 52 | - if($timediff_inMonth!=0) | |
| 53 | -        { | |
| 54 | - $timediff = $timediff_inMonth . "m"; | |
| 55 | - } | |
| 56 | - else | |
| 57 | -        { | |
| 58 | - if($timediff_inDays!=0) | |
| 59 | -            { | |
| 60 | - $timediff = $timediff_inDays . "d"; | |
| 61 | - } | |
| 62 | - else | |
| 63 | -            { | |
| 64 | - if($timediff_inHours!=0) | |
| 65 | -                { | |
| 66 | - $timediff = $timediff_inHours . "h"; | |
| 67 | - } | |
| 68 | - else | |
| 69 | -                { | |
| 70 | - if($timediff_inMinutes!=0) | |
| 71 | -                    { | |
| 72 | - $timediff = $timediff_inMinutes . "m"; | |
| 73 | - } | |
| 74 | - else | |
| 75 | -                    { | |
| 76 | - $timediff = $timediff_inSeconds . "s"; | |
| 77 | - } | |
| 78 | - } | |
| 79 | - } | |
| 80 | - } | |
| 81 | - | |
| 82 | - | |
| 83 | - ?> | |
| 37 | +	{   //ToDO | |
| 38 | + //Replace # with link | |
| 39 | +		//preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); | |
| 40 | + | |
| 41 | + //Time to time difference | |
| 42 | + $now = new DateTime(); | |
| 43 | + $d = new DateTime($post['created_at']); | |
| 44 | + $timediff = $now->diff($d); | |
| 45 | + | |
| 46 | +		$timediff_inSeconds = (string)$timediff->format('%s'); | |
| 47 | +		$timediff_inMinutes = (string)$timediff->format('%i'); | |
| 48 | +		$timediff_inHours = (string)$timediff->format('%h'); | |
| 49 | +		$timediff_inDays = (string)$timediff->format('%d'); | |
| 50 | +		$timediff_inMonth = (string)$timediff->format('%m'); | |
| 51 | + | |
| 52 | + if($timediff_inMonth!=0) | |
| 53 | +		{ | |
| 54 | + $timediff = $timediff_inMonth . "m"; | |
| 55 | + } | |
| 56 | + else | |
| 57 | +		{ | |
| 58 | + if($timediff_inDays!=0) | |
| 59 | +			{ | |
| 60 | + $timediff = $timediff_inDays . "d"; | |
| 61 | + } | |
| 62 | + else | |
| 63 | +			{ | |
| 64 | + if($timediff_inHours!=0) | |
| 65 | +				{ | |
| 66 | + $timediff = $timediff_inHours . "h"; | |
| 67 | + } | |
| 68 | + else | |
| 69 | +				{ | |
| 70 | + if($timediff_inMinutes!=0) | |
| 71 | +					{ | |
| 72 | + $timediff = $timediff_inMinutes . "m"; | |
| 73 | + } | |
| 74 | + else | |
| 75 | +					{ | |
| 76 | + $timediff = $timediff_inSeconds . "s"; | |
| 77 | + } | |
| 78 | + } | |
| 79 | + } | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 83 | + ?> | |
| 84 | 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 | - if(isset($post['image_url'])) | |
| 88 | -                { | |
| 89 | - $regexRest = '/[^\w$ .!?-]+/u'; | |
| 90 | - | |
| 91 | - echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; | |
| 92 | - } | |
| 93 | -                else { | |
| 94 | -                    echo str_replace('  ', '  ', nl2br(htmlspecialchars($post['message']))); | |
| 95 | - } | |
| 96 | - ?> | |
| 87 | + if(isset($post['image_url'])) | |
| 88 | +				{ | |
| 89 | + $regexRest = '/[^\w$ .!?-]+/u'; | |
| 90 | + | |
| 91 | + echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; | |
| 92 | + } | |
| 93 | +				else { | |
| 94 | +					echo str_replace('  ', '  ', nl2br(htmlspecialchars($post['message']))); | |
| 95 | + } | |
| 96 | + ?> | |
| 97 | 97 | </content> | 
| 98 | 98 | <aside> | 
| 99 | 99 | <?php | 
| 100 | - if($this->isDetailedView) | |
| 101 | -                    {?> | |
| 100 | + if($this->isDetailedView) | |
| 101 | +					{?> | |
| 102 | 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 | - else | |
| 105 | -                    {?> | |
| 104 | + else | |
| 105 | +					{?> | |
| 106 | 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> | 
| @@ -110,12 +110,12 @@ discard block | ||
| 110 | 110 | <br /> | 
| 111 | 111 | <?php echo $post["vote_count"];?><br /> | 
| 112 | 112 | <?php | 
| 113 | - if($this->isDetailedView) | |
| 114 | -                    {?> | |
| 113 | + if($this->isDetailedView) | |
| 114 | +					{?> | |
| 115 | 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 | - else | |
| 118 | -                    {?> | |
| 117 | + else | |
| 118 | +					{?> | |
| 119 | 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> | 
| @@ -138,39 +138,39 @@ discard block | ||
| 138 | 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 | - echo $post["child_count"]; | |
| 142 | - } else echo "0"; | |
| 143 | - ?> | |
| 141 | + echo $post["child_count"]; | |
| 142 | + } else echo "0"; | |
| 143 | + ?> | |
| 144 | 144 | </a> | 
| 145 | 145 | </span> | 
| 146 | 146 | <?php } ?> | 
| 147 | 147 | </td> | 
| 148 | 148 | <td class="distance"> | 
| 149 | 149 | <?php | 
| 150 | - if($this->isDetailedView) | |
| 151 | -                                { | |
| 152 | - if(isset($post["parent_creator"]) && $post["parent_creator"] == 1) | |
| 153 | -                                    { | |
| 154 | - ?> | |
| 150 | + if($this->isDetailedView) | |
| 151 | +								{ | |
| 152 | + if(isset($post["parent_creator"]) && $post["parent_creator"] == 1) | |
| 153 | +									{ | |
| 154 | + ?> | |
| 155 | 155 | <span data-tooltip="Author"> | 
| 156 | 156 | <i class="fa fa-user-o"></i> OJ | | 
| 157 | 157 | </span> | 
| 158 | 158 | <?php | 
| 159 | - } | |
| 160 | - else | |
| 161 | -                                    { | |
| 162 | - //Is not parent Jodel in detailed View | |
| 163 | -                                        if(!array_key_exists('child_count', $post) && array_key_exists('parent_creator', $post)) | |
| 164 | -                                        { | |
| 165 | - ?> | |
| 159 | + } | |
| 160 | + else | |
| 161 | +									{ | |
| 162 | + //Is not parent Jodel in detailed View | |
| 163 | +										if(!array_key_exists('child_count', $post) && array_key_exists('parent_creator', $post)) | |
| 164 | +										{ | |
| 165 | + ?> | |
| 166 | 166 | <span data-tooltip="Author"> | 
| 167 | 167 | <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | | 
| 168 | 168 | </span> | 
| 169 | 169 | <?php | 
| 170 | - } | |
| 171 | - } | |
| 172 | - } | |
| 173 | - ?> | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | + ?> | |
| 174 | 174 | |
| 175 | 175 | <span class="tip" data-tooltip="Distance"> | 
| 176 | 176 | <i class="fa fa-map-marker"></i> | 
| @@ -183,7 +183,7 @@ discard block | ||
| 183 | 183 | </footer> | 
| 184 | 184 | </article> | 
| 185 | 185 | <?php | 
| 186 | - } | |
| 186 | + } | |
| 187 | 187 | |
| 188 | 188 | |
| 189 | 189 | /** | 
| @@ -254,135 +254,135 @@ discard block | ||
| 254 | 254 | |
| 255 | 255 | } | 
| 256 | 256 | |
| 257 | - function toUrl() | |
| 258 | -    { | |
| 259 | - $url = $this->baseUrl . 'index.php?country=DE' . | |
| 260 | - '&city=' . $this->city . | |
| 261 | - '&hashtag=' . urlencode($this->hashtag) . | |
| 262 | - '&view=' . $this->view; | |
| 263 | - if($this->postId != '') | |
| 264 | -        { | |
| 265 | - $url .= '&postId=' . $this->postId . | |
| 266 | - '&getPostDetails=TRUE'; | |
| 267 | - } | |
| 268 | - | |
| 269 | - return $url; | |
| 270 | - } | |
| 271 | - | |
| 272 | - function changePostId($postId) | |
| 273 | -    { | |
| 274 | - $tempView = clone $this; | |
| 275 | - $tempView->postId = $postId; | |
| 276 | - $tempView->isDetailedView = TRUE; | |
| 277 | - return $tempView; | |
| 278 | - } | |
| 279 | - | |
| 280 | - function back() | |
| 281 | -    { | |
| 282 | - $tempView = clone $this; | |
| 283 | - $tempView->postId = ''; | |
| 284 | - return $tempView; | |
| 285 | - } | |
| 286 | - | |
| 287 | - function changeView($view) | |
| 288 | -    { | |
| 289 | - $tempView = clone $this; | |
| 290 | - $tempView->view = $view; | |
| 291 | - return $tempView; | |
| 292 | - } | |
| 257 | + function toUrl() | |
| 258 | +	{ | |
| 259 | + $url = $this->baseUrl . 'index.php?country=DE' . | |
| 260 | + '&city=' . $this->city . | |
| 261 | + '&hashtag=' . urlencode($this->hashtag) . | |
| 262 | + '&view=' . $this->view; | |
| 263 | + if($this->postId != '') | |
| 264 | +		{ | |
| 265 | + $url .= '&postId=' . $this->postId . | |
| 266 | + '&getPostDetails=TRUE'; | |
| 267 | + } | |
| 268 | + | |
| 269 | + return $url; | |
| 270 | + } | |
| 271 | + | |
| 272 | + function changePostId($postId) | |
| 273 | +	{ | |
| 274 | + $tempView = clone $this; | |
| 275 | + $tempView->postId = $postId; | |
| 276 | + $tempView->isDetailedView = TRUE; | |
| 277 | + return $tempView; | |
| 278 | + } | |
| 279 | + | |
| 280 | + function back() | |
| 281 | +	{ | |
| 282 | + $tempView = clone $this; | |
| 283 | + $tempView->postId = ''; | |
| 284 | + return $tempView; | |
| 285 | + } | |
| 286 | + | |
| 287 | + function changeView($view) | |
| 288 | +	{ | |
| 289 | + $tempView = clone $this; | |
| 290 | + $tempView->view = $view; | |
| 291 | + return $tempView; | |
| 292 | + } | |
| 293 | 293 | |
| 294 | 294 | function getPosts($jodelAccount) | 
| 295 | 295 |  	{ | 
| 296 | - if($this->hashtag != '#all' && $this->hashtag != '' && $this->hashtag != NULL) | |
| 297 | -        { | |
| 298 | - $accountCreator = new GetChannel(); | |
| 299 | - $accountCreator->view = $this->view; | |
| 300 | - $accountCreator->setAccessToken($jodelAccount->accessToken); | |
| 301 | - $accountCreator->channel = $this->hashtag; | |
| 302 | - $accountCreator->lastPostId = $this->lastPostId; | |
| 303 | - $data = $accountCreator->execute(); | |
| 304 | - } | |
| 305 | - else | |
| 306 | -        { | |
| 307 | - if($this->lastPostId == '' && $this->view == 'combo') | |
| 308 | -            { | |
| 309 | - $url = "/v3/posts/location/combo"; | |
| 310 | - } | |
| 311 | - else | |
| 312 | -            { | |
| 313 | - if($this->view == 'discussed') | |
| 314 | -                { | |
| 315 | - $url = "/v2/posts/location/discussed/"; | |
| 316 | - } | |
| 317 | - else | |
| 318 | -                { | |
| 319 | - if($this->view == 'popular') | |
| 320 | -                    { | |
| 321 | - $url = "/v2/posts/location/popular/"; | |
| 322 | - } | |
| 323 | - else | |
| 324 | -                    { | |
| 325 | - $url = "/v2/posts/location/"; | |
| 326 | - } | |
| 327 | - } | |
| 328 | - } | |
| 329 | - | |
| 330 | - $accountCreator = new GetPosts(); | |
| 331 | - $accountCreator->setLastPostId($this->lastPostId); | |
| 332 | - $accountCreator->setAccessToken($jodelAccount->accessToken); | |
| 333 | - $accountCreator->setUrl($url); | |
| 334 | - $accountCreator->version = 'v3'; | |
| 335 | - | |
| 336 | -            $config = parse_ini_file('config/config.ini.php'); | |
| 337 | - $location = new Location(); | |
| 338 | - $location->setLat($config['default_lat']); | |
| 339 | - $location->setLng($config['default_lng']); | |
| 340 | - $location->setCityName($config['default_location']); | |
| 341 | - $accountCreator->location = $location; | |
| 342 | - $data = $accountCreator->execute(); | |
| 343 | - } | |
| 344 | -    	if(array_key_exists('recent', $data)) | |
| 345 | -        { | |
| 346 | - return $data['recent']; | |
| 347 | - } | |
| 348 | -        else if(array_key_exists('posts', $data)) | |
| 349 | -        { | |
| 350 | - return $data['posts']; | |
| 351 | - } | |
| 352 | - else | |
| 353 | -        { | |
| 354 | -            error_log('Fehler View getPosts '); | |
| 355 | - error_log(print_r($data, true)); | |
| 356 | - | |
| 357 | - $notFound[0] = array( | |
| 358 | - "post_id" => "0", | |
| 359 | - "discovered_by" => 0, | |
| 360 | - "message" => "Not found", | |
| 361 | - "created_at" => "2017-02-11T16:44:50.385Z", | |
| 362 | - "updated_at" => "2017-02-11T16:44:50.385Z", | |
| 363 | - "pin_count" => 0, | |
| 364 | - "color" => "FFBA00", | |
| 365 | - "got_thanks" => FALSE, | |
| 366 | - "post_own" => "friend", | |
| 367 | - "discovered" => 0, | |
| 368 | - "distance" => 9, | |
| 369 | - "vote_count" => 0, | |
| 370 | - "location" => | |
| 371 | -                array("name" => "Berlin", | |
| 372 | - "loc_coordinates" => | |
| 373 | - array( | |
| 374 | - "lat" => 0, | |
| 375 | - "lng" => 0 | |
| 376 | - ), | |
| 377 | - "loc_accuracy" => 0, | |
| 378 | - "country" => "", | |
| 379 | - "city" => "", | |
| 380 | - ), | |
| 381 | - "tags" => | |
| 382 | - array(), | |
| 383 | - "user_handle" => "0" | |
| 384 | - ); | |
| 385 | - return $notFound; | |
| 386 | - } | |
| 296 | + if($this->hashtag != '#all' && $this->hashtag != '' && $this->hashtag != NULL) | |
| 297 | +		{ | |
| 298 | + $accountCreator = new GetChannel(); | |
| 299 | + $accountCreator->view = $this->view; | |
| 300 | + $accountCreator->setAccessToken($jodelAccount->accessToken); | |
| 301 | + $accountCreator->channel = $this->hashtag; | |
| 302 | + $accountCreator->lastPostId = $this->lastPostId; | |
| 303 | + $data = $accountCreator->execute(); | |
| 304 | + } | |
| 305 | + else | |
| 306 | +		{ | |
| 307 | + if($this->lastPostId == '' && $this->view == 'combo') | |
| 308 | +			{ | |
| 309 | + $url = "/v3/posts/location/combo"; | |
| 310 | + } | |
| 311 | + else | |
| 312 | +			{ | |
| 313 | + if($this->view == 'discussed') | |
| 314 | +				{ | |
| 315 | + $url = "/v2/posts/location/discussed/"; | |
| 316 | + } | |
| 317 | + else | |
| 318 | +				{ | |
| 319 | + if($this->view == 'popular') | |
| 320 | +					{ | |
| 321 | + $url = "/v2/posts/location/popular/"; | |
| 322 | + } | |
| 323 | + else | |
| 324 | +					{ | |
| 325 | + $url = "/v2/posts/location/"; | |
| 326 | + } | |
| 327 | + } | |
| 328 | + } | |
| 329 | + | |
| 330 | + $accountCreator = new GetPosts(); | |
| 331 | + $accountCreator->setLastPostId($this->lastPostId); | |
| 332 | + $accountCreator->setAccessToken($jodelAccount->accessToken); | |
| 333 | + $accountCreator->setUrl($url); | |
| 334 | + $accountCreator->version = 'v3'; | |
| 335 | + | |
| 336 | +			$config = parse_ini_file('config/config.ini.php'); | |
| 337 | + $location = new Location(); | |
| 338 | + $location->setLat($config['default_lat']); | |
| 339 | + $location->setLng($config['default_lng']); | |
| 340 | + $location->setCityName($config['default_location']); | |
| 341 | + $accountCreator->location = $location; | |
| 342 | + $data = $accountCreator->execute(); | |
| 343 | + } | |
| 344 | +		if(array_key_exists('recent', $data)) | |
| 345 | +		{ | |
| 346 | + return $data['recent']; | |
| 347 | + } | |
| 348 | +		else if(array_key_exists('posts', $data)) | |
| 349 | +		{ | |
| 350 | + return $data['posts']; | |
| 351 | + } | |
| 352 | + else | |
| 353 | +		{ | |
| 354 | +			error_log('Fehler View getPosts '); | |
| 355 | + error_log(print_r($data, true)); | |
| 356 | + | |
| 357 | + $notFound[0] = array( | |
| 358 | + "post_id" => "0", | |
| 359 | + "discovered_by" => 0, | |
| 360 | + "message" => "Not found", | |
| 361 | + "created_at" => "2017-02-11T16:44:50.385Z", | |
| 362 | + "updated_at" => "2017-02-11T16:44:50.385Z", | |
| 363 | + "pin_count" => 0, | |
| 364 | + "color" => "FFBA00", | |
| 365 | + "got_thanks" => FALSE, | |
| 366 | + "post_own" => "friend", | |
| 367 | + "discovered" => 0, | |
| 368 | + "distance" => 9, | |
| 369 | + "vote_count" => 0, | |
| 370 | + "location" => | |
| 371 | +				array("name" => "Berlin", | |
| 372 | + "loc_coordinates" => | |
| 373 | + array( | |
| 374 | + "lat" => 0, | |
| 375 | + "lng" => 0 | |
| 376 | + ), | |
| 377 | + "loc_accuracy" => 0, | |
| 378 | + "country" => "", | |
| 379 | + "city" => "", | |
| 380 | + ), | |
| 381 | + "tags" => | |
| 382 | + array(), | |
| 383 | + "user_handle" => "0" | |
| 384 | + ); | |
| 385 | + return $notFound; | |
| 386 | + } | |
| 387 | 387 | } | 
| 388 | 388 | } | 
| 389 | 389 | \ No newline at end of file | 
| @@ -49,25 +49,25 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 128 | 128 | <td 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 | </td> | 
| 135 | 135 | <td class="comments"> | 
| 136 | 136 |                              <?php if(!$this->isDetailedView) {?> | 
| 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"]; | 
| @@ -164,7 +164,7 @@ discard block | ||
| 164 | 164 |                                          { | 
| 165 | 165 | ?> | 
| 166 | 166 | <span data-tooltip="Author"> | 
| 167 | - <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | | |
| 167 | + <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> | | |
| 168 | 168 | </span> | 
| 169 | 169 | <?php | 
| 170 | 170 | } | 
| @@ -174,8 +174,8 @@ discard block | ||
| 174 | 174 | |
| 175 | 175 | <span class="tip" data-tooltip="Distance"> | 
| 176 | 176 | <i class="fa fa-map-marker"></i> | 
| 177 | - <?php echo $post['distance'];?> km | |
| 178 | - <span class="tiptext"><?php echo $post['location']['name'];?></span> | |
| 177 | + <?php echo $post['distance']; ?> km | |
| 178 | + <span class="tiptext"><?php echo $post['location']['name']; ?></span> | |
| 179 | 179 | </span> | 
| 180 | 180 | </td> | 
| 181 | 181 | </tr> | 
| @@ -34,7 +34,8 @@ discard block | ||
| 34 | 34 | * Compute HTML Code | 
| 35 | 35 | */ | 
| 36 | 36 | function jodelToHtml($post) | 
| 37 | -    {   //ToDO | |
| 37 | + 	{ | |
| 38 | +//ToDO | |
| 38 | 39 | //Replace # with link | 
| 39 | 40 |          //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); | 
| 40 | 41 | |
| @@ -90,7 +91,8 @@ discard block | ||
| 90 | 91 | |
| 91 | 92 | echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; | 
| 92 | 93 | } | 
| 93 | -                else { | |
| 94 | + else | |
| 95 | +                { | |
| 94 | 96 |                      echo str_replace('  ', '  ', nl2br(htmlspecialchars($post['message']))); | 
| 95 | 97 | } | 
| 96 | 98 | ?> | 
| @@ -98,11 +100,13 @@ discard block | ||
| 98 | 100 | <aside> | 
| 99 | 101 | <?php | 
| 100 | 102 | if($this->isDetailedView) | 
| 101 | -                    {?> | |
| 103 | +                    { | |
| 104 | +?> | |
| 102 | 105 | <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> | 
| 103 | 106 | <?php } | 
| 104 | - else | |
| 105 | -                    {?> | |
| 107 | +else | |
| 108 | +                    { | |
| 109 | +?> | |
| 106 | 110 | <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow"> | 
| 107 | 111 | <?php } ?> | 
| 108 | 112 | <i class="fa fa-angle-up fa-3x"></i> | 
| @@ -111,11 +115,13 @@ discard block | ||
| 111 | 115 | <?php echo $post["vote_count"];?><br /> | 
| 112 | 116 | <?php | 
| 113 | 117 | if($this->isDetailedView) | 
| 114 | -                    {?> | |
| 118 | +                    { | |
| 119 | +?> | |
| 115 | 120 | <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> | 
| 116 | 121 | <?php } | 
| 117 | - else | |
| 118 | -                    {?> | |
| 122 | +else | |
| 123 | +                    { | |
| 124 | +?> | |
| 119 | 125 | <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow"> | 
| 120 | 126 | <?php } ?> | 
| 121 | 127 | <i class="fa fa-angle-down fa-3x"></i> | 
| @@ -133,13 +139,19 @@ discard block | ||
| 133 | 139 | </span> | 
| 134 | 140 | </td> | 
| 135 | 141 | <td class="comments"> | 
| 136 | -                            <?php if(!$this->isDetailedView) {?> | |
| 142 | + <?php if(!$this->isDetailedView) | |
| 143 | +{ | |
| 144 | +?> | |
| 137 | 145 | <span data-tooltip="Comments"> | 
| 138 | 146 | <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> | 
| 139 | 147 | <i class="fa fa-commenting-o"></i> | 
| 140 | -                                    <?php if(array_key_exists("child_count", $post)) { | |
| 148 | +                                    <?php if(array_key_exists("child_count", $post)) | |
| 149 | +{ | |
| 141 | 150 | echo $post["child_count"]; | 
| 142 | - } else echo "0"; | |
| 151 | + } | |
| 152 | +                                            else { | |
| 153 | + echo "0"; | |
| 154 | + } | |
| 143 | 155 | ?> | 
| 144 | 156 | </a> | 
| 145 | 157 | </span> | 
| @@ -342,7 +354,7 @@ discard block | ||
| 342 | 354 | $data = $accountCreator->execute(); | 
| 343 | 355 | } | 
| 344 | 356 |      	if(array_key_exists('recent', $data)) | 
| 345 | -        { | |
| 357 | +    	{ | |
| 346 | 358 | return $data['recent']; | 
| 347 | 359 | } | 
| 348 | 360 |          else if(array_key_exists('posts', $data)) | 
| @@ -47,6 +47,6 @@ | ||
| 47 | 47 | </content> | 
| 48 | 48 | </article> | 
| 49 | 49 | </div> | 
| 50 | - <?php include 'templates/nav-bottom.php';?> | |
| 50 | + <?php include 'templates/nav-bottom.php'; ?> | |
| 51 | 51 | </div> | 
| 52 | -<?php include 'templatess/footer.php';?> | |
| 53 | 52 | \ No newline at end of file | 
| 53 | +<?php include 'templatess/footer.php'; ?> | |
| 54 | 54 | \ No newline at end of file |