@@ -55,7 +55,7 @@ |
||
55 | 55 | $want['hpos'] = $q['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, |
@@ -18,11 +18,16 @@ |
||
18 | 18 | $htime = $q['htime']; |
19 | 19 | $atime = $q['atime']; |
20 | 20 | $adate = $q['adate']; |
21 | -if ($atime) $htime = $atime; |
|
22 | -if ($adate) $hdate = $adate; |
|
21 | +if ($atime) { |
|
22 | + $htime = $atime; |
|
23 | +} |
|
24 | +if ($adate) { |
|
25 | + $hdate = $adate; |
|
26 | +} |
|
23 | 27 | |
24 | -if (!$hdate || !$htime || !$time) |
|
28 | +if (!$hdate || !$htime || !$time) { |
|
25 | 29 | exit; |
30 | +} |
|
26 | 31 | |
27 | 32 | $videodb = \MySociety\TheyWorkForYou\Utility\Video::dbConnect(); |
28 | 33 | if (!$file) { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | 'person_id' => $pid, |
16 | 16 | 'name' => html_entity_decode(member_full_name($row['house'], $row['title'], |
17 | 17 | $row['given_name'], $row['family_name'], |
18 | - $row['lordofname'] )), |
|
18 | + $row['lordofname'])), |
|
19 | 19 | 'party' => isset($parties[$row['party']]) ? $parties[$row['party']] : $row['party'], |
20 | 20 | ); |
21 | 21 | if ($row['house'] != HOUSE_TYPE_LORDS) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $LISTURL = new \MySociety\TheyWorkForYou\Url($hansardmajors[$id_data['major']]['page_all']); |
41 | 41 | $fragment = ''; |
42 | 42 | if ($id_data['htype'] == '11' || $id_data['htype'] == '10') { |
43 | - $LISTURL->insert( array( 'id' => $id_data['gid'] ) ); |
|
43 | + $LISTURL->insert(array('id' => $id_data['gid'])); |
|
44 | 44 | } else { |
45 | 45 | $parent_epobject_id = $id_data['subsection_id']; |
46 | 46 | $parent_gid = ''; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $parent_gid = fix_gid_from_db($r['gid']); |
54 | 54 | } |
55 | 55 | if ($parent_gid != '') { |
56 | - $LISTURL->insert( array( 'id' => $parent_gid ) ); |
|
56 | + $LISTURL->insert(array('id' => $parent_gid)); |
|
57 | 57 | $fragment = '#g' . gid_to_anchor($id_data['gid']); |
58 | 58 | } |
59 | 59 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | array_push($out['none'], '<li>' . $row['person_id'] . ' (' . $row['party'] . ')' . ', ' . $row['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>'; |
@@ -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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | 33 | foreach ($q as $row) { |
34 | - print '<li><a href="/wrans/?id=' . fix_gid_from_db($row['gid']). '">' . $row['body']. '</a>'; |
|
34 | + print '<li><a href="/wrans/?id=' . fix_gid_from_db($row['gid']) . '">' . $row['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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | 33 | foreach ($q as $row) { |
34 | - print '<li><a href="/wms/?id=' . fix_gid_from_db($row['gid']). '">' . $row['body']. '</a>'; |
|
34 | + print '<li><a href="/wms/?id=' . fix_gid_from_db($row['gid']) . '">' . $row['body'] . '</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |
@@ -11,5 +11,5 @@ |
||
11 | 11 | $gid = fix_gid_from_db($gid); |
12 | 12 | |
13 | 13 | $URL = new \MySociety\TheyWorkForYou\Url('debates'); |
14 | -$URL->insert( array( 'id' => $gid ) ); |
|
14 | +$URL->insert(array('id' => $gid)); |
|
15 | 15 | header('Location: ' . $URL->generate()); |
@@ -24,9 +24,9 @@ |
||
24 | 24 | }); |
25 | 25 | $sections_with_votes = array_values($sections_with_votes); |
26 | 26 | |
27 | -for ($i=0; $i<count($sections_with_votes); $i+=2) { |
|
27 | +for ($i = 0; $i < count($sections_with_votes); $i += 2) { |
|
28 | 28 | $l = $sections_with_votes[$i]; |
29 | - $r = $i+1 < count($sections_with_votes) ? $sections_with_votes[$i+1] : null; |
|
29 | + $r = $i + 1 < count($sections_with_votes) ? $sections_with_votes[$i + 1] : null; |
|
30 | 30 | |
31 | 31 | $vote_title = $vote_sets[$l]['title']; |
32 | 32 | $anchor = $vote_sets[$l]['anchor']; |