@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | return TRUE; |
56 | 56 | } |
57 | 57 | } |
58 | -function isUserAdmin() { |
|
58 | +function isUserAdmin() |
|
59 | +{ |
|
59 | 60 | global $config; |
60 | 61 | if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
61 | 62 | { |
@@ -106,7 +107,7 @@ discard block |
||
106 | 107 | } |
107 | 108 | |
108 | 109 | if(configPropertyExists($config, 'karmaDeviceUid')) |
109 | - { |
|
110 | + { |
|
110 | 111 | $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
111 | 112 | } |
112 | 113 | else |
@@ -176,7 +177,8 @@ discard block |
||
176 | 177 | |
177 | 178 | if(isset($_GET['view'])) |
178 | 179 | { |
179 | - switch ($_GET['view']) { |
|
180 | + switch ($_GET['view']) |
|
181 | + { |
|
180 | 182 | case 'discussed': |
181 | 183 | $view = 'discussed'; |
182 | 184 | break; |
@@ -223,7 +225,7 @@ discard block |
||
223 | 225 | { |
224 | 226 | $jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote']); |
225 | 227 | if(isset($_GET['getPostDetails']) && isset($_GET['getPostDetails'])) |
226 | - { |
|
228 | + { |
|
227 | 229 | header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
228 | 230 | } |
229 | 231 | else |
@@ -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> |
@@ -132,14 +138,20 @@ discard block |
||
132 | 138 | <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
133 | 139 | </span> |
134 | 140 | </span> |
135 | - <?php if(!$this->isDetailedView) {?> |
|
141 | + <?php if(!$this->isDetailedView) |
|
142 | +{ |
|
143 | +?> |
|
136 | 144 | <span class="comments"> |
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> |
@@ -355,7 +367,7 @@ discard block |
||
355 | 367 | $data = $accountCreator->execute(); |
356 | 368 | } |
357 | 369 | if(array_key_exists('recent', $data)) |
358 | - { |
|
370 | + { |
|
359 | 371 | return $data['recent']; |
360 | 372 | } |
361 | 373 | else if(array_key_exists('posts', $data)) |