@@ -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']; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | $rsspath = BASEDIR . '/rss/mp/'; |
10 | 10 | |
11 | 11 | // Make things group writable. |
12 | -umask (002); |
|
12 | +umask(002); |
|
13 | 13 | |
14 | 14 | $HANSARDLIST = new HANSARDLIST(); |
15 | 15 | $db = $HANSARDLIST->db; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | foreach ($q as $person) { |
23 | 23 | $person_id = $person['person_id']; |
24 | 24 | |
25 | - $args = array ( 'person_id' => $person_id ); |
|
25 | + $args = array('person_id' => $person_id); |
|
26 | 26 | $speeches = $HANSARDLIST->display('person', $args, 'none'); |
27 | 27 | |
28 | 28 | // Some data about this person that we'll need for the feed. |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | fwrite($fh, $rsstext); |
112 | - fclose ($fh); |
|
112 | + fclose($fh); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | #print "Took " . (time()-$starttime) . " seconds\n"; |
@@ -24,47 +24,47 @@ discard block |
||
24 | 24 | foreach ($q as $person) { |
25 | 25 | $person_id = $person['person_id']; |
26 | 26 | |
27 | - $args = array ( 'person_id' => $person_id ); |
|
28 | - $speeches = $HANSARDLIST->display('person', $args, 'none'); |
|
27 | + $args = array ( 'person_id' => $person_id ); |
|
28 | + $speeches = $HANSARDLIST->display('person', $args, 'none'); |
|
29 | 29 | |
30 | - // Some data about this person that we'll need for the feed. |
|
31 | - $MEMBER = new MEMBER(array('person_id' => $person_id)); |
|
32 | - $MPURL = new \MySociety\TheyWorkForYou\Url('mp'); |
|
33 | - $MPURL->insert(array('pid'=>$person_id)); |
|
34 | - $mpurl = $MPURL->generate(); |
|
30 | + // Some data about this person that we'll need for the feed. |
|
31 | + $MEMBER = new MEMBER(array('person_id' => $person_id)); |
|
32 | + $MPURL = new \MySociety\TheyWorkForYou\Url('mp'); |
|
33 | + $MPURL->insert(array('pid'=>$person_id)); |
|
34 | + $mpurl = $MPURL->generate(); |
|
35 | 35 | |
36 | - $date = gmdate('Y-m-d'); |
|
37 | - $time = gmdate('H:i:s'); |
|
38 | - $datenow = $date . 'T' . $time . '+00:00'; |
|
36 | + $date = gmdate('Y-m-d'); |
|
37 | + $time = gmdate('H:i:s'); |
|
38 | + $datenow = $date . 'T' . $time . '+00:00'; |
|
39 | 39 | |
40 | - // Prepare the meat of the RSS file. |
|
41 | - $items = ''; |
|
42 | - $entries = ''; |
|
43 | - if (isset ($speeches['rows']) && count($speeches['rows']) > 0) { |
|
40 | + // Prepare the meat of the RSS file. |
|
41 | + $items = ''; |
|
42 | + $entries = ''; |
|
43 | + if (isset ($speeches['rows']) && count($speeches['rows']) > 0) { |
|
44 | 44 | |
45 | - foreach ($speeches['rows'] as $n => $row) { |
|
45 | + foreach ($speeches['rows'] as $n => $row) { |
|
46 | 46 | |
47 | - // While we're linking to individual speeches, |
|
48 | - // the text is the body of the parent, ie (sub)section. |
|
49 | - $title = _htmlentities(str_replace('—', '-', $row['parent']['body'])); |
|
47 | + // While we're linking to individual speeches, |
|
48 | + // the text is the body of the parent, ie (sub)section. |
|
49 | + $title = _htmlentities(str_replace('—', '-', $row['parent']['body'])); |
|
50 | 50 | |
51 | - $link = isset($row['listurl']) ? $row['listurl'] : ''; |
|
52 | - $link = 'https://' . DOMAIN . $link; |
|
51 | + $link = isset($row['listurl']) ? $row['listurl'] : ''; |
|
52 | + $link = 'https://' . DOMAIN . $link; |
|
53 | 53 | |
54 | - $description = _htmlentities(trim_characters($row['body'], 0, 200)); |
|
55 | - $contentencoded = $row['body']; |
|
54 | + $description = _htmlentities(trim_characters($row['body'], 0, 200)); |
|
55 | + $contentencoded = $row['body']; |
|
56 | 56 | |
57 | - $hdate = format_date($row['hdate'], 'Y-m-d'); |
|
58 | - if ($row['htime'] != null) { |
|
59 | - $htime = format_time($row['htime'], 'H:i:s'); |
|
60 | - } else { |
|
61 | - $htime = '00:00:00'; |
|
62 | - } |
|
57 | + $hdate = format_date($row['hdate'], 'Y-m-d'); |
|
58 | + if ($row['htime'] != null) { |
|
59 | + $htime = format_time($row['htime'], 'H:i:s'); |
|
60 | + } else { |
|
61 | + $htime = '00:00:00'; |
|
62 | + } |
|
63 | 63 | |
64 | - $date = $hdate . 'T' . $htime . '+00:00'; |
|
64 | + $date = $hdate . 'T' . $htime . '+00:00'; |
|
65 | 65 | |
66 | - $items .= '<rdf:li rdf:resource="' . $link . '" />' . "\n"; |
|
67 | - $entries .= "<item rdf:about=\"$link\"> |
|
66 | + $items .= '<rdf:li rdf:resource="' . $link . '" />' . "\n"; |
|
67 | + $entries .= "<item rdf:about=\"$link\"> |
|
68 | 68 | <title>$title</title> |
69 | 69 | <link>$link</link> |
70 | 70 | <description>$description</description> |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | </item> |
74 | 74 | "; |
75 | 75 | |
76 | - } |
|
77 | - } |
|
76 | + } |
|
77 | + } |
|
78 | 78 | |
79 | - // Prepare the whole text of the RSS file. |
|
80 | - $rsstext = '<?xml version="1.0" encoding="utf-8"?> |
|
79 | + // Prepare the whole text of the RSS file. |
|
80 | + $rsstext = '<?xml version="1.0" encoding="utf-8"?> |
|
81 | 81 | <rdf:RDF |
82 | 82 | xmlns:dc="http://purl.org/dc/elements/1.1/" |
83 | 83 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
@@ -103,15 +103,15 @@ discard block |
||
103 | 103 | |
104 | 104 | </rdf:RDF>'; |
105 | 105 | |
106 | - // Write the text to the file... |
|
107 | - $filename = $rsspath . $person_id . '.rdf'; |
|
108 | - $fh = @fopen($filename, "w"); |
|
109 | - if (!$fh) { # Problem writing, just carry on |
|
110 | - echo "Could not write to file ($filename)\n"; |
|
111 | - continue; |
|
112 | - } |
|
113 | - fwrite($fh, $rsstext); |
|
114 | - fclose ($fh); |
|
106 | + // Write the text to the file... |
|
107 | + $filename = $rsspath . $person_id . '.rdf'; |
|
108 | + $fh = @fopen($filename, "w"); |
|
109 | + if (!$fh) { # Problem writing, just carry on |
|
110 | + echo "Could not write to file ($filename)\n"; |
|
111 | + continue; |
|
112 | + } |
|
113 | + fwrite($fh, $rsstext); |
|
114 | + fclose ($fh); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | #print "Took " . (time()-$starttime) . " seconds\n"; |
@@ -106,7 +106,8 @@ |
||
106 | 106 | // Write the text to the file... |
107 | 107 | $filename = $rsspath . $person_id . '.rdf'; |
108 | 108 | $fh = @fopen($filename, "w"); |
109 | - if (!$fh) { # Problem writing, just carry on |
|
109 | + if (!$fh) { |
|
110 | +# Problem writing, just carry on |
|
110 | 111 | echo "Could not write to file ($filename)\n"; |
111 | 112 | continue; |
112 | 113 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // available for editing, it's accurate. |
25 | 25 | $this->_update_locked(); |
26 | 26 | |
27 | - $data = $this->_get_data_by_recent (); |
|
27 | + $data = $this->_get_data_by_recent(); |
|
28 | 28 | |
29 | 29 | $this->render($data); |
30 | 30 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $data = array(); |
99 | 99 | foreach ($q as $row) { |
100 | - $data[] = array ( |
|
100 | + $data[] = array( |
|
101 | 101 | 'report_id' => $row['report_id'], |
102 | 102 | 'comment_id' => $row['comment_id'], |
103 | 103 | 'firstname' => $row['firstname'], |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ); |
109 | 109 | } |
110 | 110 | foreach ($r as $row) { |
111 | - $data[] = array ( |
|
111 | + $data[] = array( |
|
112 | 112 | 'report_id' => $row['report_id'], |
113 | 113 | 'comment_id' => $row['comment_id'], |
114 | 114 | 'firstname' => $row['firstname'], |