@@ -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)) { |
@@ -18,10 +18,13 @@ |
||
| 18 | 18 | # Content goes here |
| 19 | 19 | foreach ($data['dates'] as $date => $day_events) { |
| 20 | 20 | foreach ($order as $i => $chamber) { |
| 21 | - if (!array_key_exists($chamber, $day_events)) |
|
| 22 | - continue; |
|
| 21 | + if (!array_key_exists($chamber, $day_events)) { |
|
| 22 | + continue; |
|
| 23 | + } |
|
| 23 | 24 | $events = $day_events[$chamber]; |
| 24 | - if ($plural[$i]) $chamber .= 's'; |
|
| 25 | + if ($plural[$i]) { |
|
| 26 | + $chamber .= 's'; |
|
| 27 | + } |
|
| 25 | 28 | print "<h2 class='calendar'>$chamber"; |
| 26 | 29 | if (in_array($major[$i], $data['majors'])) { |
| 27 | 30 | $URL = new URL($hansardmajors[$major[$i]]['page_all']); |
@@ -18,7 +18,9 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | $PAGE->block_start(array('id'=>'recentcomments', 'title'=>$title)); |
| 20 | 20 | |
| 21 | - if ($this_page != 'home') $PAGE->page_links($data); |
|
| 21 | + if ($this_page != 'home') { |
|
| 22 | + $PAGE->page_links($data); |
|
| 23 | + } |
|
| 22 | 24 | $USERURL = new URL('userview'); |
| 23 | 25 | ?> |
| 24 | 26 | <ul> |
@@ -50,7 +52,9 @@ discard block |
||
| 50 | 52 | <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments'])+1; ?>">See more annotations posted recently</a></p> |
| 51 | 53 | <?php |
| 52 | 54 | } |
| 53 | - if ($this_page != 'home') $PAGE->page_links($data); |
|
| 55 | + if ($this_page != 'home') { |
|
| 56 | + $PAGE->page_links($data); |
|
| 57 | + } |
|
| 54 | 58 | $PAGE->block_end(); |
| 55 | 59 | } |
| 56 | 60 | ?> |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | echo '<optgroup label="', $key, '">'; |
| 6 | 6 | foreach ($values as $k => $v) { |
| 7 | 7 | echo '<option'; |
| 8 | - if ($current == $k) echo ' selected'; |
|
| 8 | + if ($current == $k) { |
|
| 9 | + echo ' selected'; |
|
| 10 | + } |
|
| 9 | 11 | echo ' value="', $k, '">', $v; |
| 10 | 12 | } |
| 11 | 13 | echo "</optgroup>\n"; |
@@ -44,8 +44,9 @@ |
||
| 44 | 44 | $pagetitle .= " page $pagenum"; |
| 45 | 45 | } |
| 46 | 46 | $num = get_http_var('n'); |
| 47 | - if (!is_numeric($num) || $num <= 0) |
|
| 48 | - $num = 20; |
|
| 47 | + if (!is_numeric($num) || $num <= 0) { |
|
| 48 | + $num = 20; |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | $DATA->set_page_metadata($this_page, 'title', $pagetitle); |
| 51 | 52 | |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | if (isset($arr[3])) { |
| 34 | 34 | print '<a href="'.$link.'/questions">Written Questions</a>'; |
| 35 | 35 | } |
| 36 | - if (count($arr)==2) |
|
| 37 | - print ' | '; |
|
| 36 | + if (count($arr)==2) { |
|
| 37 | + print ' | '; |
|
| 38 | + } |
|
| 38 | 39 | if (isset($arr[4])) { |
| 39 | 40 | print '<a href="'.$link.'/statements">Written Ministerial Statements</a>'; |
| 40 | 41 | } |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | $adate = $q->field(0, 'adate'); |
| 18 | 18 | $atime = $q->field(0, 'atime'); |
| 19 | 19 | $video = \MySociety\TheyWorkForYou\Utility\Video::fromTimestamp($videodb, $adate, $atime); |
| 20 | -if (!$video) exit; |
|
| 20 | +if (!$video) { |
|
| 21 | + exit; |
|
| 22 | +} |
|
| 21 | 23 | |
| 22 | 24 | $start = date('H:i:s', strtotime($video['broadcast_start']. ' GMT')); |
| 23 | 25 | $end = date('H:i:s', strtotime($video['broadcast_end'] . ' GMT')); |
@@ -35,7 +37,9 @@ discard block |
||
| 35 | 37 | print '<stamps>'; |
| 36 | 38 | for ($i=0; $i<$q->rows(); $i++) { |
| 37 | 39 | $gid = str_replace('uk.org.publicwhip/', '', $q->field($i, 'gid')); |
| 38 | - if (isset($gids[$gid])) continue; |
|
| 40 | + if (isset($gids[$gid])) { |
|
| 41 | + continue; |
|
| 42 | + } |
|
| 39 | 43 | $timetoend = $q->field($i, 'timetoend') - $file_offset; |
| 40 | 44 | if ($timetoend>0) { |
| 41 | 45 | $video = \MySociety\TheyWorkForYou\Utility\Video::fromTimestamp($videodb, $q->field($i, 'adate'), $q->field($i, 'atime')); |
@@ -45,8 +49,9 @@ discard block |
||
| 45 | 49 | $end = date('H:i:s', strtotime($video['broadcast_end'] . ' GMT')); |
| 46 | 50 | } |
| 47 | 51 | $timediff = $q->field($i, 'timediff') - $file_offset; |
| 48 | - if ($timediff>=0) |
|
| 49 | - print "<stamp><gid>$gid</gid><file>$video[id]</file><time>$timediff</time></stamp>\n"; |
|
| 52 | + if ($timediff>=0) { |
|
| 53 | + print "<stamp><gid>$gid</gid><file>$video[id]</file><time>$timediff</time></stamp>\n"; |
|
| 54 | + } |
|
| 50 | 55 | $gids[$gid] = true; |
| 51 | 56 | } |
| 52 | 57 | print '</stamps>'; |
@@ -5,7 +5,9 @@ discard block |
||
| 5 | 5 | $gid = get_http_var('gid'); |
| 6 | 6 | $oops = get_http_var('oops'); |
| 7 | 7 | |
| 8 | -if (!$oops || !$gid) exit; |
|
| 8 | +if (!$oops || !$gid) { |
|
| 9 | + exit; |
|
| 10 | +} |
|
| 9 | 11 | |
| 10 | 12 | $gid = "uk.org.publicwhip/$gid"; |
| 11 | 13 | |
@@ -16,7 +18,8 @@ discard block |
||
| 16 | 18 | |
| 17 | 19 | $db = new ParlDB; |
| 18 | 20 | $q = $db->query("update video_timestamps set deleted=1 where id = :oops and gid = :gid and current_timestamp<whenstamped+interval 30 second", $params); |
| 19 | -if ($q->affected_rows()) |
|
| 21 | +if ($q->affected_rows()) { |
|
| 20 | 22 | $db->query("update hansard set video_status = video_status & 11 where gid = :gid", $params); |
| 23 | +} |
|
| 21 | 24 | |
| 22 | 25 | print "<status>OK</status>"; |
@@ -48,11 +48,15 @@ discard block |
||
| 48 | 48 | for ($i=0; $i<$q->rows(); $i++) { |
| 49 | 49 | $c = $q->field($i, 'c'); |
| 50 | 50 | $criteria = $q->field($i, 'criteria'); |
| 51 | - if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue; |
|
| 51 | + if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) { |
|
| 52 | + continue; |
|
| 53 | + } |
|
| 52 | 54 | $person_id = $m[1]; |
| 53 | 55 | $MEMBER = new MEMBER(array('person_id'=>$person_id)); |
| 54 | 56 | if ($MEMBER->valid) { |
| 55 | - if (!array_key_exists($person_id, $tots)) $tots[$person_id] = 0; |
|
| 57 | + if (!array_key_exists($person_id, $tots)) { |
|
| 58 | + $tots[$person_id] = 0; |
|
| 59 | + } |
|
| 56 | 60 | $tots[$person_id] += $c; |
| 57 | 61 | $name[$person_id] = $MEMBER->full_name(); |
| 58 | 62 | } |
@@ -62,10 +66,14 @@ discard block |
||
| 62 | 66 | for ($i=0; $i<$q->rows(); $i++) { |
| 63 | 67 | $c = $q->field($i, 'c'); |
| 64 | 68 | $criteria = $q->field($i, 'criteria'); |
| 65 | - if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) continue; |
|
| 69 | + if (!preg_match('#^speaker:(\d+)#', $criteria, $m)) { |
|
| 70 | + continue; |
|
| 71 | + } |
|
| 66 | 72 | $person_id = $m[1]; |
| 67 | 73 | if (isset($name[$person_id])) { |
| 68 | - if (!array_key_exists($person_id, $unconfirmed)) $unconfirmed[$person_id] = 0; |
|
| 74 | + if (!array_key_exists($person_id, $unconfirmed)) { |
|
| 75 | + $unconfirmed[$person_id] = 0; |
|
| 76 | + } |
|
| 69 | 77 | $unconfirmed[$person_id] += $c; |
| 70 | 78 | } |
| 71 | 79 | } |