@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | // $Id: authed.php,v 1.1 2006-05-26 08:44:46 matthew Exp $ |
10 | 10 | |
11 | 11 | include_once '../../includes/easyparliament/init.php'; |
12 | -include_once INCLUDESPATH . '../../commonlib/phplib/auth.php'; |
|
12 | +include_once INCLUDESPATH.'../../commonlib/phplib/auth.php'; |
|
13 | 13 | |
14 | 14 | header("Content-Type: text/plain"); |
15 | 15 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $db = new ParlDB; |
24 | 24 | $q = $db->query('select alert_id from alerts where email = :email and criteria = :criteria and confirmed and not deleted', array( |
25 | 25 | ':email' => $email, |
26 | - ':criteria' => 'speaker:' . $pid |
|
26 | + ':criteria' => 'speaker:'.$pid |
|
27 | 27 | )); |
28 | 28 | $already_signed = $q->rows(); |
29 | 29 | if ($already_signed) |
@@ -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 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $new_style_template = TRUE; |
4 | 4 | |
5 | 5 | include_once '../../includes/easyparliament/init.php'; |
6 | -include_once INCLUDESPATH . 'easyparliament/member.php'; |
|
6 | +include_once INCLUDESPATH.'easyparliament/member.php'; |
|
7 | 7 | |
8 | 8 | $alert = new MySociety\TheyWorkForYou\AlertView\Standard($THEUSER); |
9 | 9 | $data = $alert->display($THEUSER); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$new_style_template = TRUE; |
|
3 | +$new_style_template = true; |
|
4 | 4 | |
5 | 5 | include_once '../../includes/easyparliament/init.php'; |
6 | 6 | include_once INCLUDESPATH . 'easyparliament/member.php'; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $searchstring = filter_user_input($searchstring, 'strict'); |
21 | 21 | $searchspeaker = trim(get_http_var('pid')); |
22 | 22 | if ($searchspeaker) { |
23 | - $searchstring .= " speaker:" . $searchspeaker; |
|
23 | + $searchstring .= " speaker:".$searchspeaker; |
|
24 | 24 | } |
25 | 25 | $searchmajor = trim(get_http_var('section')); |
26 | 26 | if (!$searchmajor) { |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | $searchmajor = trim(get_http_var('maj')); |
29 | 29 | } |
30 | 30 | if ($searchmajor) { |
31 | - $searchstring .= " section:" . $searchmajor; |
|
31 | + $searchstring .= " section:".$searchmajor; |
|
32 | 32 | } |
33 | 33 | $searchgroupby = trim(get_http_var('groupby')); |
34 | 34 | if ($searchgroupby) { |
35 | - $searchstring .= " groupby:" . $searchgroupby; |
|
35 | + $searchstring .= " groupby:".$searchgroupby; |
|
36 | 36 | } // We have only one of these, rather than one in HANSARDLIST also |
37 | 37 | global $SEARCHENGINE; |
38 | 38 | $SEARCHENGINE = new SEARCHENGINE($searchstring); |
39 | 39 | |
40 | - $pagetitle = "Search: " . $SEARCHENGINE->query_description_short(); |
|
40 | + $pagetitle = "Search: ".$SEARCHENGINE->query_description_short(); |
|
41 | 41 | |
42 | 42 | $pagenum = get_http_var('p'); |
43 | 43 | if (is_numeric($pagenum) && $pagenum > 1) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $DATA->set_page_metadata($this_page, 'title', $pagetitle); |
51 | 51 | |
52 | - $args = array ( |
|
52 | + $args = array( |
|
53 | 53 | 's' => $searchstring, |
54 | 54 | 'p' => $pagenum, |
55 | 55 | 'pop' => 1, |
@@ -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 |
@@ -3,8 +3,8 @@ |
||
3 | 3 | $new_style_template = TRUE; |
4 | 4 | |
5 | 5 | include_once '../../includes/easyparliament/init.php'; |
6 | -include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
7 | -include_once INCLUDESPATH . 'easyparliament/member.php'; |
|
6 | +include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
7 | +include_once INCLUDESPATH.'easyparliament/member.php'; |
|
8 | 8 | |
9 | 9 | if (!DEVSITE) { |
10 | 10 | header('Cache-Control: max-age=900'); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$new_style_template = TRUE; |
|
3 | +$new_style_template = true; |
|
4 | 4 | |
5 | 5 | include_once '../../includes/easyparliament/init.php'; |
6 | 6 | include_once INCLUDESPATH . "easyparliament/glossary.php"; |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | |
3 | 3 | $this_page = 'hansard_bugs'; |
4 | 4 | include_once '../../includes/easyparliament/init.php'; |
5 | -$DATA->set_page_metadata($this_page, 'heading','Official Hansard problems'); |
|
5 | +$DATA->set_page_metadata($this_page, 'heading', 'Official Hansard problems'); |
|
6 | 6 | |
7 | 7 | $PAGE->page_start(); |
8 | 8 | $PAGE->stripe_start(); |
9 | 9 | |
10 | -$PAGE->block_start(array ('title'=>'Things currently noticeable to the user')); |
|
10 | +$PAGE->block_start(array('title'=>'Things currently noticeable to the user')); |
|
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <style type="text/css"> |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | <?php |
112 | 112 | $PAGE->block_end(); |
113 | -$PAGE->block_start(array ('title'=>'Things not noticeable to the user')); |
|
113 | +$PAGE->block_start(array('title'=>'Things not noticeable to the user')); |
|
114 | 114 | ?> |
115 | 115 | |
116 | 116 | <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=3 and section_id=0 |
17 | 17 | and hdate>(select max(hdate) from hansard where major=3) - interval 7 day |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
26 | - print '<h2>' . _htmlspecialchars(ucwords($dept)) . '</h2>'; |
|
26 | + print '<h2>'._htmlspecialchars(ucwords($dept)).'</h2>'; |
|
27 | 27 | print '<h3>Written Questions from the past week</h3>'; |
28 | 28 | $q = $db->query('select gid,body from hansard,epobject |
29 | 29 | where hansard.epobject_id=epobject.epobject_id and major=3 and subsection_id=0 |
30 | - and section_id in (' . join(',', $ids) . ') |
|
30 | + and section_id in (' . join(',', $ids).') |
|
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wrans/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wrans/?id='.fix_gid_from_db($q->field($i, 'gid')).'">'.$q->field($i, '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 |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
26 | - print '<h2>' . _htmlspecialchars(ucwords($dept)) . '</h2>'; |
|
26 | + print '<h2>'._htmlspecialchars(ucwords($dept)).'</h2>'; |
|
27 | 27 | print '<h3>Written Ministerial Statements from the past week</h3>'; |
28 | 28 | $q = $db->query('select gid,body from hansard,epobject |
29 | 29 | where hansard.epobject_id=epobject.epobject_id and major=4 and subsection_id=0 |
30 | - and section_id in (' . join(',', $ids) . ') |
|
30 | + and section_id in (' . join(',', $ids).') |
|
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wms/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wms/?id='.fix_gid_from_db($q->field($i, 'gid')).'">'.$q->field($i, 'body').'</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | group by body, major |
17 | 17 | order by body'); |
18 | 18 | $data = array(); |
19 | -for ($i=0; $i<$q->rows(); $i++) { |
|
19 | +for ($i = 0; $i < $q->rows(); $i++) { |
|
20 | 20 | $body = $q->field($i, 'body'); |
21 | 21 | $major = $q->field($i, 'major'); |
22 | 22 | $data[$body][$major] = true; |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | |
27 | 27 | print '<ul>'; |
28 | 28 | foreach ($data as $body => $arr) { |
29 | - $link = strtolower(str_replace(' ','_',$body)); |
|
29 | + $link = strtolower(str_replace(' ', '_', $body)); |
|
30 | 30 | print '<li>'; |
31 | 31 | print $body; |
32 | 32 | print ' — '; |
33 | 33 | if (isset($arr[3])) { |
34 | 34 | print '<a href="'.$link.'/questions">Written Questions</a>'; |
35 | 35 | } |
36 | - if (count($arr)==2) |
|
36 | + if (count($arr) == 2) |
|
37 | 37 | print ' | '; |
38 | 38 | if (isset($arr[4])) { |
39 | 39 | print '<a href="'.$link.'/statements">Written Ministerial Statements</a>'; |
@@ -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 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
4 | +include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
5 | 5 | |
6 | 6 | $this_page = "debate"; |
7 | 7 | $this_page = "debates"; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $q = $db->query("select gid from hansard where htype in (10,11) and major=1 and hdate='$date' order by rand() limit 1"); |
15 | 15 | $gid = $q->field(0, 'gid'); |
16 | 16 | |
17 | -$args = array ( |
|
17 | +$args = array( |
|
18 | 18 | 'gid' => fix_gid_from_db($gid), |
19 | 19 | 'sort' => 'regexp_replace', |
20 | 20 | ); |