@@ -32,7 +32,7 @@ |
||
32 | 32 | <?php |
33 | 33 | |
34 | 34 | $includes = array( |
35 | - array ( |
|
35 | + array( |
|
36 | 36 | 'type' => 'include', |
37 | 37 | 'content' => 'whatisthissite' |
38 | 38 | ), |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $q = $db->query("select gid from hansard where htype in (10,11) and major=1 and hdate='$date' order by rand() limit 1"); |
15 | 15 | $gid = $q->field(0, 'gid'); |
16 | 16 | |
17 | -$args = array ( |
|
17 | +$args = array( |
|
18 | 18 | 'gid' => fix_gid_from_db($gid), |
19 | 19 | 'sort' => 'regexp_replace', |
20 | 20 | ); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | voteerror("Your browser must be able to accept cookies before you can register a vote."); |
32 | 32 | } else { |
33 | 33 | // Delete the test cookie. |
34 | - setcookie ('testcookie', ''); |
|
34 | + setcookie('testcookie', ''); |
|
35 | 35 | } |
36 | 36 | // On with the voting...! |
37 | 37 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // We need to check the user can accept cookies, so... |
41 | 41 | |
42 | 42 | // Set a cookie |
43 | - setcookie ('testcookie', 'true'); |
|
43 | + setcookie('testcookie', 'true'); |
|
44 | 44 | |
45 | 45 | $ret = get_http_var('ret'); |
46 | 46 | $id = get_http_var('id'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $PAGE->page_start(); |
69 | 69 | |
70 | - $message = array ( |
|
70 | + $message = array( |
|
71 | 71 | 'title' => 'Sorry', |
72 | 72 | 'text' => $text |
73 | 73 | ); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $prev_epvotes[] = $epobject_id; |
159 | 159 | $new_cookie = implode('+', $prev_epvotes); |
160 | 160 | |
161 | - setcookie ("epvotes", $new_cookie, time()+60*60*24*365, "/", COOKIEDOMAIN); |
|
161 | + setcookie("epvotes", $new_cookie, time() + 60 * 60 * 24 * 365, "/", COOKIEDOMAIN); |
|
162 | 162 | |
163 | 163 | |
164 | 164 | } else { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | $PAGE->page_start(); |
191 | 191 | |
192 | -$message = array ( |
|
192 | +$message = array( |
|
193 | 193 | 'title' => "Thanks for your vote", |
194 | 194 | 'text' => "<strong>Would you like to ask a question like this yourself?</strong> Use our <a href=\"http://www.whatdotheyknow.com\">Freedom of Information site</a>." |
195 | 195 | ); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | WHERE constituency IN ('" . join("','", $a) . "') |
70 | 70 | AND ( ( house = 3 and left_house = '2011-03-24' ) or ( house = 4 and left_house = '2011-03-23') )"); |
71 | 71 | $mreg = array(); |
72 | - for ($i=0; $i<$q->rows(); $i++) { |
|
72 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
73 | 73 | $cons = $q->field($i, 'constituency'); |
74 | 74 | $house = $q->field($i, 'house'); |
75 | 75 | if (($house == 4 && $cons == $current['SPC']) || ($house == 3 && $cons == $current['NIE'])) { |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | <li>You were in the <strong><?=$current['SPC']?></strong> constituency, in the <strong><?=$current['SPE']?></strong> region; your constituency MSP was <a href='<?=$mp_url?>'><?=$name?></a>, and your regional MSPs were <?php |
135 | 135 | foreach ($mreg as $k => $n) { |
136 | 136 | print "<a href='/msp/" . make_member_url($n, '', 4) . "'>$n</a>"; |
137 | - if ($k < count($mreg)-2) print ', '; |
|
138 | - elseif ($k == count($mreg)-2) print ' and '; |
|
137 | + if ($k < count($mreg) - 2) print ', '; |
|
138 | + elseif ($k == count($mreg) - 2) print ' and '; |
|
139 | 139 | } |
140 | 140 | echo '.</li>'; |
141 | 141 | } elseif ($country == 'N') { |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | if ($pc) { |
22 | 22 | # current will have WMC key. If Scottish, has SPC and SPE too. If NI, has NIE. |
23 | 23 | $mapit = mapit_call('postcode', $pc); |
24 | - if (is_object($mapit)) { # RABX error returns an object |
|
24 | + if (is_object($mapit)) { |
|
25 | +# RABX error returns an object |
|
25 | 26 | print '<p class="error">Afraid we couldn’t find that postcode.</p>'; |
26 | 27 | $pc = ''; |
27 | 28 | } |
@@ -134,8 +135,11 @@ discard block |
||
134 | 135 | <li>You were in the <strong><?=$current['SPC']?></strong> constituency, in the <strong><?=$current['SPE']?></strong> region; your constituency MSP was <a href='<?=$mp_url?>'><?=$name?></a>, and your regional MSPs were <?php |
135 | 136 | foreach ($mreg as $k => $n) { |
136 | 137 | print "<a href='/msp/" . make_member_url($n, '', 4) . "'>$n</a>"; |
137 | - if ($k < count($mreg)-2) print ', '; |
|
138 | - elseif ($k == count($mreg)-2) print ' and '; |
|
138 | + if ($k < count($mreg)-2) { |
|
139 | + print ', '; |
|
140 | + } elseif ($k == count($mreg)-2) { |
|
141 | + print ' and '; |
|
142 | + } |
|
139 | 143 | } |
140 | 144 | echo '.</li>'; |
141 | 145 | } elseif ($country == 'N') { |
@@ -12,8 +12,8 @@ |
||
12 | 12 | |
13 | 13 | $ym = substr($date, 0, 7); |
14 | 14 | if ($ym != $last) { |
15 | - $url = WEBPATH . "news/archives/".str_replace("-", "/", $ym); |
|
16 | - print "<a href=\"$url\">".format_date($ym."-01", "F Y")."</a>"; |
|
15 | + $url = WEBPATH . "news/archives/" . str_replace("-", "/", $ym); |
|
16 | + print "<a href=\"$url\">" . format_date($ym . "-01", "F Y") . "</a>"; |
|
17 | 17 | print "<br>"; |
18 | 18 | $last = $ym; |
19 | 19 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $want['hpos'] = $q->field(0, 'hpos'); |
56 | 56 | |
57 | 57 | $LIST = new DEBATELIST; |
58 | - $args = array ( |
|
58 | + $args = array( |
|
59 | 59 | 's' => $search, |
60 | 60 | 'p' => 1, |
61 | 61 | 'num' => 200, |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $view = new MySociety\TheyWorkForYou\SectionView\WransView(); |
12 | 12 | $data = $view->display(); |
13 | 13 | if ($data) { |
14 | - if ( $data['template'] ) { |
|
14 | + if ($data['template']) { |
|
15 | 15 | $template = $data['template']; |
16 | 16 | } else { |
17 | 17 | $template = 'section/section'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (!$dept) { |
13 | 13 | } else { |
14 | - $dept = strtolower(str_replace('_',' ',$dept)); |
|
14 | + $dept = strtolower(str_replace('_', ' ', $dept)); |
|
15 | 15 | $q = $db->query('select epobject.epobject_id from hansard,epobject |
16 | 16 | where hansard.epobject_id=epobject.epobject_id and major=3 and section_id=0 |
17 | 17 | and hdate>(select max(hdate) from hansard where major=3) - interval 7 day |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | and section_id in (' . join(',', $ids) . ') |
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wrans/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wrans/?id=' . fix_gid_from_db($q->field($i, 'gid')) . '">' . $q->field($i, 'body') . '</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (!$dept) { |
13 | 13 | } else { |
14 | - $dept = strtolower(str_replace('_',' ',$dept)); |
|
14 | + $dept = strtolower(str_replace('_', ' ', $dept)); |
|
15 | 15 | $q = $db->query('select epobject.epobject_id from hansard,epobject |
16 | 16 | where hansard.epobject_id=epobject.epobject_id and major=4 and section_id=0 |
17 | 17 | and hdate>(select max(hdate) from hansard where major=4) - interval 7 day |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | and section_id in (' . join(',', $ids) . ') |
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wms/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wms/?id=' . fix_gid_from_db($q->field($i, 'gid')) . '">' . $q->field($i, 'body') . '</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |