@@ -63,25 +63,25 @@ discard block |
||
| 63 | 63 | $timediff_inDays = (string)$timediff->format('%d'); |
| 64 | 64 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 65 | 65 | |
| 66 | - if($timediff_inMonth!=0) |
|
| 66 | + if($timediff_inMonth != 0) |
|
| 67 | 67 | { |
| 68 | 68 | $timediff = $timediff_inMonth . "m"; |
| 69 | 69 | } |
| 70 | 70 | else |
| 71 | 71 | { |
| 72 | - if($timediff_inDays!=0) |
|
| 72 | + if($timediff_inDays != 0) |
|
| 73 | 73 | { |
| 74 | 74 | $timediff = $timediff_inDays . "d"; |
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | 77 | { |
| 78 | - if($timediff_inHours!=0) |
|
| 78 | + if($timediff_inHours != 0) |
|
| 79 | 79 | { |
| 80 | 80 | $timediff = $timediff_inHours . "h"; |
| 81 | 81 | } |
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | - if($timediff_inMinutes!=0) |
|
| 84 | + if($timediff_inMinutes != 0) |
|
| 85 | 85 | { |
| 86 | 86 | $timediff = $timediff_inMinutes . "m"; |
| 87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | ?> |
| 98 | - <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;"> |
|
| 98 | + <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;"> |
|
| 99 | 99 | <content> |
| 100 | 100 | <?php |
| 101 | 101 | if(isset($post['image_url'])) |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | ?> |
| 111 | 111 | </content> |
| 112 | 112 | <aside> |
| 113 | - <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)"> |
|
| 113 | + <button onclick="vote('<?php echo $post['post_id']; ?>', 'up', this)"> |
|
| 114 | 114 | <i class="fa fa-angle-up fa-3x"></i> |
| 115 | 115 | </button> |
| 116 | - <br><span><?php echo $post["vote_count"];?></span><br> |
|
| 116 | + <br><span><?php echo $post["vote_count"]; ?></span><br> |
|
| 117 | 117 | |
| 118 | - <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)"> |
|
| 118 | + <button onclick="vote('<?php echo $post['post_id']; ?>', 'down', this)"> |
|
| 119 | 119 | <i class="fa fa-angle-down fa-3x"></i> |
| 120 | 120 | </button> |
| 121 | 121 | </aside> |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | <span class="time"> |
| 127 | 127 | <span class="tip" data-tooltip="Time"> |
| 128 | 128 | <i class="fa fa-clock-o"></i> |
| 129 | - <?php echo $timediff;?> |
|
| 130 | - <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
|
| 129 | + <?php echo $timediff; ?> |
|
| 130 | + <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span> |
|
| 131 | 131 | </span> |
| 132 | 132 | </span> |
| 133 | 133 | <?php if(!$this->isDetailedView) {?> |
| 134 | 134 | <span class="comments"> |
| 135 | 135 | <span data-tooltip="Comments"> |
| 136 | - <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
|
| 136 | + <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>"> |
|
| 137 | 137 | <i class="fa fa-commenting-o"></i> |
| 138 | 138 | <?php if(array_key_exists("child_count", $post)) |
| 139 | 139 | { |
@@ -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 | </span> |
| 181 | 181 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView) |
| 216 | 216 | { |
| 217 | - $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
| 217 | + $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | return $description; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | { |
| 317 | 317 | return $data['recent']; |
| 318 | 318 | } |
| 319 | - else if(is_array($data) && array_key_exists('posts', $data)&& array_key_exists(0, $data['posts'])) |
|
| 319 | + else if(is_array($data) && array_key_exists('posts', $data) && array_key_exists(0, $data['posts'])) |
|
| 320 | 320 | { |
| 321 | 321 | return $data['posts']; |
| 322 | 322 | } |
@@ -48,7 +48,8 @@ discard block |
||
| 48 | 48 | * Compute HTML Code |
| 49 | 49 | */ |
| 50 | 50 | function jodelToHtml($post) |
| 51 | - { //ToDO |
|
| 51 | + { |
|
| 52 | +//ToDO |
|
| 52 | 53 | //Replace # with link |
| 53 | 54 | //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); |
| 54 | 55 | |
@@ -104,7 +105,8 @@ discard block |
||
| 104 | 105 | |
| 105 | 106 | echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; |
| 106 | 107 | } |
| 107 | - else { |
|
| 108 | + else |
|
| 109 | + { |
|
| 108 | 110 | echo str_replace(' ', ' ', nl2br(htmlspecialchars($post['message']))); |
| 109 | 111 | } |
| 110 | 112 | ?> |
@@ -130,15 +132,20 @@ discard block |
||
| 130 | 132 | <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
| 131 | 133 | </span> |
| 132 | 134 | </span> |
| 133 | - <?php if(!$this->isDetailedView) {?> |
|
| 135 | + <?php if(!$this->isDetailedView) |
|
| 136 | +{ |
|
| 137 | +?> |
|
| 134 | 138 | <span class="comments"> |
| 135 | 139 | <span data-tooltip="Comments"> |
| 136 | 140 | <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
| 137 | 141 | <i class="fa fa-commenting-o"></i> |
| 138 | 142 | <?php if(array_key_exists("child_count", $post)) |
| 139 | - { |
|
| 143 | +{ |
|
| 140 | 144 | echo $post["child_count"]; |
| 141 | - } else echo "0"; |
|
| 145 | + } |
|
| 146 | + else { |
|
| 147 | + echo "0"; |
|
| 148 | + } |
|
| 142 | 149 | ?> |
| 143 | 150 | </a> |
| 144 | 151 | </span> |
@@ -313,7 +320,7 @@ discard block |
||
| 313 | 320 | $data = $accountCreator->execute(); |
| 314 | 321 | } |
| 315 | 322 | if(is_array($data) && array_key_exists('recent', $data) && array_key_exists(0, $data['recent'])) |
| 316 | - { |
|
| 323 | + { |
|
| 317 | 324 | return $data['recent']; |
| 318 | 325 | } |
| 319 | 326 | else if(is_array($data) && array_key_exists('posts', $data)&& array_key_exists(0, $data['posts'])) |