@@ -32,7 +32,8 @@ discard block |
||
32 | 32 | * Compute HTML Code |
33 | 33 | */ |
34 | 34 | function jodelToHtml($post) |
35 | - { //ToDO |
|
35 | + { |
|
36 | +//ToDO |
|
36 | 37 | //Replace # with link |
37 | 38 | //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); |
38 | 39 | |
@@ -88,7 +89,8 @@ discard block |
||
88 | 89 | |
89 | 90 | echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; |
90 | 91 | } |
91 | - else { |
|
92 | + else |
|
93 | + { |
|
92 | 94 | echo str_replace(' ', ' ', nl2br(htmlspecialchars($post['message']))); |
93 | 95 | } |
94 | 96 | ?> |
@@ -96,11 +98,13 @@ discard block |
||
96 | 98 | <aside> |
97 | 99 | <?php |
98 | 100 | if($this->isDetailedView) |
99 | - {?> |
|
101 | + { |
|
102 | +?> |
|
100 | 103 | <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
101 | 104 | <?php } |
102 | - else |
|
103 | - {?> |
|
105 | +else |
|
106 | + { |
|
107 | +?> |
|
104 | 108 | <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
105 | 109 | <?php } ?> |
106 | 110 | <i class="fa fa-angle-up fa-3x"></i> |
@@ -109,11 +113,13 @@ discard block |
||
109 | 113 | <?php echo $post["vote_count"];?><br /> |
110 | 114 | <?php |
111 | 115 | if($this->isDetailedView) |
112 | - {?> |
|
116 | + { |
|
117 | +?> |
|
113 | 118 | <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
114 | 119 | <?php } |
115 | - else |
|
116 | - {?> |
|
120 | +else |
|
121 | + { |
|
122 | +?> |
|
117 | 123 | <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
118 | 124 | <?php } ?> |
119 | 125 | <i class="fa fa-angle-down fa-3x"></i> |
@@ -131,13 +137,19 @@ discard block |
||
131 | 137 | </span> |
132 | 138 | </td> |
133 | 139 | <td class="comments"> |
134 | - <?php if(!$this->isDetailedView) {?> |
|
140 | + <?php if(!$this->isDetailedView) |
|
141 | +{ |
|
142 | +?> |
|
135 | 143 | <span data-tooltip="Comments"> |
136 | 144 | <a href="index.php?getPostDetails=true&view=<?php echo $this->view;?>&postId=<?php echo $post["post_id"];?>"> |
137 | 145 | <i class="fa fa-commenting-o"></i> |
138 | - <?php if(array_key_exists("child_count", $post)) { |
|
146 | + <?php if(array_key_exists("child_count", $post)) |
|
147 | +{ |
|
139 | 148 | echo $post["child_count"]; |
140 | - } else echo "0"; |
|
149 | + } |
|
150 | + else { |
|
151 | + echo "0"; |
|
152 | + } |
|
141 | 153 | ?> |
142 | 154 | </a> |
143 | 155 | </span> |
@@ -303,7 +315,7 @@ discard block |
||
303 | 315 | $data = $accountCreator->execute(); |
304 | 316 | } |
305 | 317 | if(array_key_exists('recent', $data)) |
306 | - { |
|
318 | + { |
|
307 | 319 | return $data['recent']; |
308 | 320 | } |
309 | 321 | else if(array_key_exists('posts', $data)) |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if(configPropertyExists($config, 'karmaDeviceUid')) |
100 | - { |
|
100 | + { |
|
101 | 101 | $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
102 | 102 | } |
103 | 103 | else |
@@ -165,7 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | if(isset($_GET['view'])) |
167 | 167 | { |
168 | - switch ($_GET['view']) { |
|
168 | + switch ($_GET['view']) |
|
169 | + { |
|
169 | 170 | case 'discussed': |
170 | 171 | $view = 'discussed'; |
171 | 172 | break; |
@@ -212,7 +213,7 @@ discard block |
||
212 | 213 | { |
213 | 214 | $jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote']); |
214 | 215 | if(isset($_GET['getPostDetails']) && isset($_GET['getPostDetails'])) |
215 | - { |
|
216 | + { |
|
216 | 217 | header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
217 | 218 | } |
218 | 219 | else |
@@ -2,13 +2,25 @@ |
||
2 | 2 | <div class="col-xs-12"> |
3 | 3 | <div class="row"> |
4 | 4 | <div class="col-xs-3"> |
5 | - <a href="<?php echo $baseUrl;?>index.php" <?php if($view->view=='combo') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
5 | + <a href="<?php echo $baseUrl;?>index.php" <?php if($view->view=='combo') |
|
6 | +{ |
|
7 | + echo 'class="active"'; |
|
8 | +} |
|
9 | +?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
6 | 10 | </div> |
7 | 11 | <div class="col-xs-3"> |
8 | - <a href="<?php echo $baseUrl;?>index.php?view=discussed" <?php if($view->view=='discussed') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
12 | + <a href="<?php echo $baseUrl;?>index.php?view=discussed" <?php if($view->view=='discussed') |
|
13 | +{ |
|
14 | + echo 'class="active"'; |
|
15 | +} |
|
16 | +?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
9 | 17 | </div> |
10 | 18 | <div class="col-xs-3"> |
11 | - <a href="<?php echo $baseUrl;?>index.php?view=popular" <?php if($view->view=='popular') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
19 | + <a href="<?php echo $baseUrl;?>index.php?view=popular" <?php if($view->view=='popular') |
|
20 | +{ |
|
21 | + echo 'class="active"'; |
|
22 | +} |
|
23 | +?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
12 | 24 | </div> |
13 | 25 | <div class="col-xs-3"> |
14 | 26 | <nav> |
@@ -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 | |
@@ -124,7 +125,11 @@ discard block |
||
124 | 125 | |
125 | 126 | <div id="location_mobile" class="hidden-sm-up"> |
126 | 127 | <form method="get"> |
127 | - <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
128 | + <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) |
|
129 | +{ |
|
130 | + echo $newPositionStatus; |
|
131 | +} |
|
132 | +?>" required> |
|
128 | 133 | |
129 | 134 | <input type="submit" id="submit_mobile" class="fa" value="" /> |
130 | 135 | </form> |
@@ -146,7 +151,9 @@ discard block |
||
146 | 151 | } ?> |
147 | 152 | </content> |
148 | 153 | |
149 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
154 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
155 | +{ |
|
156 | +?> |
|
150 | 157 | <p id="loading"> |
151 | 158 | Loading… |
152 | 159 | </p> |
@@ -159,7 +166,11 @@ discard block |
||
159 | 166 | <div> |
160 | 167 | <h2>Position / Hashtag</h2> |
161 | 168 | <form method="get"> |
162 | - <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
169 | + <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) |
|
170 | +{ |
|
171 | + echo $newPositionStatus; |
|
172 | +} |
|
173 | +?>" required> |
|
163 | 174 | <label>try: #jhj</label><br> |
164 | 175 | <input type="submit" value="Set Location" /> |
165 | 176 | </form> |
@@ -175,7 +186,9 @@ discard block |
||
175 | 186 | |
176 | 187 | <article> |
177 | 188 | <div> |
178 | - <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> |
|
189 | + <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) |
|
190 | +{ |
|
191 | +?> |
|
179 | 192 | <h2>Comment on Jodel</h2> |
180 | 193 | <form method="POST"> |
181 | 194 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> |
@@ -183,7 +196,10 @@ discard block |
||
183 | 196 | <br /> |
184 | 197 | <input type="submit" value="SEND" /> |
185 | 198 | </form> |
186 | - <?php } else { ?> |
|
199 | + <?php } |
|
200 | +else |
|
201 | +{ |
|
202 | +?> |
|
187 | 203 | <h2>New Jodel</h2> |
188 | 204 | <form method="POST"> |
189 | 205 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -242,7 +258,9 @@ discard block |
||
242 | 258 | $('html,body').animate({scrollTop: aTag.offset().top-90},'slow'); |
243 | 259 | } |
244 | 260 | |
245 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
261 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
262 | +{ |
|
263 | +?> |
|
246 | 264 | |
247 | 265 | |
248 | 266 |