@@ -110,13 +110,16 @@ |
||
| 110 | 110 | |
| 111 | 111 | <?php endif; ?> |
| 112 | 112 | |
| 113 | - <?php else: ?> |
|
| 113 | + <?php else { |
|
| 114 | + : ?> |
|
| 114 | 115 | |
| 115 | 116 | <div class="panel"> |
| 116 | 117 | <p>This person has not voted on any of the key issues which we keep track of.</p> |
| 117 | 118 | </div> |
| 118 | 119 | |
| 119 | - <?php endif; ?> |
|
| 120 | + <?php endif; |
|
| 121 | +} |
|
| 122 | +?> |
|
| 120 | 123 | |
| 121 | 124 | <?php endif; ?> |
| 122 | 125 | |
@@ -190,11 +190,14 @@ |
||
| 190 | 190 | <?= $recent_appearances['additional_links'] ?> |
| 191 | 191 | <?php endif; ?> |
| 192 | 192 | |
| 193 | - <?php else: ?> |
|
| 193 | + <?php else { |
|
| 194 | + : ?> |
|
| 194 | 195 | |
| 195 | 196 | <p>No recent appearances to display.</p> |
| 196 | 197 | |
| 197 | - <?php endif; ?> |
|
| 198 | + <?php endif; |
|
| 199 | +} |
|
| 200 | +?> |
|
| 198 | 201 | |
| 199 | 202 | </div> |
| 200 | 203 | <?php endif; ?> |
@@ -58,10 +58,12 @@ |
||
| 58 | 58 | to <a href="<?= $member_url ?>/votes">see all their votes</a>. |
| 59 | 59 | </p> |
| 60 | 60 | |
| 61 | - <?php else: ?> |
|
| 61 | + <?php else { |
|
| 62 | + : ?> |
|
| 62 | 63 | <ul class="vote-descriptions"> |
| 63 | 64 | <?php |
| 64 | 65 | $policy_ids = array(); |
| 66 | +} |
|
| 65 | 67 | |
| 66 | 68 | foreach ($positions as $position) { |
| 67 | 69 | if (!in_array($position['policy_id'], $policy_ids)) { |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | $email = get_http_var('email'); |
| 17 | 17 | $sign = get_http_var('sign'); |
| 18 | 18 | $pid = get_http_var('pid'); |
| 19 | -if (!$pid || !ctype_digit($pid)) print 'not valid'; |
|
| 20 | -else { |
|
| 19 | +if (!$pid || !ctype_digit($pid)) { |
|
| 20 | + print 'not valid'; |
|
| 21 | +} else { |
|
| 21 | 22 | $authed = auth_verify_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET, $sign); |
| 22 | 23 | if ($authed) { |
| 23 | 24 | $db = new ParlDB; |
@@ -26,10 +27,11 @@ discard block |
||
| 26 | 27 | ':criteria' => 'speaker:' . $pid |
| 27 | 28 | )); |
| 28 | 29 | $already_signed = $q->rows(); |
| 29 | - if ($already_signed) |
|
| 30 | - print "already signed"; |
|
| 31 | - else |
|
| 32 | - print "not signed"; |
|
| 30 | + if ($already_signed) { |
|
| 31 | + print "already signed"; |
|
| 32 | + } else { |
|
| 33 | + print "not signed"; |
|
| 34 | + } |
|
| 33 | 35 | } else { |
| 34 | 36 | print "not authed"; |
| 35 | 37 | } |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | <?php |
| 26 | 26 | $c = 0; |
| 27 | 27 | foreach ($all_news as $id => $news_row) { |
| 28 | - if ($c++ == 10) break; |
|
| 28 | + if ($c++ == 10) { |
|
| 29 | + break; |
|
| 30 | + } |
|
| 29 | 31 | list($title, $content, $date) = $news_row; |
| 30 | 32 | $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
| 31 | 33 | print "<rdf:li rdf:resource=\"$url\" />\n"; |
@@ -39,7 +41,9 @@ discard block |
||
| 39 | 41 | <?php |
| 40 | 42 | $c = 0; |
| 41 | 43 | foreach ($all_news as $id => $news_row) { |
| 42 | - if ($c++ == 10) break; |
|
| 44 | + if ($c++ == 10) { |
|
| 45 | + break; |
|
| 46 | + } |
|
| 43 | 47 | list($title, $content, $date) = $news_row; |
| 44 | 48 | $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
| 45 | 49 | $excerpt = trim_characters(news_format_body($content), 0, 250); |
@@ -445,9 +445,15 @@ discard block |
||
| 445 | 445 | // Generates the password .... |
| 446 | 446 | for ($x=0; $x < 6;) { |
| 447 | 447 | $y = rand(1,1000); |
| 448 | - if($y>350 && $y<601) $d=chr(rand(48,57)); |
|
| 449 | - if($y<351) $d=chr(rand(65,90)); |
|
| 450 | - if($y>600) $d=chr(rand(97,122)); |
|
| 448 | + if($y>350 && $y<601) { |
|
| 449 | + $d=chr(rand(48,57)); |
|
| 450 | + } |
|
| 451 | + if($y<351) { |
|
| 452 | + $d=chr(rand(65,90)); |
|
| 453 | + } |
|
| 454 | + if($y>600) { |
|
| 455 | + $d=chr(rand(97,122)); |
|
| 456 | + } |
|
| 451 | 457 | if ($d!=$o && !preg_match('#[O01lI]#', $d)) { |
| 452 | 458 | $o=$d; $pwd.=$d; $x++; |
| 453 | 459 | } |
@@ -1171,8 +1177,12 @@ discard block |
||
| 1171 | 1177 | |
| 1172 | 1178 | public function confirm_email($token, $redirect=true) { |
| 1173 | 1179 | $arg = ''; |
| 1174 | - if (strstr($token, '::')) $arg = '::'; |
|
| 1175 | - if (strstr($token, '-')) $arg = '-'; |
|
| 1180 | + if (strstr($token, '::')) { |
|
| 1181 | + $arg = '::'; |
|
| 1182 | + } |
|
| 1183 | + if (strstr($token, '-')) { |
|
| 1184 | + $arg = '-'; |
|
| 1185 | + } |
|
| 1176 | 1186 | list($user_id, $registrationtoken) = explode($arg, $token); |
| 1177 | 1187 | |
| 1178 | 1188 | if (!is_numeric($user_id) || $registrationtoken == '') { |
@@ -1254,8 +1264,12 @@ discard block |
||
| 1254 | 1264 | |
| 1255 | 1265 | // Split the token into its parts. |
| 1256 | 1266 | $arg = ''; |
| 1257 | - if (strstr($token, '::')) $arg = '::'; |
|
| 1258 | - if (strstr($token, '-')) $arg = '-'; |
|
| 1267 | + if (strstr($token, '::')) { |
|
| 1268 | + $arg = '::'; |
|
| 1269 | + } |
|
| 1270 | + if (strstr($token, '-')) { |
|
| 1271 | + $arg = '-'; |
|
| 1272 | + } |
|
| 1259 | 1273 | list($user_id, $registrationtoken) = explode($arg, $token); |
| 1260 | 1274 | |
| 1261 | 1275 | if (!is_numeric($user_id) || $registrationtoken == '') { |
@@ -1385,15 +1399,19 @@ discard block |
||
| 1385 | 1399 | // not-logged-in users. |
| 1386 | 1400 | |
| 1387 | 1401 | $this->postcode = $pc; |
| 1388 | - if (!headers_sent()) // if in debug mode |
|
| 1402 | + if (!headers_sent()) { |
|
| 1403 | + // if in debug mode |
|
| 1389 | 1404 | setcookie (POSTCODE_COOKIE, $pc, time()+7*86400, "/", COOKIEDOMAIN); |
| 1405 | + } |
|
| 1390 | 1406 | |
| 1391 | 1407 | twfy_debug('USER', "Set the cookie named '" . POSTCODE_COOKIE . " to '$pc' for " . COOKIEDOMAIN . " domain"); |
| 1392 | 1408 | } |
| 1393 | 1409 | |
| 1394 | 1410 | public function unset_postcode_cookie() { |
| 1395 | - if (!headers_sent()) // if in debug mode |
|
| 1411 | + if (!headers_sent()) { |
|
| 1412 | + // if in debug mode |
|
| 1396 | 1413 | setcookie (POSTCODE_COOKIE, '', time() - 3600, '/', COOKIEDOMAIN); |
| 1414 | + } |
|
| 1397 | 1415 | } |
| 1398 | 1416 | |
| 1399 | 1417 | // mostly here for updating from facebook where we do not need |
@@ -36,7 +36,8 @@ |
||
| 36 | 36 | public function add($searchlogdata) { |
| 37 | 37 | |
| 38 | 38 | $ip = getenv('REMOTE_ADDR'); |
| 39 | - if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { # Googlebot |
|
| 39 | + if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { |
|
| 40 | +# Googlebot |
|
| 40 | 41 | return; |
| 41 | 42 | } |
| 42 | 43 | if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#simplepie|bot#i', $_SERVER['HTTP_USER_AGENT'])) { |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | $desc = ucfirst(implode(' and ', $types)); |
| 27 | 27 | ?> |
| 28 | 28 | <h2><?= $desc ?> in constituencies matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
| 29 | - <?php } else { // count($cons) <= 1 ?> |
|
| 29 | + <?php } else { |
|
| 30 | +// count($cons) <= 1 ?> |
|
| 30 | 31 | <h2><?= $mp_types['former'] ? 'Former ' : '' ?>MP for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
| 31 | 32 | <?php } ?> |
| 32 | 33 | <?php foreach ( $cons as $member ) { ?> |
@@ -366,14 +366,12 @@ |
||
| 366 | 366 | public function limitToSet($set) { |
| 367 | 367 | |
| 368 | 368 | // Sanity check the set exists |
| 369 | - if (isset($this->sets[$set])) |
|
| 370 | - { |
|
| 369 | + if (isset($this->sets[$set])) { |
|
| 371 | 370 | $out = array(); |
| 372 | 371 | // Reassemble the new policies list based on the set. |
| 373 | 372 | foreach ($this->sets[$set] as $set_policy) |
| 374 | 373 | { |
| 375 | - if (isset($this->policies[$set_policy])) |
|
| 376 | - { |
|
| 374 | + if (isset($this->policies[$set_policy])) { |
|
| 377 | 375 | $out[$set_policy] = $this->policies[$set_policy]; |
| 378 | 376 | } else { |
| 379 | 377 | // if we've limited the policies to a single one then we only |