@@ -512,7 +512,7 @@ |
||
512 | 512 | if ($row['totalcomments'] > 1) { |
513 | 513 | $morecount = $row['totalcomments'] - 1; |
514 | 514 | $plural = $morecount == 1 ? 'annotation' : 'annotations'; |
515 | - $linktext = "Read $morecount more $plural"; |
|
515 | + $linktext = "read $morecount more $plural"; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $data = $this->addCommonData($data); |
33 | 33 | } elseif ($date = get_http_var('d')) { |
34 | 34 | $data = $this->display_day($date); |
35 | - if ( !isset($data['template']) ) { |
|
35 | + if (!isset($data['template'])) { |
|
36 | 36 | $data['template'] = 'section/day'; |
37 | 37 | } |
38 | 38 | $data = $this->addCommonData($data); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $data = $this->display_section_or_speech(); |
41 | 41 | } else { |
42 | 42 | $data = $this->display_front(); |
43 | - if ( !isset($data['template']) ) { |
|
43 | + if (!isset($data['template'])) { |
|
44 | 44 | $data['template'] = 'section/recent'; |
45 | 45 | } |
46 | 46 | $data['search_sections'] = $this->getSearchSections(); |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | $data['recess_major'] = $this->getRecessMajor(); |
60 | 60 | |
61 | 61 | $nextprev = $DATA->page_metadata($this_page, 'nextprev'); |
62 | - if ( isset($nextprev['next']['url']) ) { |
|
62 | + if (isset($nextprev['next']['url'])) { |
|
63 | 63 | $data['next'] = $nextprev['next']; |
64 | 64 | } |
65 | - if ( isset($nextprev['prev']['url']) ) { |
|
65 | + if (isset($nextprev['prev']['url'])) { |
|
66 | 66 | $data['prev'] = $nextprev['prev']; |
67 | 67 | } |
68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (!isset($data['title']) && $parent_page != '') { |
72 | 72 | $data['title'] = $DATA->page_metadata($parent_page, 'title'); |
73 | 73 | } |
74 | - if ( $parent_page ) { |
|
74 | + if ($parent_page) { |
|
75 | 75 | $data['parent_title'] = $DATA->page_metadata($parent_page, 'title'); |
76 | 76 | } |
77 | 77 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $urls = array_merge($urls, $this->getViewUrls()); |
89 | 89 | |
90 | - if ( isset($data['info']['page']) ) { |
|
90 | + if (isset($data['info']['page'])) { |
|
91 | 91 | $day = new \MySociety\TheyWorkForYou\Url($data['info']['page']); |
92 | 92 | $urls['day'] = $day; |
93 | 93 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $DATA->set_page_metadata($this_page, 'title', $year); |
134 | 134 | } |
135 | 135 | |
136 | - $args = array ( 'year' => $year ); |
|
136 | + $args = array('year' => $year); |
|
137 | 137 | $data = $this->list->display('calendar', $args, 'none'); |
138 | 138 | return $data; |
139 | 139 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | protected function display_column($date, $column) { |
142 | 142 | global $this_page; |
143 | 143 | $this_page = $this->page_base; |
144 | - $args = array( 'date' => $date, 'column' => $column ); |
|
144 | + $args = array('date' => $date, 'column' => $column); |
|
145 | 145 | $content = $this->list->display('column', $args, 'none'); |
146 | 146 | |
147 | 147 | $data = array(); |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | protected function display_day($date) { |
167 | 167 | global $this_page; |
168 | 168 | $this_page = $this->page_base . 'day'; |
169 | - $args = array ( 'date' => get_http_var('d') ); |
|
169 | + $args = array('date' => get_http_var('d')); |
|
170 | 170 | $data = $this->list->display('date', $args, 'none'); |
171 | 171 | list($year, $month, $day) = explode('-', $date); |
172 | - $args = array( 'year' => $year, 'month' => $month, 'day' => $day); |
|
172 | + $args = array('year' => $year, 'month' => $month, 'day' => $day); |
|
173 | 173 | $calendar = $this->list->display('calendar', $args, 'none'); |
174 | - if ( isset($calendar['years']) ) { |
|
174 | + if (isset($calendar['years'])) { |
|
175 | 175 | $data['calendar'] = $calendar['years']; |
176 | 176 | } |
177 | 177 | return $data; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | global $DATA, $this_page, $THEUSER; |
182 | 182 | |
183 | 183 | # += as we *don't* want to override any already supplied argument |
184 | - $args += array ( |
|
184 | + $args += array( |
|
185 | 185 | 'gid' => get_http_var('id'), |
186 | 186 | 's' => get_http_var('s'), // Search terms to be highlighted. |
187 | 187 | 'member_id' => get_http_var('m'), // Member's speeches to be highlighted. |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | if ($this->major == 6) { |
199 | 199 | # Magically (as in I can't remember quite why), pbc_clause will |
200 | 200 | # contain the new URL without any change... |
201 | - $URL->remove( array('id') ); |
|
201 | + $URL->remove(array('id')); |
|
202 | 202 | } else { |
203 | - $URL->insert( array('id'=>$e->getMessage()) ); |
|
203 | + $URL->insert(array('id'=>$e->getMessage())); |
|
204 | 204 | } |
205 | 205 | # put the search term back in so highlighting works. |
206 | 206 | # NB: as we don't see the # part of the URL we lose this :( |
207 | - if ( $args['s'] !== '' ) { |
|
208 | - $URL->insert( array('s'=>$args['s']) ); |
|
207 | + if ($args['s'] !== '') { |
|
208 | + $URL->insert(array('s'=>$args['s'])); |
|
209 | 209 | } |
210 | 210 | redirect($URL->generate('none')); |
211 | 211 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | if (array_key_exists('text_heading', $data['info'])) { |
274 | 274 | // avoid having Clause 1 etc as the alert text search string on PBC pages as it's |
275 | 275 | // almost certainly not what the person wants |
276 | - if ( $this->major == 6 ) { |
|
276 | + if ($this->major == 6) { |
|
277 | 277 | $data['email_alert_text'] = $data['section_title']; |
278 | 278 | } else { |
279 | 279 | $data['email_alert_text'] = $data['info']['text_heading']; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $body = preg_replace('#<phrase class="honfriend" id="uk.org.publicwhip/member/(\d+)" name="([^"]*?)">(.*?\s*\((.*?)\))</phrase>#', '<a href="/mp/?m=$1" title="Our page on $2 - \'$3\'">$4</a>', $body); |
321 | 321 | $body = preg_replace('#<phrase class="honfriend" name="([^"]*?)" person_id="uk.org.publicwhip/person/(\d+)">(.*?\s*\((.*?)\))</phrase>#', '<a href="/mp/?p=$2" title="Our page on $1 - \'$3\'">$4</a>', $body); |
322 | 322 | $body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\d+)-(\d+)-(\d+)\.(.*?)">(.*?)</phrase>#', function($matches) { |
323 | - return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] .'">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>'; |
|
323 | + return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] . '">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>'; |
|
324 | 324 | }, $body); |
325 | 325 | #$body = preg_replace('#<phrase class="offrep" id="((.*?)/(\d+)-(\d+)-(\d+)\.(.*?))">(.*?)</phrase>#e', "\"<a href='/search/?pop=1&s=date:$3$4$5+column:$6+section:$2&match=$1'>\" . str_replace('Official Report', 'Hansard', '$7') . '</a>'", $body); |
326 | 326 | $bodies[] = $body; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $data['section_title'] = ''; |
354 | 354 | $subsection_title = ''; |
355 | 355 | $rows = count($data['rows']); |
356 | - for ($i=0; $i<$rows; $i++) { |
|
356 | + for ($i = 0; $i < $rows; $i++) { |
|
357 | 357 | $row = $data['rows'][$i]; |
358 | 358 | $htype = $row['htype']; |
359 | 359 | // HPOS should be defined below if it's needed; otherwise default to 0 |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | # Voting links |
377 | 377 | $data['rows'][$i]['voting_data'] = ''; |
378 | 378 | if (isset($row['votes'])) { |
379 | - $data['rows'][$i]['voting_data'] = $this->generate_votes( $row['votes'], $row['epobject_id'], $row['gid'] ); |
|
379 | + $data['rows'][$i]['voting_data'] = $this->generate_votes($row['votes'], $row['epobject_id'], $row['gid']); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | # Annotation link |
@@ -417,47 +417,47 @@ discard block |
||
417 | 417 | |
418 | 418 | private function getCountryDetails() { |
419 | 419 | $details = array( |
420 | - 1 => array ( |
|
420 | + 1 => array( |
|
421 | 421 | 'country' => 'UK', |
422 | 422 | 'assembly' => 'uk-commons', |
423 | 423 | 'location' => '– in the House of Commons' |
424 | 424 | ), |
425 | - 2 => array ( |
|
425 | + 2 => array( |
|
426 | 426 | 'country' => 'UK', |
427 | 427 | 'assembly' => 'uk-commons', |
428 | 428 | 'location' => '– in Westminster Hall' |
429 | 429 | ), |
430 | - 3 => array ( |
|
430 | + 3 => array( |
|
431 | 431 | 'country' => 'UK', |
432 | 432 | 'assembly' => 'uk-commons', |
433 | 433 | 'location' => 'written question – answered' |
434 | 434 | ), |
435 | - 4 => array ( |
|
435 | + 4 => array( |
|
436 | 436 | 'country' => 'UK', |
437 | 437 | 'assembly' => 'uk-commons', |
438 | 438 | 'location' => 'written statement – made' |
439 | 439 | ), |
440 | - 5 => array ( |
|
440 | + 5 => array( |
|
441 | 441 | 'country' => 'NORTHERN IRELAND', |
442 | 442 | 'assembly' => 'ni', |
443 | 443 | 'location' => '– in the Northern Ireland Assembly' |
444 | 444 | ), |
445 | - 6 => array ( |
|
445 | + 6 => array( |
|
446 | 446 | 'country' => 'UK', |
447 | 447 | 'assembly' => 'uk-commons', |
448 | 448 | 'location' => '– in a Public Bill Committee' |
449 | 449 | ), |
450 | - 7 => array ( |
|
450 | + 7 => array( |
|
451 | 451 | 'country' => 'SCOTLAND', |
452 | 452 | 'assembly' => 'scotland', |
453 | 453 | 'location' => '– in the Scottish Parliament' |
454 | 454 | ), |
455 | - 8 => array ( |
|
455 | + 8 => array( |
|
456 | 456 | 'country' => 'SCOTLAND', |
457 | 457 | 'assembly' => 'scotland', |
458 | 458 | 'location' => '– Scottish Parliament written question – answered' |
459 | 459 | ), |
460 | - 101 => array ( |
|
460 | + 101 => array( |
|
461 | 461 | 'country' => 'UK', |
462 | 462 | 'assembly' => 'uk-lords', |
463 | 463 | 'location' => '– in the House of Lords' |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | global $DATA, $this_page; |
473 | 473 | $this_page = $this->page_base . 'front'; |
474 | 474 | $data = array(); |
475 | - if ( $this->index_template ) { |
|
475 | + if ($this->index_template) { |
|
476 | 476 | $data['template'] = $this->index_template; |
477 | 477 | } |
478 | 478 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | $content['calendar'] = $class->display('calendar', array('months' => 1), 'none'); |
484 | 484 | |
485 | - if ( $rssurl = $DATA->page_metadata($this_page, 'rss') ) { |
|
485 | + if ($rssurl = $DATA->page_metadata($this_page, 'rss')) { |
|
486 | 486 | $content['rssurl'] = $rssurl; |
487 | 487 | } |
488 | 488 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | } |
498 | 498 | |
499 | 499 | //$totalcomments, $comment, $commenturl |
500 | - function generate_commentteaser ($row) { |
|
500 | + function generate_commentteaser($row) { |
|
501 | 501 | // Returns HTML for the one fragment of comment and link for the sidebar. |
502 | 502 | // $totalcomments is the number of comments this item has on it. |
503 | 503 | // $comment is an array like: |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : ''; |
33 | 33 | |
34 | 34 | if ( $this->isEmailSignedUpForPostCode( $data['email'], $data['postcode'] ) ) { |
35 | - $data['already_signed_up'] = True; |
|
35 | + $data['already_signed_up'] = true; |
|
36 | 36 | $mp = $this->getPersonFromPostcode($data['postcode']); |
37 | 37 | $data['mp_name'] = $mp->full_name(); |
38 | 38 | } |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | |
68 | 68 | private function createAlertForPostCode($email, $postcode) { |
69 | 69 | if ( !$this->validateDetails($email, $postcode) ) { |
70 | - return array('invalid-postcode-or-email' => True); |
|
70 | + return array('invalid-postcode-or-email' => true); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | try { |
74 | 74 | $person = $this->getPersonFromPostcode($postcode); |
75 | 75 | } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
76 | - return array('bad-constituency' => True); |
|
76 | + return array('bad-constituency' => true); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $details = array( |
@@ -93,19 +93,19 @@ discard block |
||
93 | 93 | // no logged in user so send them an email to let them |
94 | 94 | // know someone tried to create an alert |
95 | 95 | $this->alert->send_already_signedup_email($details); |
96 | - $data['confirmation_sent'] = True; |
|
96 | + $data['confirmation_sent'] = true; |
|
97 | 97 | } else { |
98 | - $data['already_signed_up'] = True; |
|
98 | + $data['already_signed_up'] = true; |
|
99 | 99 | } |
100 | 100 | break; |
101 | 101 | case self::CREATE_FAILED: |
102 | - $data['error'] = True; |
|
102 | + $data['error'] = true; |
|
103 | 103 | break; |
104 | 104 | default: // alert created |
105 | 105 | if ( $not_logged_in ) { |
106 | - $data['confirmation_sent'] = True; |
|
106 | + $data['confirmation_sent'] = true; |
|
107 | 107 | } else { |
108 | - $data['signedup_no_confirm'] = True; |
|
108 | + $data['signedup_no_confirm'] = true; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | $this->alert->delete($q->field($i, 'alert_id') . '::' . $q->field($i ,'registrationtoken')); |
149 | - $this->alert->add($details, False); |
|
149 | + $this->alert->add($details, false); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | return array( |
153 | - 'signedup_no_confirm' => True, |
|
153 | + 'signedup_no_confirm' => true, |
|
154 | 154 | 'new_mp' => $new_mp->full_name(), |
155 | 155 | ); |
156 | 156 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if ( $this->alert->fetch_by_mp( $existing['email'], $new_mp->person_id) ) { |
185 | 185 | $data = array( |
186 | - 'already_signed_up' => True, |
|
186 | + 'already_signed_up' => true, |
|
187 | 187 | 'old_mp' => $old_mp->full_name(), |
188 | 188 | 'mp_name' => $new_mp->full_name(), |
189 | 189 | ); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | ); |
195 | 195 | } |
196 | 196 | |
197 | - $data['update'] = True; |
|
197 | + $data['update'] = true; |
|
198 | 198 | $data['confirmation'] = $confirmation; |
199 | 199 | |
200 | 200 | return $data; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | public function display() { |
8 | 8 | $data = array(); |
9 | 9 | $data['recent_election'] = false; |
10 | - if ( $this->user->loggedin() ) { |
|
10 | + if ($this->user->loggedin()) { |
|
11 | 11 | $data['user_signed_in'] = true; |
12 | 12 | } |
13 | 13 | |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | $data['postcode'] = get_http_var('postcode'); |
18 | 18 | |
19 | 19 | $result = $this->createAlertForPostCode($data['email'], $data['postcode']); |
20 | - $data = array_merge( $data, $result ); |
|
20 | + $data = array_merge($data, $result); |
|
21 | 21 | } elseif (get_http_var('update')) { |
22 | 22 | $result = $this->getNewMP(get_http_var('update')); |
23 | - $data = array_merge( $data, $result ); |
|
23 | + $data = array_merge($data, $result); |
|
24 | 24 | } elseif (get_http_var('update-alert')) { |
25 | - $success = $this->replaceAlert( get_http_var('confirmation') ); |
|
25 | + $success = $this->replaceAlert(get_http_var('confirmation')); |
|
26 | 26 | $data['confirmation_received'] = $success; |
27 | 27 | } elseif (get_http_var('confirmed')) { |
28 | - $success = $this->confirmAlert( get_http_var('confirmed') ); |
|
28 | + $success = $this->confirmAlert(get_http_var('confirmed')); |
|
29 | 29 | $data['confirmation_received'] = $success; |
30 | 30 | } else { |
31 | 31 | $data['email'] = $this->user->email() ? $this->user->email() : ''; |
32 | 32 | $data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : ''; |
33 | 33 | |
34 | - if ( $this->isEmailSignedUpForPostCode( $data['email'], $data['postcode'] ) ) { |
|
34 | + if ($this->isEmailSignedUpForPostCode($data['email'], $data['postcode'])) { |
|
35 | 35 | $data['already_signed_up'] = True; |
36 | 36 | $mp = $this->getPersonFromPostcode($data['postcode']); |
37 | 37 | $data['mp_name'] = $mp->full_name(); |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | private function createAlertForPostCode($email, $postcode) { |
69 | - if ( !$this->validateDetails($email, $postcode) ) { |
|
69 | + if (!$this->validateDetails($email, $postcode)) { |
|
70 | 70 | return array('invalid-postcode-or-email' => True); |
71 | 71 | } |
72 | 72 | |
73 | 73 | try { |
74 | 74 | $person = $this->getPersonFromPostcode($postcode); |
75 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
75 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
76 | 76 | return array('bad-constituency' => True); |
77 | 77 | } |
78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | switch ($result) { |
91 | 91 | case self::ALERT_EXISTS: |
92 | - if ( $not_logged_in ) { |
|
92 | + if ($not_logged_in) { |
|
93 | 93 | // no logged in user so send them an email to let them |
94 | 94 | // know someone tried to create an alert |
95 | 95 | $this->alert->send_already_signedup_email($details); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $data['error'] = True; |
103 | 103 | break; |
104 | 104 | default: // alert created |
105 | - if ( $not_logged_in ) { |
|
105 | + if ($not_logged_in) { |
|
106 | 106 | $data['confirmation_sent'] = True; |
107 | 107 | } else { |
108 | 108 | $data['signedup_no_confirm'] = True; |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | $existing = $this->alert->fetch_by_token($confirmation); |
117 | 117 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
118 | 118 | $old_mp_id = $matches[1]; |
119 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $old_mp_id ) ); |
|
120 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
119 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $old_mp_id)); |
|
120 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
121 | 121 | |
122 | 122 | $q = $this->db->query( |
123 | 123 | "SELECT alert_id, criteria, registrationtoken FROM alerts |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ) |
132 | 132 | ); |
133 | 133 | |
134 | - for ( $i = 0; $i < $q->rows; $i++ ) { |
|
134 | + for ($i = 0; $i < $q->rows; $i++) { |
|
135 | 135 | // need to reset this otherwise delete does not work |
136 | 136 | $this->alert->token_checked = null; |
137 | 137 | $other_criteria = trim(preg_replace('/speaker:\d+/', '', $q->field($i, 'criteria'))); |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | 'pid' => $new_mp->person_id, |
142 | 142 | 'pc' => '', |
143 | 143 | ); |
144 | - if ( $other_criteria ) { |
|
144 | + if ($other_criteria) { |
|
145 | 145 | $details['keyword'] = $other_criteria; |
146 | 146 | } |
147 | 147 | |
148 | - $this->alert->delete($q->field($i, 'alert_id') . '::' . $q->field($i ,'registrationtoken')); |
|
148 | + $this->alert->delete($q->field($i, 'alert_id') . '::' . $q->field($i, 'registrationtoken')); |
|
149 | 149 | $this->alert->add($details, False); |
150 | 150 | } |
151 | 151 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | private function isEmailSignedUpForPostCode($email, $postcode) { |
159 | 159 | $is_signed_up = false; |
160 | 160 | |
161 | - if ( $email && $postcode ) { |
|
161 | + if ($email && $postcode) { |
|
162 | 162 | try { |
163 | 163 | $person = $this->getPersonFromPostcode($postcode); |
164 | 164 | $is_signed_up = $this->alert->fetch_by_mp($email, $person->person_id); |
165 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
165 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
166 | 166 | $is_signed_up = false; |
167 | 167 | } |
168 | 168 | } |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
179 | 179 | $criteria = $matches[1]; |
180 | 180 | |
181 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $criteria ) ); |
|
182 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
181 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $criteria)); |
|
182 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
183 | 183 | |
184 | - if ( $this->alert->fetch_by_mp( $existing['email'], $new_mp->person_id) ) { |
|
184 | + if ($this->alert->fetch_by_mp($existing['email'], $new_mp->person_id)) { |
|
185 | 185 | $data = array( |
186 | 186 | 'already_signed_up' => True, |
187 | 187 | 'old_mp' => $old_mp->full_name(), |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $this->summaries = isset($options['summaries']) ? $options['summaries'] : array(); |
64 | 64 | $this->divisions = new \MySociety\TheyWorkForYou\Divisions($member); |
65 | 65 | |
66 | - $limit = isset($options['limit']) ? $options['limit'] : NULL; |
|
66 | + $limit = isset($options['limit']) ? $options['limit'] : null; |
|
67 | 67 | |
68 | 68 | // Do the actual getting of positions |
69 | 69 | $this->getMemberPolicyPositions($limit); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param int $limit The number of results to limit the output to. |
78 | 78 | */ |
79 | 79 | |
80 | - private function getMemberPolicyPositions ($limit = NULL) { |
|
80 | + private function getMemberPolicyPositions ($limit = null) { |
|
81 | 81 | |
82 | 82 | // Make sure member info has actually been set. |
83 | 83 | if (count($this->member->extra_info) === 0) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $member_houses = $this->member->houses(); |
90 | 90 | |
91 | 91 | // Determine the policy limit. |
92 | - if ($limit !== NULL AND is_int($limit)) |
|
92 | + if ($limit !== null and is_int($limit)) |
|
93 | 93 | { |
94 | 94 | $policy_limit = $limit; |
95 | 95 | } else { |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | $current_member = $this->member->current_member(); |
209 | 209 | |
210 | 210 | if (count($this->policies) > 0) { |
211 | - if (in_array(HOUSE_TYPE_COMMONS, $member_houses) AND |
|
211 | + if (in_array(HOUSE_TYPE_COMMONS, $member_houses) and |
|
212 | 212 | $entered_house[HOUSE_TYPE_COMMONS]['date'] > '2001-06-07' |
213 | 213 | ) { |
214 | 214 | $since = ''; |
215 | - } elseif (!in_array(HOUSE_TYPE_COMMONS, $member_houses) AND |
|
216 | - in_array(HOUSE_TYPE_LORDS, $member_houses) AND |
|
215 | + } elseif (!in_array(HOUSE_TYPE_COMMONS, $member_houses) and |
|
216 | + in_array(HOUSE_TYPE_LORDS, $member_houses) and |
|
217 | 217 | $entered_house[HOUSE_TYPE_LORDS]['date'] > '2001-06-07' |
218 | 218 | ) { |
219 | 219 | $since = ''; |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | $since = ' since 2001'; |
224 | 224 | } |
225 | 225 | # If not current MP/Lord, but current MLA/MSP, need to say voting record is when MP |
226 | - if (!$current_member[HOUSE_TYPE_COMMONS] AND |
|
227 | - !$current_member[HOUSE_TYPE_LORDS] AND |
|
228 | - ( $current_member[HOUSE_TYPE_SCOTLAND] OR $current_member[HOUSE_TYPE_NI] ) |
|
226 | + if (!$current_member[HOUSE_TYPE_COMMONS] and |
|
227 | + !$current_member[HOUSE_TYPE_LORDS] and |
|
228 | + ( $current_member[HOUSE_TYPE_SCOTLAND] or $current_member[HOUSE_TYPE_NI] ) |
|
229 | 229 | ) { |
230 | 230 | $since .= ' whilst an MP'; |
231 | 231 | } |
@@ -246,10 +246,10 @@ discard block |
||
246 | 246 | '" title="At The Guardian">well-known issues</a> <small>(from the Guardian)</small>'; |
247 | 247 | } |
248 | 248 | if ( |
249 | - ( isset($extra_info['public_whip_division_attendance']) AND |
|
249 | + ( isset($extra_info['public_whip_division_attendance']) and |
|
250 | 250 | $extra_info['public_whip_division_attendance'] != 'n/a' ) |
251 | - OR |
|
252 | - ( isset($extra_info['Lpublic_whip_division_attendance']) AND |
|
251 | + or |
|
252 | + ( isset($extra_info['Lpublic_whip_division_attendance']) and |
|
253 | 253 | $extra_info['Lpublic_whip_division_attendance'] != 'n/a' ) |
254 | 254 | ) { |
255 | 255 | $record[] = '<a href="http://www.publicwhip.org.uk/mp.php?id=uk.org.publicwhip/member/' . |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param int $limit The number of results to limit the output to. |
78 | 78 | */ |
79 | 79 | |
80 | - private function getMemberPolicyPositions ($limit = NULL) { |
|
80 | + private function getMemberPolicyPositions($limit = NULL) { |
|
81 | 81 | |
82 | 82 | // Make sure member info has actually been set. |
83 | 83 | if (count($this->member->extra_info) === 0) { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | // don't return votes where they haven't voted on a strong division |
115 | 115 | // if we're limiting the number of votes |
116 | - if ( $limit && !empty($dream_info) && !$dream_info['has_strong'] ) { |
|
116 | + if ($limit && !empty($dream_info) && !$dream_info['has_strong']) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | } else { |
144 | 144 | // We're over the policy limit, no sense still going, break out of the foreach. |
145 | - break ; |
|
145 | + break; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $has_strong = 1; |
198 | 198 | } |
199 | 199 | $full_sentence = $consistency . ' ' . $policy_description; |
200 | - $out = array( 'full_sentence' => $full_sentence, 'score' => $dmpscore, 'position' => $consistency, 'has_strong' => $has_strong ); |
|
200 | + $out = array('full_sentence' => $full_sentence, 'score' => $dmpscore, 'position' => $consistency, 'has_strong' => $has_strong); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return $out; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | # If not current MP/Lord, but current MLA/MSP, need to say voting record is when MP |
229 | 229 | if (!$current_member[HOUSE_TYPE_COMMONS] AND |
230 | 230 | !$current_member[HOUSE_TYPE_LORDS] AND |
231 | - ( $current_member[HOUSE_TYPE_SCOTLAND] OR $current_member[HOUSE_TYPE_NI] ) |
|
231 | + ($current_member[HOUSE_TYPE_SCOTLAND] OR $current_member[HOUSE_TYPE_NI]) |
|
232 | 232 | ) { |
233 | 233 | $since .= ' whilst an MP'; |
234 | 234 | } |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | '" title="At The Guardian">well-known issues</a> <small>(from the Guardian)</small>'; |
250 | 250 | } |
251 | 251 | if ( |
252 | - ( isset($extra_info['public_whip_division_attendance']) AND |
|
253 | - $extra_info['public_whip_division_attendance'] != 'n/a' ) |
|
252 | + (isset($extra_info['public_whip_division_attendance']) AND |
|
253 | + $extra_info['public_whip_division_attendance'] != 'n/a') |
|
254 | 254 | OR |
255 | - ( isset($extra_info['Lpublic_whip_division_attendance']) AND |
|
256 | - $extra_info['Lpublic_whip_division_attendance'] != 'n/a' ) |
|
255 | + (isset($extra_info['Lpublic_whip_division_attendance']) AND |
|
256 | + $extra_info['Lpublic_whip_division_attendance'] != 'n/a') |
|
257 | 257 | ) { |
258 | 258 | $record[] = '<a href="http://www.publicwhip.org.uk/mp.php?id=uk.org.publicwhip/member/' . |
259 | 259 | $this->member->member_id() . |
@@ -89,8 +89,7 @@ discard block |
||
89 | 89 | $member_houses = $this->member->houses(); |
90 | 90 | |
91 | 91 | // Determine the policy limit. |
92 | - if ($limit !== NULL AND is_int($limit)) |
|
93 | - { |
|
92 | + if ($limit !== NULL AND is_int($limit)) { |
|
94 | 93 | $policy_limit = $limit; |
95 | 94 | } else { |
96 | 95 | $policy_limit = count($policies); |
@@ -105,8 +104,9 @@ discard block |
||
105 | 104 | foreach ($policies as $policy) { |
106 | 105 | // Are we still within the policy limit? |
107 | 106 | if ($i < $policy_limit) { |
108 | - if (isset($policy[2]) && $policy[2] && !in_array(HOUSE_TYPE_COMMONS, $member_houses)) |
|
109 | - continue; |
|
107 | + if (isset($policy[2]) && $policy[2] && !in_array(HOUSE_TYPE_COMMONS, $member_houses)) { |
|
108 | + continue; |
|
109 | + } |
|
110 | 110 | |
111 | 111 | $votes_summary = array_key_exists($policy[0], $this->summaries) ? $this->summaries[$policy[0]] : array(); |
112 | 112 | $dream_info = $this->displayDreamComparison($policy[0], $policy[1], $votes_summary); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | </div> |
34 | 34 | <?php endif; ?> |
35 | 35 | |
36 | - <?php $displayed_votes = FALSE; ?> |
|
36 | + <?php $displayed_votes = false; ?> |
|
37 | 37 | <?php if ( isset($policydivisions) && $policydivisions ) { ?> |
38 | 38 | |
39 | 39 | <?php if ($has_voting_record) { ?> |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | |
87 | 87 | <ul class="vote-descriptions policy-votes"> |
88 | 88 | <?php |
89 | - $show_all = FALSE; |
|
89 | + $show_all = false; |
|
90 | 90 | if ( $policy['weak_count'] == 0 || $policy['weak_count'] == count($policy['divisions']) ) { |
91 | - $show_all = TRUE; |
|
91 | + $show_all = true; |
|
92 | 92 | } |
93 | 93 | ?> |
94 | 94 | <?php foreach ($policy['divisions'] as $division) { |
95 | 95 | include('_division_description.php'); |
96 | - $displayed_votes = TRUE; |
|
96 | + $displayed_votes = true; |
|
97 | 97 | } ?> |
98 | 98 | </ul> |
99 | 99 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | </div> |
16 | 16 | <div class="person-panels"> |
17 | 17 | <div class="sidebar__unit in-page-nav"> |
18 | - <?php if ( isset($policydivisions) && $policydivisions && count($policydivisions) == 1 ) { ?> |
|
18 | + <?php if (isset($policydivisions) && $policydivisions && count($policydivisions) == 1) { ?> |
|
19 | 19 | <p class="policy-votes-intro"> |
20 | 20 | How <?= $full_name ?> voted on <?= $policydivisions[array_keys($policydivisions)[0]]['desc'] ?>. |
21 | 21 | </p> |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | <?php endif; ?> |
35 | 35 | |
36 | 36 | <?php $displayed_votes = FALSE; ?> |
37 | - <?php if ( isset($policydivisions) && $policydivisions ) { ?> |
|
37 | + <?php if (isset($policydivisions) && $policydivisions) { ?> |
|
38 | 38 | |
39 | 39 | <?php if ($has_voting_record) { ?> |
40 | 40 | |
41 | 41 | <?php foreach ($policydivisions as $policy) { ?> |
42 | 42 | |
43 | - <?php if ( isset($policy['header']) ) { ?> |
|
43 | + <?php if (isset($policy['header'])) { ?> |
|
44 | 44 | <div class="panel policy-votes-hero" style="background-image: url('<?php echo $policy['header']['image']; ?>');"> |
45 | 45 | <h2><?php echo $policy['header']['title']; ?></h2> |
46 | 46 | <p><?php echo $policy['header']['description']; ?>.</p> |
47 | - <?php if ( $policy['header']['image_source'] ) { ?> |
|
47 | + <?php if ($policy['header']['image_source']) { ?> |
|
48 | 48 | <span class="policy-votes-hero__image-attribution"> |
49 | 49 | Photo: |
50 | 50 | <a href="<?php echo $policy['header']['image_source']; ?>"> |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | <?php } ?> |
60 | 60 | |
61 | 61 | |
62 | - <?php if ( isset($policy['position']) ) { ?> |
|
62 | + <?php if (isset($policy['position'])) { ?> |
|
63 | 63 | <div class="panel"> |
64 | - <?php if ( $policy['position']['has_strong'] ) { ?> |
|
64 | + <?php if ($policy['position']['has_strong']) { ?> |
|
65 | 65 | <h3 class="policy-vote-overall-stance"> |
66 | 66 | <?= $full_name . ' ' . $policy['position']['desc'] ?> |
67 | 67 | </h3> |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <ul class="vote-descriptions policy-votes"> |
88 | 88 | <?php |
89 | 89 | $show_all = FALSE; |
90 | - if ( $policy['weak_count'] == 0 || $policy['weak_count'] == count($policy['divisions']) ) { |
|
90 | + if ($policy['weak_count'] == 0 || $policy['weak_count'] == count($policy['divisions'])) { |
|
91 | 91 | $show_all = TRUE; |
92 | 92 | } |
93 | 93 | ?> |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | |
100 | 100 | <div class="policy-votes-list-footer"> |
101 | 101 | <p class="policy-votes__byline">Vote information from <a href="http://www.publicwhip.org.uk/mp.php?mpid=<?= $member_id ?>&dmp=<?= $policy['policy_id'] ?>">PublicWhip</a>. Last updated: <?= $policy_last_update[$policy['policy_id']] ?></p> |
102 | - <?php if ( !$show_all && $policy['weak_count'] > 0 ) { ?> |
|
102 | + <?php if (!$show_all && $policy['weak_count'] > 0) { ?> |
|
103 | 103 | <p><button class="button secondary-button small js-show-all-votes">Show all votes, including <?= $policy['weak_count'] ?> less important <?= $policy['weak_count'] == 1 ? 'vote' : 'votes' ?></button></p> |
104 | 104 | <?php } ?> |
105 | 105 | </div> |
106 | 106 | |
107 | 107 | <script type="text/javascript"> |
108 | 108 | $(function(){ |
109 | - <?php if ( !$show_all ) { ?> |
|
109 | + <?php if (!$show_all) { ?> |
|
110 | 110 | $('#policy-votes-type').text('Key'); |
111 | 111 | <?php } ?> |
112 | 112 | $('.js-show-all-votes').on('click', function(){ |
@@ -24,7 +24,7 @@ |
||
24 | 24 | </form> |
25 | 25 | </div> |
26 | 26 | <!-- TheyWorkForYou box, end --> |
27 | -END; |
|
27 | +end; |
|
28 | 28 | print $link_to_us_form; |
29 | 29 | ?> |
30 | 30 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | <div class="row nested-row"> |
42 | 42 | <div class="homepage-in-the-news homepage-content-section"> |
43 | 43 | <?php if ( $featured ) { |
44 | - include dirname(__FILE__) . "/../homepage/featured.php"; |
|
44 | + include dirname(__FILE__) . "/../homepage/featured.php"; |
|
45 | 45 | } ?> |
46 | 46 | </div> |
47 | 47 | <div class="homepage-create-alert homepage-content-section"> |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | </div> |
12 | 12 | <div class="row"> |
13 | 13 | <div class="medium-9 columns"> |
14 | - <?php if ( count($data['regional']) > 0 ) { ?> |
|
14 | + <?php if (count($data['regional']) > 0) { ?> |
|
15 | 15 | <ul class="homepage-rep-list"> |
16 | 16 | <li>Your Regional MSPs:</li> |
17 | - <?php foreach ( $data['regional'] as $msp ) { ?> |
|
17 | + <?php foreach ($data['regional'] as $msp) { ?> |
|
18 | 18 | <li class="homepage-rep-list__rep"><a href="/msp/?p=<?= $msp['person_id'] ?>"><?= $msp['name'] ?></a></li> |
19 | 19 | <?php } ?> |
20 | 20 | </ul> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | <div class="panel panel--flushtop clearfix"> |
58 | 58 | <div class="row nested-row"> |
59 | 59 | <div class="homepage-in-the-news homepage-content-section"> |
60 | - <?php if ( $featured ) { |
|
60 | + <?php if ($featured) { |
|
61 | 61 | include dirname(__FILE__) . "/../homepage/featured.php"; |
62 | 62 | } ?> |
63 | 63 | </div> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | <div class="homepage-recently homepage-content-section"> |
103 | 103 | <h2>Recently in Parliament</h2> |
104 | 104 | <ul class="recently__list"><?php |
105 | - foreach ( $debates['recent'] as $recent ) { |
|
105 | + foreach ($debates['recent'] as $recent) { |
|
106 | 106 | include dirname(__FILE__) . '/../homepage/recent-debates.php'; |
107 | 107 | } |
108 | 108 | ?></ul> |
@@ -157,7 +157,7 @@ |
||
157 | 157 | <?php # XXX |
158 | 158 | if ($data['info']['major'] == 8 && preg_match('#\d{4}-\d\d-\d\d\.(.*?)\.q#', $speech['gid'], $m)) { |
159 | 159 | ?><p class="debate-speech__question_id"><small> |
160 | - <?= "Question $m[1]" ?> |
|
160 | + <?= "question $m[1]" ?> |
|
161 | 161 | </small></p> |
162 | 162 | <?php } ?> |
163 | 163 | </h2> |
@@ -186,7 +186,8 @@ |
||
186 | 186 | } # End of voting HTML |
187 | 187 | |
188 | 188 | // Video |
189 | - if ($data['info']['major'] == 1 && !$individual_item) { # Commons debates only |
|
189 | + if ($data['info']['major'] == 1 && !$individual_item) { |
|
190 | +# Commons debates only |
|
190 | 191 | if ($speech['video_status']&4) { ?> |
191 | 192 | <a href="<?= $speech['commentsurl'] ?>" class="watch debate-speech__meta__link" onclick="return moveVideo(\'debate/'<?= $speech['gid'] ?>\');">Watch this</a> |
192 | 193 | <?php |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | if ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { |
13 | 13 | $body = preg_replace('# (S\d[O0WF]-\d+)[, ]#', ' <a href="/spwrans/?spid=$1">$1</a> ', $body); |
14 | 14 | $body = preg_replace_callback('#<citation id="uk\.org\.publicwhip/(.*?)/(.*?)">\[(.*?)\]</citation>#', function($matches) { |
15 | - if ($matches[1] == 'spor') { |
|
16 | - $href_segment = 'sp/?g'; |
|
17 | - } elseif ($matches[1] == 'spwa') { |
|
15 | + if ($matches[1] == 'spor') { |
|
16 | + $href_segment = 'sp/?g'; |
|
17 | + } elseif ($matches[1] == 'spwa') { |
|
18 | 18 | $href_segment = 'spwrans/?'; |
19 | 19 | } else { |
20 | 20 | $href_segment = 'debates/?'; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $before_mp = isset($speech['before_mp']); |
188 | 188 | $after_mp = isset($speech['after_mp']); |
189 | 189 | include dirname(__FILE__) . '/../divisions/_your_mp.php'; |
190 | - } ?> |
|
190 | + } ?> |
|
191 | 191 | <div class="debate-speech__division__details"> |
192 | 192 | <?php include dirname(__FILE__) . '/../divisions/_votes.php'; ?> |
193 | 193 | </div> |
@@ -1,4 +1,4 @@ discard block |
||
1 | - <?php foreach($data['rows'] as $speech) { ?> |
|
1 | + <?php foreach ($data['rows'] as $speech) { ?> |
|
2 | 2 | |
3 | 3 | <?php |
4 | 4 | |
@@ -61,27 +61,27 @@ discard block |
||
61 | 61 | $source = array(); |
62 | 62 | |
63 | 63 | $major = $data['info']['major']; |
64 | - if ($major==1 || $major==2 || (($major==3 || $major==4) && isset($speech['speaker']['house'])) || $major==101 || $major==6) { |
|
64 | + if ($major == 1 || $major == 2 || (($major == 3 || $major == 4) && isset($speech['speaker']['house'])) || $major == 101 || $major == 6) { |
|
65 | 65 | $source['title'] = 'Citation: '; |
66 | - if ($major==1 || $major==2) { |
|
66 | + if ($major == 1 || $major == 2) { |
|
67 | 67 | $source['title'] .= 'HC'; |
68 | - } elseif ($major==3 || $major==4) { |
|
69 | - if ($speech['speaker']['house']==1) { |
|
68 | + } elseif ($major == 3 || $major == 4) { |
|
69 | + if ($speech['speaker']['house'] == 1) { |
|
70 | 70 | $source['title'] .= 'HC'; |
71 | 71 | } else { |
72 | 72 | $source['title'] .= 'HL'; |
73 | 73 | } |
74 | - } elseif ($major==6) { |
|
74 | + } elseif ($major == 6) { |
|
75 | 75 | $source['title'] .= $data['section_title']; |
76 | 76 | } else { |
77 | 77 | $source['title'] .= 'HL'; |
78 | 78 | } |
79 | 79 | $source['title'] .= ' Deb, ' . format_date($data['info']['date'], LONGDATEFORMAT) . ', c' . $speech['colnum']; |
80 | - if ($major==2) { |
|
80 | + if ($major == 2) { |
|
81 | 81 | $source['title'] .= 'WH'; |
82 | - } elseif ($major==3) { |
|
82 | + } elseif ($major == 3) { |
|
83 | 83 | $source['title'] .= 'W'; |
84 | - } elseif ($major==4) { |
|
84 | + } elseif ($major == 4) { |
|
85 | 85 | $source['title'] .= 'WS'; |
86 | 86 | } |
87 | 87 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | <div class="debate-speech__speaker-and-content"> |
111 | 111 | <?php } ?> |
112 | 112 | |
113 | - <?php if(isset($speech['speaker']) && count($speech['speaker']) > 0) { ?> |
|
113 | + <?php if (isset($speech['speaker']) && count($speech['speaker']) > 0) { ?> |
|
114 | 114 | <h2 class="debate-speech__speaker"> |
115 | 115 | <?php |
116 | 116 | |
@@ -177,13 +177,13 @@ discard block |
||
177 | 177 | <?php if ($division['has_description']) { ?> |
178 | 178 | <div class="debate-speech__division__details"> |
179 | 179 | <span class="policy-vote__text"> |
180 | - <?php include( dirname(__FILE__) . '/../divisions/_vote_description.php'); ?> |
|
180 | + <?php include(dirname(__FILE__) . '/../divisions/_vote_description.php'); ?> |
|
181 | 181 | </span><br> |
182 | 182 | </div> |
183 | 183 | <?php } ?> |
184 | 184 | |
185 | 185 | <?php if (isset($speech['mp_vote'])) { |
186 | - $mp_vote = array( 'vote' => $speech['mp_vote']['vote'] ); |
|
186 | + $mp_vote = array('vote' => $speech['mp_vote']['vote']); |
|
187 | 187 | $before_mp = isset($speech['before_mp']); |
188 | 188 | $after_mp = isset($speech['after_mp']); |
189 | 189 | include dirname(__FILE__) . '/../divisions/_your_mp.php'; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | <div class="debate-speech__content"><?=$body ?></div> |
196 | 196 | <?php } ?> |
197 | 197 | |
198 | - <?php if ( $section ) { |
|
198 | + <?php if ($section) { |
|
199 | 199 | if ($speech['voting_data']) { ?> |
200 | 200 | |
201 | 201 | <div class="debate-speech__question-answered"> |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | |
221 | 221 | // Video |
222 | 222 | if ($data['info']['major'] == 1 && !$individual_item) { # Commons debates only |
223 | - if ($speech['video_status']&4) { ?> |
|
223 | + if ($speech['video_status'] & 4) { ?> |
|
224 | 224 | <a href="<?= $speech['commentsurl'] ?>" class="watch debate-speech__meta__link" onclick="return moveVideo(\'debate/'<?= $speech['gid'] ?>\');">Watch this</a> |
225 | 225 | <?php |
226 | - } elseif (!$speech['video'] && $speech['video_status']&1 && !($speech['video_status']&8)) { |
|
226 | + } elseif (!$speech['video'] && $speech['video_status'] & 1 && !($speech['video_status'] & 8)) { |
|
227 | 227 | $gid_type = $data['info']['major'] == 1 ? 'debate' : 'lords'; ?> |
228 | 228 | <a href="/video/?from=debate&gid=<?= $gid_type ?>/<?= $speech['gid'] ?>" class="timestamp debate-speech__meta__link">Video match this</a> |
229 | 229 | <?php |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $moreinfo[] = $row['totalcomments'] . " $plural"; |
351 | 351 | } |
352 | 352 | if (count($moreinfo) > 0) { |
353 | - print "<small>(" . implode (', ', $moreinfo) . ") </small>"; |
|
353 | + print "<small>(" . implode(', ', $moreinfo) . ") </small>"; |
|
354 | 354 | } |
355 | 355 | } else { |
356 | 356 | // Nothing in this item, so no link. |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <div class="full-page__row"> |
2 | 2 | <?php include '_business_section.php'; ?> |
3 | - <?php $search_title = "Search $title"; include '_search.php'; ?> |
|
3 | + <?php $search_title = "search $title"; include '_search.php'; ?> |
|
4 | 4 | </div> |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $row = $data['rows'][$i]; |
26 | 26 | |
27 | 27 | $hdate = format_date($row['hdate'], 'D, d M Y'); |
28 | - if (isset($row['htime']) && $row['htime'] != NULL) { |
|
28 | + if (isset($row['htime']) && $row['htime'] != null) { |
|
29 | 29 | $htime = format_time($row['htime'], 'H:i:s'); |
30 | 30 | } else { |
31 | 31 | $htime = '00:00:00'; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | twfy_debug("TEMPLATE", "rss/hansard_search.php"); |
22 | 22 | |
23 | 23 | if (isset ($data['rows']) && count($data['rows']) > 0) { |
24 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
24 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
25 | 25 | $row = $data['rows'][$i]; |
26 | 26 | |
27 | 27 | $hdate = format_date($row['hdate'], 'D, d M Y'); |