@@ -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'])) { |
@@ -155,7 +155,8 @@ |
||
155 | 155 | # The subscription has been created, but it is possible that the |
156 | 156 | # payment failed (card error), or we need to do 3DS or similar |
157 | 157 | $pi = $invoice->payment_intent; |
158 | - if (!$pi) { # Free plan |
|
158 | + if (!$pi) { |
|
159 | +# Free plan |
|
159 | 160 | return; |
160 | 161 | } |
161 | 162 | if ($pi->status == 'requires_payment_method' || $pi->status == 'requires_source') { |
@@ -217,11 +217,14 @@ |
||
217 | 217 | <?= $recent_appearances['additional_links'] ?> |
218 | 218 | <?php endif; ?> |
219 | 219 | |
220 | - <?php else: ?> |
|
220 | + <?php else { |
|
221 | + : ?> |
|
221 | 222 | |
222 | 223 | <p><?=gettext('No recent appearances to display.') ?></p> |
223 | 224 | |
224 | - <?php endif; ?> |
|
225 | + <?php endif; |
|
226 | +} |
|
227 | +?> |
|
225 | 228 | |
226 | 229 | </div> |
227 | 230 | <?php endif; ?> |
@@ -19,9 +19,11 @@ |
||
19 | 19 | } |
20 | 20 | ?> |
21 | 21 | <h2><?= sprintf(gettext('%s in constituencies matching <em class="current-search-term">%s</em>'), $desc, _htmlentities($searchstring)) ?></h2> |
22 | - <?php } elseif ($mp_types['former']) { // count($cons) <= 1?> |
|
22 | + <?php } elseif ($mp_types['former']) { |
|
23 | +// count($cons) <= 1?> |
|
23 | 24 | <h2><?= sprintf(gettext('Former MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
24 | - <?php } else { // count($cons) <= 1?> |
|
25 | + <?php } else { |
|
26 | +// count($cons) <= 1?> |
|
25 | 27 | <h2><?= sprintf(gettext('MP for <em class="current-search-term">%s</em>'), _htmlentities($searchstring)) ?></h2> |
26 | 28 | <?php } ?> |
27 | 29 | <?php foreach ($cons as $member) { ?> |
@@ -121,7 +121,8 @@ |
||
121 | 121 | <?php if ($house != HOUSE_TYPE_LORDS) { ?> |
122 | 122 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
123 | 123 | <?php } ?> |
124 | - <?php } else { // no $pid?> |
|
124 | + <?php } else { |
|
125 | +// no $pid?> |
|
125 | 126 | <?= $speaker['name'] ?> |
126 | 127 | <?php } ?> |
127 | 128 | </td> |
@@ -1,5 +1,6 @@ |
||
1 | 1 | <div class="debate-speech__division__your-mp"> |
2 | - <?php if (!isset($main_vote_mp) || ! $main_vote_mp) { /* $main_vote_mp is true if an MP has been requested via the URL */ ?> |
|
2 | + <?php if (!isset($main_vote_mp) || ! $main_vote_mp) { |
|
3 | +/* $main_vote_mp is true if an MP has been requested via the URL */ ?> |
|
3 | 4 | <div class="your-mp__header"> |
4 | 5 | <h3>How your <?= $division['members']['singular'] ?> voted</h3> |
5 | 6 | <p> |
@@ -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 = []; |
66 | +} |
|
65 | 67 | |
66 | 68 | foreach ($positions as $position) { |
67 | 69 | if (!in_array($position['policy_id'], $policy_ids)) { |
@@ -319,7 +319,8 @@ discard block |
||
319 | 319 | |
320 | 320 | if (preg_match("/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/", $date, $matches)) { |
321 | 321 | [$string, $year, $month, $day] = $matches; |
322 | - if ($year < 1902) { # gmdate fns only go back to Dec. 1901 |
|
322 | + if ($year < 1902) { |
|
323 | +# gmdate fns only go back to Dec. 1901 |
|
323 | 324 | if ($format == SHORTDATEFORMAT) { |
324 | 325 | return ($day + 0) . ' ' . $format_date_months_short[$month + 0] . " $year"; |
325 | 326 | } else { |
@@ -1046,7 +1047,8 @@ discard block |
||
1046 | 1047 | 'Lords in Waiting (HM Household)' => 'Government Whip', |
1047 | 1048 | 'Baronesses in Waiting, HM Household' => 'Government Whip', |
1048 | 1049 | ]; |
1049 | - if ($pos) { # Government post, or Chairman of Select Committee |
|
1050 | + if ($pos) { |
|
1051 | +# Government post, or Chairman of Select Committee |
|
1050 | 1052 | $pretty = $pos; |
1051 | 1053 | if ($dept && $dept != 'No Department') { |
1052 | 1054 | $pretty .= ", $dept"; |
@@ -1054,7 +1056,8 @@ discard block |
||
1054 | 1056 | if (array_key_exists($pretty, $lookup)) { |
1055 | 1057 | $pretty = $lookup[$pretty]; |
1056 | 1058 | } |
1057 | - } else { # Member of Select Committee |
|
1059 | + } else { |
|
1060 | +# Member of Select Committee |
|
1058 | 1061 | $pretty = "Member, $dept"; |
1059 | 1062 | } |
1060 | 1063 | return $pretty; |
@@ -166,7 +166,8 @@ |
||
166 | 166 | $success = send_template_email($d, $m, true); |
167 | 167 | mlog("sent ... "); |
168 | 168 | # sleep if time between sending mails is less than a certain number of seconds on average |
169 | - if (((time() - $start_time) / $sentemails) < 0.5) { # number of seconds per mail not to be quicker than |
|
169 | + if (((time() - $start_time) / $sentemails) < 0.5) { |
|
170 | +# number of seconds per mail not to be quicker than |
|
170 | 171 | mlog("pausing ... "); |
171 | 172 | sleep(1); |
172 | 173 | } |