@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | $q = $db->query($sql, $params); |
9 | 9 | $output = array(); |
10 | 10 | $last_mod = 0; |
11 | - for ($i=0; $i<$q->rows(); $i++) { |
|
11 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
12 | 12 | $pid = $q->field($i, 'person_id'); |
13 | 13 | $row = array( |
14 | 14 | 'member_id' => $q->field($i, 'member_id'), |
15 | 15 | 'person_id' => $pid, |
16 | 16 | 'name' => html_entity_decode(member_full_name($q->field($i, 'house'), $q->field($i, 'title'), |
17 | 17 | $q->field($i, 'given_name'), $q->field($i, 'family_name'), |
18 | - $q->field($i, 'lordofname') )), |
|
18 | + $q->field($i, 'lordofname'))), |
|
19 | 19 | 'party' => isset($parties[$q->field($i, 'party')]) ? $parties[$q->field($i, 'party')] : $q->field($i, 'party'), |
20 | 20 | ); |
21 | 21 | if ($q->field($i, 'house') != 2) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | if (count($pids)) { |
33 | 33 | $q = $db->query('SELECT person, dept, position, from_date, to_date FROM moffice |
34 | 34 | WHERE to_date="9999-12-31" AND person IN (' . join(',', $pids) . ')'); |
35 | - for ($i=0; $i<$q->rows(); $i++) { |
|
35 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
36 | 36 | $row = $q->row($i); |
37 | 37 | $pid = $row['person']; |
38 | 38 | unset($row['person']); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $q = $db->query("select constituency, data_key, data_value from consinfo |
61 | 61 | where constituency = :constituency", array(':constituency' => $constituency)); |
62 | 62 | if ($q->rows()) { |
63 | - for ($i=0; $i<$q->rows(); $i++) { |
|
63 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
64 | 64 | $data_key = $q->field($i, 'data_key'); |
65 | 65 | $output[$data_key] = $q->field($i, 'data_value'); |
66 | 66 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once INCLUDESPATH."easyparliament/people.php"; |
|
4 | +include_once INCLUDESPATH . "easyparliament/people.php"; |
|
5 | 5 | |
6 | 6 | if (get_http_var('msp')) { |
7 | 7 | $type = 'MSPs'; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $args = $people->getArgs(); |
19 | 19 | $people->setMetaData($args); |
20 | 20 | $data = $people->getData($args); |
21 | -if ( isset($args['f']) && $args['f'] == 'csv' ) { |
|
21 | +if (isset($args['f']) && $args['f'] == 'csv') { |
|
22 | 22 | $people->sendAsCSV($data); |
23 | 23 | } else { |
24 | 24 | MySociety\TheyWorkForYou\Renderer::output("people/index", $data); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | WHERE house=1 AND left_house = (SELECT MAX(left_house) FROM member) '; |
12 | 12 | $q = $db->query($query . "ORDER BY person_id"); |
13 | 13 | $out = array('both'=>'', 'small'=>'', 'none'=>array()); |
14 | -for ($i=0; $i<$q->rows(); $i++) { |
|
14 | +for ($i = 0; $i < $q->rows(); $i++) { |
|
15 | 15 | $p_id = $q->field($i, 'person_id'); |
16 | 16 | list($dummy, $sz) = MySociety\TheyWorkForYou\Utility\Member::findMemberImage($p_id); |
17 | 17 | if ($sz == 'L') { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | array_push($out['none'], '<li>' . $q->field($i, 'person_id') . ' (' . $q->field($i, 'party') . ')' . ', ' . $q->field($i, 'constituency')); |
23 | 23 | } |
24 | 24 | } |
25 | -print '<h3>Missing completely ('.count($out['none']).')</h3> <ul>'; |
|
25 | +print '<h3>Missing completely (' . count($out['none']) . ')</h3> <ul>'; |
|
26 | 26 | print join($out['none'], "\n"); |
27 | 27 | print '</ul>'; |
28 | 28 | print '<h3>Large and small</h3> <p>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function moderate_trackbacks() { return $this->moderate_trackbacks; } |
52 | 52 | |
53 | 53 | |
54 | - public function display ($view, $args=array(), $format='html') { |
|
54 | + public function display($view, $args = array(), $format = 'html') { |
|
55 | 55 | // $view is one of: |
56 | 56 | // 'epobject_id' - display the pings for one epobject. |
57 | 57 | // 'recent' - to get the most recent pings to anywhere. |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | if ($view == 'epobject_id' || $view == 'recent') { |
65 | 65 | |
66 | 66 | // What function do we call for this view? |
67 | - $function = '_get_trackbacks_by_'.$view; |
|
67 | + $function = '_get_trackbacks_by_' . $view; |
|
68 | 68 | // Get all the data that's to be rendered. |
69 | 69 | $trackbackdata = $this->$function($args); |
70 | 70 | |
71 | 71 | } else { |
72 | - $PAGE->error_message ("You haven't specified a valid view type."); |
|
72 | + $PAGE->error_message("You haven't specified a valid view type."); |
|
73 | 73 | return false; |
74 | 74 | } |
75 | 75 | |
76 | - $data = array ( |
|
76 | + $data = array( |
|
77 | 77 | 'data' => $trackbackdata, |
78 | - 'info' => array ( |
|
78 | + 'info' => array( |
|
79 | 79 | 'view' => $view |
80 | 80 | ) |
81 | 81 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->render($view, $data, $format); |
87 | 87 | } |
88 | 88 | |
89 | - public function render($view, $data, $format='html') { |
|
89 | + public function render($view, $data, $format = 'html') { |
|
90 | 90 | |
91 | 91 | if ($format != 'html') { |
92 | 92 | $format = 'html'; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // We currently only have one kind of trackback template, so |
96 | 96 | // we're ignoring $view here I'm afraid... |
97 | 97 | |
98 | - include (INCLUDESPATH."easyparliament/templates/$format/trackbacks" . ".php"); |
|
98 | + include (INCLUDESPATH . "easyparliament/templates/$format/trackbacks" . ".php"); |
|
99 | 99 | |
100 | 100 | } |
101 | 101 | |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | |
132 | 132 | |
133 | 133 | // Still here? Then we're trackbacking to a valid hansard item. |
134 | - $url = $trackbackdata['url']; |
|
135 | - $source_ip = $trackbackdata['source_ip']; |
|
134 | + $url = $trackbackdata['url']; |
|
135 | + $source_ip = $trackbackdata['source_ip']; |
|
136 | 136 | // These all strip_tags too. |
137 | - $title = trim_characters(html_entity_decode($trackbackdata['title']), 0, 255); |
|
138 | - $excerpt = trim_characters(html_entity_decode($trackbackdata['excerpt']), 0, 255); |
|
139 | - $blog_name = trim_characters(html_entity_decode($trackbackdata['blog_name']), 0, 255); |
|
137 | + $title = trim_characters(html_entity_decode($trackbackdata['title']), 0, 255); |
|
138 | + $excerpt = trim_characters(html_entity_decode($trackbackdata['excerpt']), 0, 255); |
|
139 | + $blog_name = trim_characters(html_entity_decode($trackbackdata['blog_name']), 0, 255); |
|
140 | 140 | |
141 | - $visible = $this->moderate_trackbacks ? 0 : 1; |
|
141 | + $visible = $this->moderate_trackbacks ? 0 : 1; |
|
142 | 142 | |
143 | 143 | $q = $this->db->query("INSERT INTO trackbacks |
144 | 144 | (epobject_id, blog_name, title, excerpt, url, source_ip, posted, visible) |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | "); |
199 | 199 | |
200 | 200 | if ($q->rows() > 0) { |
201 | - for ($row=0; $row<$q->rows(); $row++) { |
|
202 | - $trackbackdata[] = array ( |
|
201 | + for ($row = 0; $row < $q->rows(); $row++) { |
|
202 | + $trackbackdata[] = array( |
|
203 | 203 | 'trackback_id' => $q->field($row, 'trackback_id'), |
204 | 204 | 'epobject_id' => $q->field($row, 'epobject_id'), |
205 | 205 | 'blog_name' => $q->field($row, 'blog_name'), |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | "); |
248 | 248 | |
249 | 249 | if ($q->rows() > 0) { |
250 | - for ($row=0; $row<$q->rows(); $row++) { |
|
251 | - $trackbackdata[] = array ( |
|
250 | + for ($row = 0; $row < $q->rows(); $row++) { |
|
251 | + $trackbackdata[] = array( |
|
252 | 252 | 'trackback_id' => $q->field($row, 'trackback_id'), |
253 | 253 | 'epobject_id' => $q->field($row, 'epobject_id'), |
254 | 254 | 'blog_name' => $q->field($row, 'blog_name'), |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | // This page just does XML. |
278 | 278 | |
279 | 279 | if ($error) { |
280 | - echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; |
|
280 | + echo '<?xml version="1.0" encoding="utf-8"?' . ">\n"; |
|
281 | 281 | echo "<response>\n"; |
282 | 282 | echo "<error>1</error>\n"; |
283 | 283 | echo "<message>$error_message</message>\n"; |
284 | 284 | echo "</response>"; |
285 | 285 | } else { |
286 | - echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; |
|
286 | + echo '<?xml version="1.0" encoding="utf-8"?' . ">\n"; |
|
287 | 287 | echo "<response>\n"; |
288 | 288 | echo "<error>0</error>\n"; |
289 | 289 | echo "</response>"; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | class GLOSSARYLIST { |
4 | 4 | |
5 | - public function render($data, $format='html', $template='glossary') { |
|
5 | + public function render($data, $format = 'html', $template = 'glossary') { |
|
6 | 6 | // Once we have the data that's to be rendered, |
7 | 7 | // include the template. |
8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $format = 'html'; |
11 | 11 | } |
12 | 12 | |
13 | - include (INCLUDESPATH."easyparliament/templates/$format/$template.php"); |
|
13 | + include (INCLUDESPATH . "easyparliament/templates/$format/$template.php"); |
|
14 | 14 | |
15 | 15 | } |
16 | 16 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <input type="text" name="q" value="<?= _htmlentities($search_keyword) ?>" class="form-control"> |
5 | 5 | <input type="submit" class="button" value="Search"> |
6 | 6 | </p> |
7 | - <?php if (isset($warnings) ) { ?> |
|
7 | + <?php if (isset($warnings)) { ?> |
|
8 | 8 | <p class="error"> |
9 | 9 | <?= $warnings ?> |
10 | 10 | </p> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <p> |
19 | 19 | <ul class="search-result-display-options"> |
20 | 20 | <li><a href="#options" class="search-options-toggle js-toggle-search-options">Advanced search</a></li> |
21 | - <?php if ( $is_adv ) { ?> |
|
21 | + <?php if ($is_adv) { ?> |
|
22 | 22 | <?= $search_phrase ? '<li>Exactly: ' . _htmlentities($search_phrase) . '</li>' : '' ?> |
23 | 23 | <?= $search_exclude ? '<li>Excluding: ' . _htmlentities($search_exclude) . '</li>' : '' ?> |
24 | 24 | <?= $search_from ? '<li>From: ' . _htmlentities($search_from) . '</li>' : '' ?> |
@@ -4,7 +4,7 @@ |
||
4 | 4 | <p class="search-result__description"> |
5 | 5 | <?php $details = $member->getMostRecentMembership(); ?> |
6 | 6 | <?= $details['left_house'] != '9999-12-31' ? 'Former ' : '' ?><?= $details['party'] ? $details['party'] . ' ' : '' ?><?= $details['rep_name'] ?><?= $details['cons'] ? ', ' . $details['cons'] : ''?> |
7 | - <?php if ( $details['entered_house'] || ( $details['left_house'] && $details['left_house'] != '9999-12-31' ) ) { ?> |
|
7 | + <?php if ($details['entered_house'] || ($details['left_house'] && $details['left_house'] != '9999-12-31')) { ?> |
|
8 | 8 | , <?= format_date($details['entered_house'], SHORTDATEFORMAT) ?> – <?= $details['left_house'] != '9999-12-31' ? format_date($details['left_house'], SHORTDATEFORMAT) : '' ?> |
9 | 9 | <?php } ?> |
10 | 10 | </p> |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | <div class="search-page__section__primary"> |
10 | 10 | <h2>Who says <em class="current-search-term"><?= _htmlentities($searchstring) ?></em> the most?</h2> |
11 | 11 | |
12 | - <?php if ( isset($error) ) { ?> |
|
13 | - <?php if ( $error == 'No results' && isset( $house ) && $house != 0 ) { ?> |
|
12 | + <?php if (isset($error)) { ?> |
|
13 | + <?php if ($error == 'No results' && isset($house) && $house != 0) { ?> |
|
14 | 14 | <ul class="search-result-display-options"> |
15 | 15 | <li> |
16 | - <?php if ( $house == 1 ) { ?> |
|
16 | + <?php if ($house == 1) { ?> |
|
17 | 17 | No results for MPs only |
18 | - <?php } else if ( $house == 2 ) { ?> |
|
18 | + <?php } else if ($house == 2) { ?> |
|
19 | 19 | No results for Peers only |
20 | - <?php } else if ( $house == 4 ) { ?> |
|
20 | + <?php } else if ($house == 4) { ?> |
|
21 | 21 | No results for MSPs only |
22 | - <?php } else if ( $house == 3 ) { ?> |
|
22 | + <?php } else if ($house == 3) { ?> |
|
23 | 23 | No results for MLAs only |
24 | 24 | <?php } ?> |
25 | 25 | | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php } ?> |
32 | 32 | <?php } ?> |
33 | 33 | |
34 | - <?php if ( $wtt ) { ?> |
|
34 | + <?php if ($wtt) { ?> |
|
35 | 35 | <p><strong>Now, try reading what a couple of these Lords are saying, |
36 | 36 | to help you find someone appropriate. When you've found someone, |
37 | 37 | hit the "I want to write to this Lord" button on their results page |
@@ -39,37 +39,37 @@ discard block |
||
39 | 39 | </strong></p> |
40 | 40 | <?php } ?> |
41 | 41 | |
42 | - <?php if ( isset($speakers) && count($speakers) ) { ?> |
|
42 | + <?php if (isset($speakers) && count($speakers)) { ?> |
|
43 | 43 | |
44 | - <?php if ( !$wtt ) { ?> |
|
44 | + <?php if (!$wtt) { ?> |
|
45 | 45 | <ul class="search-result-display-options"> |
46 | 46 | <li>Results grouped by person</li> |
47 | 47 | <li> |
48 | - <?php if ( $house == 0 ) { ?> |
|
48 | + <?php if ($house == 0) { ?> |
|
49 | 49 | Show All |
50 | 50 | <?php } else { ?> |
51 | 51 | <a href="<?= $this_url->generate('html') ?>">Show All</a> |
52 | 52 | <?php } ?> |
53 | 53 | | |
54 | - <?php if ( $house == 1 ) { ?> |
|
54 | + <?php if ($house == 1) { ?> |
|
55 | 55 | MPs only |
56 | 56 | <?php } else { ?> |
57 | 57 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
58 | 58 | <?php } ?> |
59 | 59 | | |
60 | - <?php if ( $house == 2 ) { ?> |
|
60 | + <?php if ($house == 2) { ?> |
|
61 | 61 | Peers only |
62 | 62 | <?php } else { ?> |
63 | 63 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
64 | 64 | <?php } ?> |
65 | 65 | | |
66 | - <?php if ( $house == 4 ) { ?> |
|
66 | + <?php if ($house == 4) { ?> |
|
67 | 67 | MSPs only |
68 | 68 | <?php } else { ?> |
69 | 69 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
70 | 70 | <?php } ?> |
71 | 71 | | |
72 | - <?php if ( $house == 3 ) { ?> |
|
72 | + <?php if ($house == 3) { ?> |
|
73 | 73 | MLAs only |
74 | 74 | <?php } else { ?> |
75 | 75 | <a href="<?= $this_url->generate('html', array('house'=>3)) ?>">MLAs only</a> |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <?php foreach ( $speakers as $pid => $speaker ) { ?> |
|
93 | + <?php foreach ($speakers as $pid => $speaker) { ?> |
|
94 | 94 | |
95 | - <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?> |
|
95 | + <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?> |
|
96 | 96 | |
97 | 97 | <tr> |
98 | 98 | <td><?= $speaker['count'] ?></td> |
99 | 99 | <td> |
100 | - <?php if ( $pid ) { ?> |
|
101 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
100 | + <?php if ($pid) { ?> |
|
101 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
102 | 102 | <a href="/search/?q=<?= _htmlentities($searchstring) ?>&pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&wtt=2' : '' ?>"> |
103 | 103 | <?php } ?> |
104 | 104 | <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?> |
105 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
105 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
106 | 106 | </a> |
107 | 107 | <?php } ?> |
108 | - <?php if ( isset($speaker['party']) ) { ?> |
|
108 | + <?php if (isset($speaker['party'])) { ?> |
|
109 | 109 | <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span> |
110 | 110 | <?php } ?> |
111 | - <?php if ( $house != 2 ) { ?> |
|
111 | + <?php if ($house != 2) { ?> |
|
112 | 112 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 113 | <?php } ?> |
114 | 114 | <?php } else { // no $pid ?> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | </td> |
118 | 118 | <td> |
119 | - <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
|
119 | + <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?> |
|
120 | 120 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
121 | 121 | <?php } else { ?> |
122 | 122 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
@@ -111,7 +111,8 @@ |
||
111 | 111 | <?php if ( $house != 2 ) { ?> |
112 | 112 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 113 | <?php } ?> |
114 | - <?php } else { // no $pid ?> |
|
114 | + <?php } else { |
|
115 | +// no $pid ?> |
|
115 | 116 | <?= $speaker['name'] ?> |
116 | 117 | <?php } ?> |
117 | 118 | </td> |