@@ -31,7 +31,7 @@ |
||
31 | 31 | </li> |
32 | 32 | |
33 | 33 | <?php |
34 | -$user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; |
|
34 | +$user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; |
|
35 | 35 | if (stristr($user_agent, 'Firefox/')) { |
36 | 36 | ?> |
37 | 37 | <li>You can also add TheyWorkForYou to <a href="http://mycroft.mozdev.org/download.html?name=theyworkforyou">Firefox's search box</a>.</li> |
@@ -67,4 +67,4 @@ |
||
67 | 67 | api_output($out); |
68 | 68 | } else { |
69 | 69 | api_error('Nothing'); |
70 | - } |
|
70 | + } |
@@ -12,16 +12,16 @@ discard block |
||
12 | 12 | |
13 | 13 | $out = array(); |
14 | 14 | if (isset ($data['rows'])) { |
15 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
15 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
16 | 16 | $row = $data['rows'][$i]; |
17 | 17 | if (count($row) == 0) continue; |
18 | 18 | if ($row['htype'] == '12') { |
19 | 19 | if (isset($row['speaker']) && count($row['speaker']) > 0) { |
20 | 20 | $speaker = $row['speaker']; |
21 | - if (is_file(BASEDIR . IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpeg')) { |
|
22 | - $row['speaker']['image'] = IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpeg'; |
|
23 | - } elseif (is_file(BASEDIR . IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpg')) { |
|
24 | - $row['speaker']['image'] = IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpg'; |
|
21 | + if (is_file(BASEDIR.IMAGEPATH.'mps/'.$speaker['person_id'].'.jpeg')) { |
|
22 | + $row['speaker']['image'] = IMAGEPATH.'mps/'.$speaker['person_id'].'.jpeg'; |
|
23 | + } elseif (is_file(BASEDIR.IMAGEPATH.'mps/'.$speaker['person_id'].'.jpg')) { |
|
24 | + $row['speaker']['image'] = IMAGEPATH.'mps/'.$speaker['person_id'].'.jpg'; |
|
25 | 25 | } |
26 | 26 | $desc = ''; |
27 | 27 | if (isset($speaker['office'])) { |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | foreach ($speaker['office'] as $off) { |
30 | 30 | $desc[] = $off['pretty']; |
31 | 31 | } |
32 | - $desc = join(', ', $desc) . '; '; |
|
32 | + $desc = join(', ', $desc).'; '; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($speaker['house'] == 1 && $speaker['party'] != 'Speaker' && $speaker['party'] != 'Deputy Speaker' && $speaker['constituency']) { |
36 | - $desc .= $speaker['constituency'] . ', '; |
|
36 | + $desc .= $speaker['constituency'].', '; |
|
37 | 37 | } |
38 | 38 | $desc .= _htmlentities($speaker['party']); |
39 | 39 | if ($desc) $row['speaker']['desc'] = $desc; |
@@ -14,7 +14,9 @@ discard block |
||
14 | 14 | if (isset ($data['rows'])) { |
15 | 15 | for ($i=0; $i<count($data['rows']); $i++) { |
16 | 16 | $row = $data['rows'][$i]; |
17 | - if (count($row) == 0) continue; |
|
17 | + if (count($row) == 0) { |
|
18 | + continue; |
|
19 | + } |
|
18 | 20 | if ($row['htype'] == '12') { |
19 | 21 | if (isset($row['speaker']) && count($row['speaker']) > 0) { |
20 | 22 | $speaker = $row['speaker']; |
@@ -36,7 +38,9 @@ discard block |
||
36 | 38 | $desc .= $speaker['constituency'] . ', '; |
37 | 39 | } |
38 | 40 | $desc .= _htmlentities($speaker['party']); |
39 | - if ($desc) $row['speaker']['desc'] = $desc; |
|
41 | + if ($desc) { |
|
42 | + $row['speaker']['desc'] = $desc; |
|
43 | + } |
|
40 | 44 | } |
41 | 45 | } |
42 | 46 | $out[] = $row; |
@@ -52,8 +56,9 @@ discard block |
||
52 | 56 | $has_content = false; |
53 | 57 | } |
54 | 58 | $entry = $row; |
55 | - if (isset($row['excerpt'])) |
|
56 | - $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
59 | + if (isset($row['excerpt'])) { |
|
60 | + $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
61 | + } |
|
57 | 62 | if ($has_content) { |
58 | 63 | } else { |
59 | 64 | unset($entry['listurl']); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | if (isset($comment['comment_id'])) { |
72 | - $id = 'c' . $comment['comment_id']; |
|
72 | + $id = 'c'.$comment['comment_id']; |
|
73 | 73 | } else { |
74 | 74 | $id = ''; |
75 | 75 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // COMMENT REPORTING LINK. |
83 | 83 | |
84 | 84 | if (($this_page != 'commentreport' && |
85 | - $this_page != 'addcomment' && |
|
85 | + $this_page != 'addcomment' && |
|
86 | 86 | $this_page != 'admin_commentreport') |
87 | 87 | && $THEUSER->is_able_to('reportcomment') |
88 | 88 | && $THEUSER->user_id() != $comment['user_id'] |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'ret' => $comment['url'] |
99 | 99 | )); |
100 | 100 | |
101 | - $reporthtml = '(<a href="' . $URL->generate() . '" title="Notify moderators that this comment should be deleted">Report this comment</a>)'; |
|
101 | + $reporthtml = '(<a href="'.$URL->generate().'" title="Notify moderators that this comment should be deleted">Report this comment</a>)'; |
|
102 | 102 | |
103 | 103 | } elseif ($comment['modflagged']) { |
104 | 104 | $reporthtml = '(This comment has been reported to moderators)'; |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $date = format_date($date, SHORTDATEFORMAT); |
118 | 118 | $time = format_time($time, TIMEFORMAT); |
119 | 119 | ?> |
120 | - <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br> |
|
120 | + <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']).' '._htmlentities($comment['lastname']); ?></strong></a><br> |
|
121 | 121 | <small>Posted on <?php echo $date; |
122 | 122 | |
123 | 123 | if (isset($comment['url'])) { |
124 | - print ' <a href="' . $comment['url'] . '" title="Link to this comment">' . $time . '</a>'; |
|
124 | + print ' <a href="'.$comment['url'].'" title="Link to this comment">'.$time.'</a>'; |
|
125 | 125 | |
126 | 126 | } else { |
127 | 127 | // There won't be a URL when we're just previewing a comment. |
@@ -39,20 +39,20 @@ |
||
39 | 39 | |
40 | 40 | // Get the name of the member whose epobject was commented upon (if any). |
41 | 41 | if (isset($comment['speaker']) && $comment['speaker']['name'] != '') { |
42 | - $member_name = $comment['speaker']['name'] . ': '; |
|
42 | + $member_name = $comment['speaker']['name'].': '; |
|
43 | 43 | } else { |
44 | 44 | $member_name = ''; |
45 | 45 | } |
46 | 46 | |
47 | - $user_name = _htmlentities($comment['firstname'] . ' ' . $comment['lastname']); |
|
47 | + $user_name = _htmlentities($comment['firstname'].' '.$comment['lastname']); |
|
48 | 48 | |
49 | 49 | // We're grouping things by epobject_id, so we're going to display the number |
50 | 50 | // of comments on this epobject. |
51 | 51 | $plural = $comment['total_comments'] == 1 ? ' comment' : ' comments'; |
52 | 52 | |
53 | - echo "\t\t\t\t<p><a href=\"$comment[url]\">$comment[total_comments]$plural</a> to <strong>" . $member_name . $hansardtext . "</strong><br>\n"; |
|
53 | + echo "\t\t\t\t<p><a href=\"$comment[url]\">$comment[total_comments]$plural</a> to <strong>".$member_name.$hansardtext."</strong><br>\n"; |
|
54 | 54 | echo "\t\t\t\t<small>(posted on $date)</small><br>\n"; |
55 | - echo "\t\t\t\t" . prepare_comment_for_display($comment['body']) . "</p>"; ?> |
|
55 | + echo "\t\t\t\t".prepare_comment_for_display($comment['body'])."</p>"; ?> |
|
56 | 56 | |
57 | 57 | <?php |
58 | 58 | $PAGE->stripe_end(); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (isset ($data['rows'])) { |
13 | 13 | $out = array(); |
14 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
14 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
15 | 15 | $row = $data['rows'][$i]; |
16 | 16 | |
17 | 17 | if ($row['htype'] == '10' && isset($row['excerpt']) && strstr($row['excerpt'], "was asked—")) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if ($row['htype'] == '10') { |
41 | 41 | $out[] = array('entry' => $entry, 'subs' => array()); |
42 | 42 | } else { |
43 | - $out[sizeof($out)-1]['subs'][] = $entry; |
|
43 | + $out[sizeof($out) - 1]['subs'][] = $entry; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | } |
@@ -27,8 +27,9 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | $entry = $row; |
30 | - if (isset($row['excerpt'])) |
|
31 | - $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
30 | + if (isset($row['excerpt'])) { |
|
31 | + $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
32 | + } |
|
32 | 33 | if ($has_content) { |
33 | 34 | } else { |
34 | 35 | unset($entry['listurl']); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | public $firstname = ''; |
28 | 28 | public $lastname = ''; |
29 | 29 | public $body = ''; |
30 | - public $reported = NULL; // datetime |
|
31 | - public $resolved = NULL; // datetime |
|
32 | - public $resolvedby = ''; // user_id |
|
33 | - public $locked = NULL; // datetime |
|
34 | - public $lockedby = ''; // user_id |
|
35 | - public $upheld = ''; // boolean |
|
30 | + public $reported = NULL; // datetime |
|
31 | + public $resolved = NULL; // datetime |
|
32 | + public $resolvedby = ''; // user_id |
|
33 | + public $locked = NULL; // datetime |
|
34 | + public $lockedby = ''; // user_id |
|
35 | + public $upheld = ''; // boolean |
|
36 | 36 | |
37 | 37 | // If the user was logged in, this will be set: |
38 | 38 | public $user_id = ''; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public $email = ''; |
41 | 41 | |
42 | 42 | |
43 | - public function __construct($report_id='') { |
|
43 | + public function __construct($report_id = '') { |
|
44 | 44 | // Pass it a report id and it gets and sets this report's data. |
45 | 45 | |
46 | 46 | $this->db = new ParlDB; |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $q = $this->db->query("SELECT commentreports.comment_id, |
51 | 51 | commentreports.user_id, |
52 | 52 | commentreports.body, |
53 | - DATE_FORMAT(commentreports.reported, '" . SHORTDATEFORMAT_SQL . ' ' . TIMEFORMAT_SQL . "') AS reported, |
|
54 | - DATE_FORMAT(commentreports.resolved, '" . SHORTDATEFORMAT_SQL . ' ' . TIMEFORMAT_SQL . "') AS resolved, |
|
53 | + DATE_FORMAT(commentreports.reported, '" . SHORTDATEFORMAT_SQL.' '.TIMEFORMAT_SQL."') AS reported, |
|
54 | + DATE_FORMAT(commentreports.resolved, '" . SHORTDATEFORMAT_SQL.' '.TIMEFORMAT_SQL."') AS resolved, |
|
55 | 55 | commentreports.resolvedby, |
56 | 56 | commentreports.locked, |
57 | 57 | commentreports.lockedby, |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | |
72 | 72 | if ($q->rows() > 0) { |
73 | 73 | $this->report_id = $report_id; |
74 | - $this->comment_id = $q->field(0, 'comment_id'); |
|
75 | - $this->body = $q->field(0, 'body'); |
|
74 | + $this->comment_id = $q->field(0, 'comment_id'); |
|
75 | + $this->body = $q->field(0, 'body'); |
|
76 | 76 | $this->reported = $q->field(0, 'reported'); |
77 | 77 | $this->resolved = $q->field(0, 'resolved'); |
78 | - $this->resolvedby = $q->field(0, 'resolvedby'); |
|
78 | + $this->resolvedby = $q->field(0, 'resolvedby'); |
|
79 | 79 | $this->locked = $q->field(0, 'locked'); |
80 | 80 | $this->lockedby = $q->field(0, 'lockedby'); |
81 | 81 | $this->upheld = $q->field(0, 'upheld'); |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | $q = $this->db->query("SELECT commentreports.comment_id, |
96 | 96 | commentreports.user_id, |
97 | 97 | commentreports.body, |
98 | - DATE_FORMAT(commentreports.reported, '" . SHORTDATEFORMAT_SQL . ' ' . TIMEFORMAT_SQL . "') AS reported, |
|
99 | - DATE_FORMAT(commentreports.resolved, '" . SHORTDATEFORMAT_SQL . ' ' . TIMEFORMAT_SQL . "') AS resolved, |
|
98 | + DATE_FORMAT(commentreports.reported, '" . SHORTDATEFORMAT_SQL.' '.TIMEFORMAT_SQL."') AS reported, |
|
99 | + DATE_FORMAT(commentreports.resolved, '" . SHORTDATEFORMAT_SQL.' '.TIMEFORMAT_SQL."') AS resolved, |
|
100 | 100 | commentreports.resolvedby, |
101 | 101 | commentreports.locked, |
102 | 102 | commentreports.lockedby, |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | |
112 | 112 | if ($q->rows() > 0) { |
113 | 113 | $this->report_id = $report_id; |
114 | - $this->comment_id = $q->field(0, 'comment_id'); |
|
115 | - $this->body = $q->field(0, 'body'); |
|
114 | + $this->comment_id = $q->field(0, 'comment_id'); |
|
115 | + $this->body = $q->field(0, 'body'); |
|
116 | 116 | $this->reported = $q->field(0, 'reported'); |
117 | 117 | $this->resolved = $q->field(0, 'resolved'); |
118 | - $this->resolvedby = $q->field(0, 'resolvedby'); |
|
118 | + $this->resolvedby = $q->field(0, 'resolvedby'); |
|
119 | 119 | $this->locked = $q->field(0, 'locked'); |
120 | 120 | $this->lockedby = $q->field(0, 'lockedby'); |
121 | 121 | $this->upheld = $q->field(0, 'upheld'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | public function report_id() { return $this->report_id; } |
132 | 132 | public function comment_id() { return $this->comment_id; } |
133 | 133 | public function user_id() { return $this->user_id; } |
134 | - public function user_name() { return $this->firstname . ' ' . $this->lastname; } |
|
134 | + public function user_name() { return $this->firstname.' '.$this->lastname; } |
|
135 | 135 | public function firstname() { return $this->firstname; } |
136 | 136 | public function lastname() { return $this->lastname; } |
137 | 137 | public function email() { return $this->email; } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | global $THEUSER, $PAGE; |
163 | 163 | |
164 | 164 | if (!$THEUSER->is_able_to('reportcomment')) { |
165 | - $PAGE->error_message ("Sorry, you are not allowed to post reports."); |
|
165 | + $PAGE->error_message("Sorry, you are not allowed to post reports."); |
|
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $q = $this->db->query("SELECT report_id |
177 | 177 | FROM commentreports |
178 | - WHERE user_id = '" . $THEUSER->user_id() . "' |
|
178 | + WHERE user_id = '" . $THEUSER->user_id()."' |
|
179 | 179 | AND reported + 0 > NOW() - $flood_time_limit"); |
180 | 180 | |
181 | 181 | if ($q->rows() > 0) { |
@@ -230,19 +230,19 @@ discard block |
||
230 | 230 | |
231 | 231 | if ($q->success()) { |
232 | 232 | // Inserted OK, so set up this object's variables. |
233 | - $this->report_id = $q->insert_id(); |
|
234 | - $this->comment_id = $COMMENT->comment_id(); |
|
235 | - $this->body = $body; |
|
236 | - $this->reported = $time; |
|
233 | + $this->report_id = $q->insert_id(); |
|
234 | + $this->comment_id = $COMMENT->comment_id(); |
|
235 | + $this->body = $body; |
|
236 | + $this->reported = $time; |
|
237 | 237 | |
238 | 238 | if ($THEUSER->isloggedin()) { |
239 | - $this->user_id = $THEUSER->user_id(); |
|
239 | + $this->user_id = $THEUSER->user_id(); |
|
240 | 240 | $this->firstname = $THEUSER->firstname(); |
241 | 241 | $this->lastname = $THEUSER->lastname(); |
242 | 242 | } else { |
243 | - $this->email = $reportdata['email']; |
|
244 | - $this->firstname = $reportdata['firstname']; |
|
245 | - $this->lastname = $reportdata['lastname']; |
|
243 | + $this->email = $reportdata['email']; |
|
244 | + $this->firstname = $reportdata['firstname']; |
|
245 | + $this->lastname = $reportdata['lastname']; |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | 'cid'=>$this->comment_id |
259 | 259 | )); |
260 | 260 | |
261 | - $emailbody = "A new comment report has been filed by " . $this->user_name() . ".\n\n"; |
|
262 | - $emailbody .= "COMMENT:\n" . $COMMENT->body() . "\n\n"; |
|
263 | - $emailbody .= "REPORT:\n" . $this->body . "\n\n"; |
|
264 | - $emailbody .= "To manage this report follow this link: https://" . DOMAIN . $URL->generate('none') . "\n"; |
|
261 | + $emailbody = "A new comment report has been filed by ".$this->user_name().".\n\n"; |
|
262 | + $emailbody .= "COMMENT:\n".$COMMENT->body()."\n\n"; |
|
263 | + $emailbody .= "REPORT:\n".$this->body."\n\n"; |
|
264 | + $emailbody .= "To manage this report follow this link: https://".DOMAIN.$URL->generate('none')."\n"; |
|
265 | 265 | |
266 | 266 | send_email(REPORTLIST, 'New comment report', $emailbody); |
267 | 267 | |
@@ -274,14 +274,14 @@ discard block |
||
274 | 274 | $email = $this->email(); |
275 | 275 | } |
276 | 276 | |
277 | - $data = array ( |
|
277 | + $data = array( |
|
278 | 278 | 'to' => $email, |
279 | 279 | 'template' => 'report_acknowledge' |
280 | 280 | ); |
281 | - $merge = array ( |
|
281 | + $merge = array( |
|
282 | 282 | 'FIRSTNAME' => $this->firstname(), |
283 | 283 | 'LASTNAME' => $this->lastname(), |
284 | - 'COMMENTURL' => "https://" . DOMAIN . $COMMENT->url(), |
|
284 | + 'COMMENTURL' => "https://".DOMAIN.$COMMENT->url(), |
|
285 | 285 | 'REPORTBODY' => strip_tags($this->body()) |
286 | 286 | ); |
287 | 287 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $data = array(); |
303 | 303 | |
304 | 304 | if (is_numeric($this->report_id)) { |
305 | - $data = array ( |
|
305 | + $data = array( |
|
306 | 306 | 'report_id' => $this->report_id(), |
307 | 307 | 'comment_id' => $this->comment_id(), |
308 | 308 | 'user_id' => $this->user_id(), |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | if ($THEUSER->is_able_to('deletecomment')) { |
340 | 340 | $time = gmdate("Y-m-d H:i:s"); |
341 | 341 | |
342 | - $q = $this->db->query ("UPDATE commentreports |
|
342 | + $q = $this->db->query("UPDATE commentreports |
|
343 | 343 | SET locked = '$time', |
344 | - lockedby = '" . $THEUSER->user_id() . "' |
|
345 | - WHERE report_id = '" . $this->report_id . "' |
|
344 | + lockedby = '".$THEUSER->user_id()."' |
|
345 | + WHERE report_id = '" . $this->report_id."' |
|
346 | 346 | "); |
347 | 347 | |
348 | 348 | if ($q->success()) { |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | $this->lockedby = $THEUSER->user_id(); |
351 | 351 | return true; |
352 | 352 | } else { |
353 | - $PAGE->error_message ("Sorry, we were unable to lock this report."); |
|
353 | + $PAGE->error_message("Sorry, we were unable to lock this report."); |
|
354 | 354 | return false; |
355 | 355 | } |
356 | 356 | } else { |
357 | - $PAGE->error_message ("You are not authorised to delete annotations."); |
|
357 | + $PAGE->error_message("You are not authorised to delete annotations."); |
|
358 | 358 | return false; |
359 | 359 | } |
360 | 360 | } |
@@ -363,10 +363,10 @@ discard block |
||
363 | 363 | public function unlock() { |
364 | 364 | // Unlock a comment so it can be examined by someone else. |
365 | 365 | |
366 | - $q = $this->db->query ("UPDATE commentreports |
|
366 | + $q = $this->db->query("UPDATE commentreports |
|
367 | 367 | SET locked = NULL, |
368 | 368 | lockedby = NULL |
369 | - WHERE report_id = '" . $this->report_id . "' |
|
369 | + WHERE report_id = '" . $this->report_id."' |
|
370 | 370 | "); |
371 | 371 | |
372 | 372 | if ($q->success()) { |
@@ -437,16 +437,16 @@ discard block |
||
437 | 437 | |
438 | 438 | return true; |
439 | 439 | } else { |
440 | - $PAGE->error_message ("Sorry, we couldn't resolve this report."); |
|
440 | + $PAGE->error_message("Sorry, we couldn't resolve this report."); |
|
441 | 441 | return false; |
442 | 442 | } |
443 | 443 | } else { |
444 | - $PAGE->error_message ("This report has already been resolved (on " . $this->resolved . ")"); |
|
444 | + $PAGE->error_message("This report has already been resolved (on ".$this->resolved.")"); |
|
445 | 445 | return false; |
446 | 446 | } |
447 | 447 | |
448 | 448 | } else { |
449 | - $PAGE->error_message ("You are not authorised to resolve reports."); |
|
449 | + $PAGE->error_message("You are not authorised to resolve reports."); |
|
450 | 450 | return false; |
451 | 451 | } |
452 | 452 | } |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | public $firstname = ''; |
28 | 28 | public $lastname = ''; |
29 | 29 | public $body = ''; |
30 | - public $reported = NULL; // datetime |
|
31 | - public $resolved = NULL; // datetime |
|
30 | + public $reported = null; // datetime |
|
31 | + public $resolved = null; // datetime |
|
32 | 32 | public $resolvedby = ''; // user_id |
33 | - public $locked = NULL; // datetime |
|
33 | + public $locked = null; // datetime |
|
34 | 34 | public $lockedby = ''; // user_id |
35 | 35 | public $upheld = ''; // boolean |
36 | 36 | |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | "); |
371 | 371 | |
372 | 372 | if ($q->success()) { |
373 | - $this->locked = NULL; |
|
374 | - $this->lockedby = NULL; |
|
373 | + $this->locked = null; |
|
374 | + $this->lockedby = null; |
|
375 | 375 | return true; |
376 | 376 | } else { |
377 | 377 | return false; |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | |
432 | 432 | $this->resolved = $time; |
433 | 433 | $this->resolvedby = $THEUSER->user_id(); |
434 | - $this->locked = NULL; |
|
435 | - $this->lockedby = NULL; |
|
434 | + $this->locked = null; |
|
435 | + $this->lockedby = null; |
|
436 | 436 | $this->upheld = $upheld; |
437 | 437 | |
438 | 438 | return true; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <select id="section" name="section"> |
67 | 67 | <option value="">Any |
68 | 68 | <?php |
69 | - optgroups(array( |
|
69 | + optgroups(array( |
|
70 | 70 | 'UK Parliament' => array( |
71 | 71 | 'uk' => 'All UK', |
72 | 72 | 'debates' => 'House of Commons debates', |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | 'sp' => 'Debates', |
86 | 86 | 'spwrans' => 'Written answers', |
87 | 87 | ), |
88 | - ), $section); |
|
89 | - ?> |
|
88 | + ), $section); |
|
89 | + ?> |
|
90 | 90 | </select> |
91 | 91 | <div class="help"> |
92 | 92 | Restrict results to a particular parliament or assembly that we cover (e.g. the |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if (preg_match('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', $filter_ss, $m)) { |
24 | 24 | $from = $m[1]; |
25 | 25 | $to = $m[2]; |
26 | - $filter_ss = preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss); |
|
26 | + $filter_ss = preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss); |
|
27 | 27 | } |
28 | 28 | $section = get_http_var('section'); |
29 | 29 | if (preg_match('#\s*section:([a-z]*)#', $filter_ss, $m)) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $filter_ss = preg_replace('#\s*speaker:[0-9]*#', '', $filter_ss); |
37 | 37 | } |
38 | 38 | |
39 | -$this->block_start(array( 'title' => "Filtering your results")); |
|
39 | +$this->block_start(array('title' => "Filtering your results")); |
|
40 | 40 | |
41 | 41 | ?> |
42 | 42 | <form method="get" action="/search/"> |
@@ -5,7 +5,9 @@ |
||
5 | 5 | echo '<optgroup label="', $key, '">'; |
6 | 6 | foreach ($values as $k => $v) { |
7 | 7 | echo '<option'; |
8 | - if ($current == $k) echo ' selected'; |
|
8 | + if ($current == $k) { |
|
9 | + echo ' selected'; |
|
10 | + } |
|
9 | 11 | echo ' value="', $k, '">', $v; |
10 | 12 | } |
11 | 13 | echo "</optgroup>\n"; |
@@ -6,6 +6,6 @@ |
||
6 | 6 | 'title' => "Search Tips" |
7 | 7 | )); |
8 | 8 | |
9 | -include INCLUDESPATH . 'easyparliament/staticpages/search_help.php'; |
|
9 | +include INCLUDESPATH.'easyparliament/staticpages/search_help.php'; |
|
10 | 10 | |
11 | 11 | $this->block_end(); |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -include_once INCLUDESPATH . "easyparliament/init.php"; |
|
14 | -require_once INCLUDESPATH . "../../commonlib/phplib/random.php"; |
|
15 | -require_once INCLUDESPATH . "../../commonlib/phplib/auth.php"; |
|
13 | +include_once INCLUDESPATH."easyparliament/init.php"; |
|
14 | +require_once INCLUDESPATH."../../commonlib/phplib/random.php"; |
|
15 | +require_once INCLUDESPATH."../../commonlib/phplib/auth.php"; |
|
16 | 16 | |
17 | 17 | // increment this each time you change the question so |
18 | 18 | // the cookie magic works |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | if ($hide_question) { |
34 | 34 | $always_ask = 0; |
35 | 35 | $show_survey_qn = $current_question; |
36 | - setcookie('survey', $current_question, time()+60*60*24*365, '/'); |
|
36 | + setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/'); |
|
37 | 37 | } elseif ($has_answered_question == $current_question && !$always_ask) { |
38 | 38 | $show_survey_qn = $current_question; |
39 | - setcookie('survey', $current_question, time()+60*60*24*365, '/'); |
|
39 | + setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/'); |
|
40 | 40 | } elseif (isset($_COOKIE['survey'])) { |
41 | 41 | $show_survey_qn = $_COOKIE['survey']; |
42 | 42 | } |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | if ($show_survey_qn < $current_question && !$has_answered_question) { |
50 | 50 | $page_url = ''; |
51 | 51 | $hide_url = ''; |
52 | - if ( in_array( $this_page, array('mp', 'peer', 'msp', 'mla', 'royal') ) ) { |
|
52 | + if (in_array($this_page, array('mp', 'peer', 'msp', 'mla', 'royal'))) { |
|
53 | 53 | global $MEMBER; |
54 | - $page_url = $MEMBER->url(true) . "?answered_survey=$current_question"; |
|
55 | - $hide_url = $MEMBER->url() . "?hide_survey=$current_question"; |
|
54 | + $page_url = $MEMBER->url(true)."?answered_survey=$current_question"; |
|
55 | + $hide_url = $MEMBER->url()."?hide_survey=$current_question"; |
|
56 | 56 | } else { |
57 | 57 | $URL = new URL($this_page); |
58 | - $URL->insert(array('answered_survey' => $current_question )); |
|
59 | - $page_url = 'https://' . DOMAIN . $URL->generate(); |
|
58 | + $URL->insert(array('answered_survey' => $current_question)); |
|
59 | + $page_url = 'https://'.DOMAIN.$URL->generate(); |
|
60 | 60 | $URL = new URL($this_page); |
61 | - $URL->insert(array('hide_survey' => $current_question )); |
|
61 | + $URL->insert(array('hide_survey' => $current_question)); |
|
62 | 62 | $hide_url = $URL->generate(); |
63 | 63 | } |
64 | 64 |