@@ -84,13 +84,13 @@ |
||
84 | 84 | $db->display_total_duration(); |
85 | 85 | |
86 | 86 | $duration = getmicrotime() - STARTTIME; |
87 | - twfy_debug ("TIME", "Total time for page: $duration seconds."); |
|
87 | + twfy_debug("TIME", "Total time for page: $duration seconds."); |
|
88 | 88 | if (!isset($_SERVER['WINDIR'])) { |
89 | 89 | $rusage = getrusage(); |
90 | - $duration = $rusage['ru_utime.tv_sec']*1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU; |
|
91 | - twfy_debug ('TIME', "Total user time: $duration microseconds."); |
|
92 | - $duration = $rusage['ru_stime.tv_sec']*1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES; |
|
93 | - twfy_debug ('TIME', "Total system time: $duration microseconds."); |
|
90 | + $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU; |
|
91 | + twfy_debug('TIME', "Total user time: $duration microseconds."); |
|
92 | + $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES; |
|
93 | + twfy_debug('TIME', "Total system time: $duration microseconds."); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | ?> |
@@ -31,7 +31,7 @@ |
||
31 | 31 | </li> |
32 | 32 | |
33 | 33 | <?php |
34 | -$user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; |
|
34 | +$user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; |
|
35 | 35 | if (stristr($user_agent, 'Firefox/')) { |
36 | 36 | ?> |
37 | 37 | <li>You can also add TheyWorkForYou to <a href="http://mycroft.mozdev.org/download.html?name=theyworkforyou">Firefox's search box</a>.</li> |
@@ -67,4 +67,4 @@ |
||
67 | 67 | api_output($out); |
68 | 68 | } else { |
69 | 69 | api_error('Nothing'); |
70 | - } |
|
70 | + } |
@@ -14,7 +14,9 @@ discard block |
||
14 | 14 | if (isset ($data['rows'])) { |
15 | 15 | for ($i=0; $i<count($data['rows']); $i++) { |
16 | 16 | $row = $data['rows'][$i]; |
17 | - if (count($row) == 0) continue; |
|
17 | + if (count($row) == 0) { |
|
18 | + continue; |
|
19 | + } |
|
18 | 20 | if ($row['htype'] == '12') { |
19 | 21 | if (isset($row['speaker']) && count($row['speaker']) > 0) { |
20 | 22 | $speaker = $row['speaker']; |
@@ -36,7 +38,9 @@ discard block |
||
36 | 38 | $desc .= $speaker['constituency'] . ', '; |
37 | 39 | } |
38 | 40 | $desc .= _htmlentities($speaker['party']); |
39 | - if ($desc) $row['speaker']['desc'] = $desc; |
|
41 | + if ($desc) { |
|
42 | + $row['speaker']['desc'] = $desc; |
|
43 | + } |
|
40 | 44 | } |
41 | 45 | } |
42 | 46 | $out[] = $row; |
@@ -52,8 +56,9 @@ discard block |
||
52 | 56 | $has_content = false; |
53 | 57 | } |
54 | 58 | $entry = $row; |
55 | - if (isset($row['excerpt'])) |
|
56 | - $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
59 | + if (isset($row['excerpt'])) { |
|
60 | + $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
61 | + } |
|
57 | 62 | if ($has_content) { |
58 | 63 | } else { |
59 | 64 | unset($entry['listurl']); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | $out = array(); |
14 | 14 | if (isset ($data['rows'])) { |
15 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
15 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
16 | 16 | $row = $data['rows'][$i]; |
17 | 17 | if (count($row) == 0) continue; |
18 | 18 | if ($row['htype'] == '12') { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (isset ($data['rows'])) { |
13 | 13 | $out = array(); |
14 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
14 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
15 | 15 | $row = $data['rows'][$i]; |
16 | 16 | |
17 | 17 | if ($row['htype'] == '10' && isset($row['excerpt']) && strstr($row['excerpt'], "was asked—")) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if ($row['htype'] == '10') { |
41 | 41 | $out[] = array('entry' => $entry, 'subs' => array()); |
42 | 42 | } else { |
43 | - $out[sizeof($out)-1]['subs'][] = $entry; |
|
43 | + $out[sizeof($out) - 1]['subs'][] = $entry; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | } |
@@ -27,8 +27,9 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | $entry = $row; |
30 | - if (isset($row['excerpt'])) |
|
31 | - $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
30 | + if (isset($row['excerpt'])) { |
|
31 | + $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200); |
|
32 | + } |
|
32 | 33 | if ($has_content) { |
33 | 34 | } else { |
34 | 35 | unset($entry['listurl']); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <select id="section" name="section"> |
67 | 67 | <option value="">Any |
68 | 68 | <?php |
69 | - optgroups(array( |
|
69 | + optgroups(array( |
|
70 | 70 | 'UK Parliament' => array( |
71 | 71 | 'uk' => 'All UK', |
72 | 72 | 'debates' => 'House of Commons debates', |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | 'sp' => 'Debates', |
86 | 86 | 'spwrans' => 'Written answers', |
87 | 87 | ), |
88 | - ), $section); |
|
89 | - ?> |
|
88 | + ), $section); |
|
89 | + ?> |
|
90 | 90 | </select> |
91 | 91 | <div class="help"> |
92 | 92 | Restrict results to a particular parliament or assembly that we cover (e.g. the |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if (preg_match('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', $filter_ss, $m)) { |
24 | 24 | $from = $m[1]; |
25 | 25 | $to = $m[2]; |
26 | - $filter_ss = preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss); |
|
26 | + $filter_ss = preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss); |
|
27 | 27 | } |
28 | 28 | $section = get_http_var('section'); |
29 | 29 | if (preg_match('#\s*section:([a-z]*)#', $filter_ss, $m)) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $filter_ss = preg_replace('#\s*speaker:[0-9]*#', '', $filter_ss); |
37 | 37 | } |
38 | 38 | |
39 | -$this->block_start(array( 'title' => "Filtering your results")); |
|
39 | +$this->block_start(array('title' => "Filtering your results")); |
|
40 | 40 | |
41 | 41 | ?> |
42 | 42 | <form method="get" action="/search/"> |
@@ -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"; |
@@ -210,8 +210,8 @@ |
||
210 | 210 | array(':epobject_id' => $this->epobject_id)); |
211 | 211 | |
212 | 212 | if ($q->rows() > 0) { |
213 | - // If you change stuff here, you might have to change it in |
|
214 | - // $COMMENTLIST->_get_comment_data() too... |
|
213 | + // If you change stuff here, you might have to change it in |
|
214 | + // $COMMENTLIST->_get_comment_data() too... |
|
215 | 215 | |
216 | 216 | $gid = fix_gid_from_db($q->field(0, 'gid')); // In includes/utility.php |
217 | 217 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public $body = ''; |
32 | 32 | public $posted = ''; |
33 | 33 | public $visible = false; |
34 | - public $modflagged = NULL; // Is a datetime when set. |
|
34 | + public $modflagged = null; // Is a datetime when set. |
|
35 | 35 | public $firstname = ''; // Of the person who posted it. |
36 | 36 | public $lastname = ''; |
37 | 37 | public $url = ''; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $flag = "'$date'"; |
139 | 139 | |
140 | 140 | } elseif ($switch == 'off') { |
141 | - $date = NULL; |
|
141 | + $date = null; |
|
142 | 142 | $flag = 'NULL'; |
143 | 143 | |
144 | 144 | } else { |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public $body = ''; |
32 | 32 | public $posted = ''; |
33 | 33 | public $visible = false; |
34 | - public $modflagged = NULL; // Is a datetime when set. |
|
35 | - public $firstname = ''; // Of the person who posted it. |
|
34 | + public $modflagged = NULL; // Is a datetime when set. |
|
35 | + public $firstname = ''; // Of the person who posted it. |
|
36 | 36 | public $lastname = ''; |
37 | 37 | public $url = ''; |
38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public $exists = false; |
42 | 42 | |
43 | 43 | |
44 | - public function __construct($comment_id='') { |
|
44 | + public function __construct($comment_id = '') { |
|
45 | 45 | |
46 | 46 | $this->db = new ParlDB; |
47 | 47 | |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | if ($q->rows() > 0) { |
70 | 70 | |
71 | 71 | $this->comment_id = $comment_id; |
72 | - $this->user_id = $q->field(0, 'user_id'); |
|
72 | + $this->user_id = $q->field(0, 'user_id'); |
|
73 | 73 | $this->epobject_id = $q->field(0, 'epobject_id'); |
74 | - $this->body = $q->field(0, 'body'); |
|
75 | - $this->posted = $q->field(0, 'posted'); |
|
76 | - $this->visible = $q->field(0, 'visible'); |
|
77 | - $this->modflagged = $q->field(0, 'modflagged'); |
|
74 | + $this->body = $q->field(0, 'body'); |
|
75 | + $this->posted = $q->field(0, 'posted'); |
|
76 | + $this->visible = $q->field(0, 'visible'); |
|
77 | + $this->modflagged = $q->field(0, 'modflagged'); |
|
78 | 78 | |
79 | 79 | // Sets the URL and username for this comment. Duh. |
80 | 80 | $this->_set_url(); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | public function comments_enabled() { return $this->comments_enabled; } |
105 | 105 | |
106 | 106 | |
107 | - public function display($format='html', $template='comments') { |
|
107 | + public function display($format = 'html', $template = 'comments') { |
|
108 | 108 | |
109 | - $data['comments'][0] = array ( |
|
109 | + $data['comments'][0] = array( |
|
110 | 110 | 'comment_id' => $this->comment_id, |
111 | 111 | 'user_id' => $this->user_id, |
112 | 112 | 'epobject_id' => $this->epobject_id, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $flag = 'NULL'; |
143 | 143 | |
144 | 144 | } else { |
145 | - $PAGE->error_message ("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!"); |
|
145 | + $PAGE->error_message("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!"); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $q = $this->db->query("UPDATE comments |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $this->modflagged = $date; |
155 | 155 | return true; |
156 | 156 | } else { |
157 | - $message = array ( |
|
157 | + $message = array( |
|
158 | 158 | 'title' => 'Sorry', |
159 | 159 | 'text' => "We couldn't update the annotation's modflag." |
160 | 160 | ); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if ($q->success()) { |
177 | 177 | return true; |
178 | 178 | } else { |
179 | - $message = array ( |
|
179 | + $message = array( |
|
180 | 180 | 'title' => 'Sorry', |
181 | 181 | 'text' => "We were unable to delete the annotation." |
182 | 182 | ); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | } else { |
188 | - $message = array ( |
|
188 | + $message = array( |
|
189 | 189 | 'title' => 'Sorry', |
190 | 190 | 'text' => "You are not authorised to delete annotations." |
191 | 191 | ); |
@@ -362,12 +362,13 @@ discard block |
||
362 | 362 | } else { |
363 | 363 | $from = "$year-7-" . $dates[$year][7]['more']; |
364 | 364 | } |
365 | - if (!isset($dates[$year][9])) |
|
366 | - $to = "$year-08-31"; |
|
367 | - elseif (isset($dates[$year][9]['all'])) |
|
368 | - $to = "$year-10-" . $dates[$year][10]['less']; |
|
369 | - else |
|
370 | - $to = "$year-9-" . $dates[$year][9]['less']; |
|
365 | + if (!isset($dates[$year][9])) { |
|
366 | + $to = "$year-08-31"; |
|
367 | + } elseif (isset($dates[$year][9]['all'])) { |
|
368 | + $to = "$year-10-" . $dates[$year][10]['less']; |
|
369 | + } else { |
|
370 | + $to = "$year-9-" . $dates[$year][9]['less']; |
|
371 | + } |
|
371 | 372 | } |
372 | 373 | if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
373 | 374 | || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) |
@@ -375,11 +376,17 @@ discard block |
||
375 | 376 | || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) { |
376 | 377 | switch ($month) { |
377 | 378 | case 1: case 12: $recess = 'Christmas Recess'; break; |
378 | - case 2: if ($body==1 || $body==101) $recess = 'Half Term Week'; |
|
379 | - elseif ($body==4) $recess = 'February Recess'; |
|
379 | + case 2: if ($body==1 || $body==101) { |
|
380 | + $recess = 'Half Term Week'; |
|
381 | + } elseif ($body==4) { |
|
382 | + $recess = 'February Recess'; |
|
383 | + } |
|
380 | 384 | break; |
381 | - case 3: if ($body==1 || $body==101) $recess = 'Easter Recess'; |
|
382 | - elseif ($body==4) $recess = 'Spring Recess'; |
|
385 | + case 3: if ($body==1 || $body==101) { |
|
386 | + $recess = 'Easter Recess'; |
|
387 | + } elseif ($body==4) { |
|
388 | + $recess = 'Spring Recess'; |
|
389 | + } |
|
383 | 390 | break; |
384 | 391 | case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
385 | 392 | $recess = 'Election Recess'; |
@@ -417,9 +424,13 @@ discard block |
||
417 | 424 | trigger_error("Argh9"); |
418 | 425 | } |
419 | 426 | break; |
420 | - case 10: if ($body==1 || $body==101) $recess = 'Conference Recess'; |
|
421 | - elseif ($body==4) $recess = 'Autumn Recess'; |
|
422 | - elseif ($body==5) $recess = 'Halloween Recess'; |
|
427 | + case 10: if ($body==1 || $body==101) { |
|
428 | + $recess = 'Conference Recess'; |
|
429 | + } elseif ($body==4) { |
|
430 | + $recess = 'Autumn Recess'; |
|
431 | + } elseif ($body==5) { |
|
432 | + $recess = 'Halloween Recess'; |
|
433 | + } |
|
423 | 434 | break; |
424 | 435 | case 11: $recess = 'Autumn Recess'; |
425 | 436 | break; |
@@ -427,9 +438,9 @@ discard block |
||
427 | 438 | } |
428 | 439 | if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
429 | 440 | $to = "$year-$month-" . $dates[$year][$month]['less']; |
430 | - if ($month==1) |
|
431 | - $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
432 | - else { |
|
441 | + if ($month==1) { |
|
442 | + $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
443 | + } else { |
|
433 | 444 | for ($newmonth = $month-1; $newmonth>=1; $newmonth--) { |
434 | 445 | if (isset($dates[$year][$newmonth]['more'])) { |
435 | 446 | $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more']; |
@@ -440,9 +451,9 @@ discard block |
||
440 | 451 | } |
441 | 452 | if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
442 | 453 | $from = "$year-$month-" . $dates[$year][$month]['more']; |
443 | - if ($month==12) |
|
444 | - $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
445 | - else { |
|
454 | + if ($month==12) { |
|
455 | + $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
456 | + } else { |
|
446 | 457 | for ($newmonth = $month+1; $newmonth<=12; $newmonth++) { |
447 | 458 | if (isset($dates[$year][$newmonth]['less'])) { |
448 | 459 | $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less']; |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | ), |
13 | 13 | 2001 => array( |
14 | 14 | 1=>array('less'=>8), |
15 | - 2=>array('between'=>array(15,26)), |
|
16 | - 4=>array('between'=>array(10,23)), |
|
15 | + 2=>array('between'=>array(15, 26)), |
|
16 | + 4=>array('between'=>array(10, 23)), |
|
17 | 17 | 5=>array('more'=>13), |
18 | 18 | 6=>array('less'=>13), |
19 | 19 | 7=>array('more'=>20), |
20 | 20 | 8=>array('all'=>1), |
21 | 21 | 9=>array('less'=>14, 'more'=>14), |
22 | - 10=>array('less'=>4, 'between'=>array(4,8, 8,15)), |
|
22 | + 10=>array('less'=>4, 'between'=>array(4, 8, 8, 15)), |
|
23 | 23 | 12=>array('more'=>19) ), |
24 | 24 | 2002 => array( |
25 | 25 | 1=>array('less'=>8), |
26 | - 2=>array('between'=>array(14,25)), |
|
26 | + 2=>array('between'=>array(14, 25)), |
|
27 | 27 | 3=>array('more'=>26), |
28 | - 4=>array('less'=>3, 'between'=>array(3,10)), |
|
28 | + 4=>array('less'=>3, 'between'=>array(3, 10)), |
|
29 | 29 | 5=>array('more'=>24), |
30 | 30 | 6=>array('less'=>10), |
31 | 31 | 7=>array('more'=>24), |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | 12=>array('more'=>19) ), |
36 | 36 | 2003 => array( |
37 | 37 | 1=>array('less'=>7), |
38 | - 2=>array('between'=>array(13,24)), |
|
39 | - 4=>array('between'=>array(14,28)), |
|
38 | + 2=>array('between'=>array(13, 24)), |
|
39 | + 4=>array('between'=>array(14, 28)), |
|
40 | 40 | 5=>array('more'=>22), |
41 | 41 | 6=>array('less'=>3), |
42 | 42 | 7=>array('more'=>17), |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | 12=>array('more'=>18)), |
47 | 47 | 2004 => array( |
48 | 48 | 1=>array('less'=>5), |
49 | - 2=>array('between'=>array(12,23)), |
|
50 | - 4=>array('between'=>array(1,19)), |
|
49 | + 2=>array('between'=>array(12, 23)), |
|
50 | + 4=>array('between'=>array(1, 19)), |
|
51 | 51 | 5=>array('more'=>27), |
52 | 52 | 6=>array('less'=>7), |
53 | 53 | 7=>array('more'=>22), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 12=>array('more'=>21) ), |
58 | 58 | 2005 => array( |
59 | 59 | 1=>array('less'=>10), |
60 | - 2=>array('between'=>array(10,21)), |
|
60 | + 2=>array('between'=>array(10, 21)), |
|
61 | 61 | 3=>array('more'=>24), |
62 | 62 | 4=>array('less'=>4, 'more'=>10), |
63 | 63 | 5=>array('less'=>11, 'more'=>26), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 12=>array('more'=>20) ), |
70 | 70 | 2006 => array( |
71 | 71 | 1=>array('less'=>9), |
72 | - 2=>array('between'=>array(16,27)), |
|
72 | + 2=>array('between'=>array(16, 27)), |
|
73 | 73 | 3=>array('more'=>30), |
74 | 74 | 4=>array('less'=>18), |
75 | 75 | 5=>array('more'=>25), |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ), |
83 | 83 | 2007 => array( |
84 | 84 | 1=>array('less'=>8), |
85 | - 2=>array('between'=>array(8,19)), |
|
85 | + 2=>array('between'=>array(8, 19)), |
|
86 | 86 | 3=>array('more'=>29), |
87 | 87 | 4=>array('less'=>16), |
88 | 88 | 5=>array('more'=>24), |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | ), |
96 | 96 | 2008 => array( |
97 | 97 | 1=>array('less'=>7), |
98 | - 2=>array('between'=>array(7,18)), |
|
99 | - 4=>array('between'=>array(3,21)), |
|
98 | + 2=>array('between'=>array(7, 18)), |
|
99 | + 4=>array('between'=>array(3, 21)), |
|
100 | 100 | 5=>array('more'=>22), |
101 | 101 | 6=>array('less'=>2), |
102 | 102 | 7=>array('more'=>22), |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | ), |
108 | 108 | 2009 => array( |
109 | 109 | 1=>array('less'=>12), |
110 | - 2=>array('between'=>array(12,23)), |
|
111 | - 4=>array('between'=>array(2,20)), |
|
110 | + 2=>array('between'=>array(12, 23)), |
|
111 | + 4=>array('between'=>array(2, 20)), |
|
112 | 112 | 5=>array('more'=>21), |
113 | 113 | 6=>array('less'=>1), |
114 | 114 | 7=>array('more'=>21), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ), |
120 | 120 | 2010 => array( |
121 | 121 | 1=>array('less'=>5), |
122 | - 2=>array('between'=>array(10,22)), |
|
122 | + 2=>array('between'=>array(10, 22)), |
|
123 | 123 | 3=>array('more'=>30), |
124 | 124 | 4=>array('less'=>6, 'more'=>8), |
125 | 125 | 5=>array('less'=>18, 'more'=>27), |
@@ -132,62 +132,62 @@ discard block |
||
132 | 132 | ), |
133 | 133 | 2011 => array( |
134 | 134 | 1=>array('less'=>10), |
135 | - 2=>array('between'=>array(17,28)), |
|
136 | - 4=>array('between'=>array(5,26)), |
|
135 | + 2=>array('between'=>array(17, 28)), |
|
136 | + 4=>array('between'=>array(5, 26)), |
|
137 | 137 | 5=>array('more'=>24), |
138 | 138 | 6=>array('less'=>7), |
139 | 139 | 7=>array('more'=>19), |
140 | 140 | 8=>array('all'=>1), |
141 | 141 | 9=>array('less'=>5, 'more'=>15), |
142 | 142 | 10=>array('less'=>10), |
143 | - 11=>array('between'=>array(15,21)), |
|
143 | + 11=>array('between'=>array(15, 21)), |
|
144 | 144 | 12=>array('more'=>20), |
145 | 145 | ), |
146 | 146 | 2012 => array( |
147 | 147 | 1=>array('less'=>10), |
148 | - 2=>array('between'=>array(9,20)), |
|
148 | + 2=>array('between'=>array(9, 20)), |
|
149 | 149 | 3=>array('more'=>27), |
150 | 150 | 4=>array('less'=>16), |
151 | 151 | 5=>array('more'=>24), |
152 | 152 | 6=>array('less'=>11), |
153 | 153 | 7=>array('more'=>17), |
154 | 154 | 8=>array('all'=>1), |
155 | - 9=>array('less'=>3,'more'=>18), |
|
155 | + 9=>array('less'=>3, 'more'=>18), |
|
156 | 156 | 10=>array('less'=>15), |
157 | - 11=>array('between'=>array(13,19)), |
|
157 | + 11=>array('between'=>array(13, 19)), |
|
158 | 158 | 12=>array('more'=>20) |
159 | 159 | ), |
160 | 160 | 2013 => array( |
161 | 161 | 1=>array('less'=>7), |
162 | - 2=>array('between'=>array(14,25)), |
|
162 | + 2=>array('between'=>array(14, 25)), |
|
163 | 163 | 3=>array('more'=>26), |
164 | 164 | 4=>array('less'=>15), |
165 | 165 | 5=>array('more'=>21), |
166 | 166 | 6=>array('less'=>3), |
167 | 167 | 7=>array('more'=>18), |
168 | 168 | 8=>array('all'=>1), |
169 | - 9=>array('less'=>2,'more'=>13), |
|
169 | + 9=>array('less'=>2, 'more'=>13), |
|
170 | 170 | 10=>array('less'=>8), |
171 | - 11=>array('between'=>array(12,18)), |
|
171 | + 11=>array('between'=>array(12, 18)), |
|
172 | 172 | 12=>array('more'=>19) |
173 | 173 | ), |
174 | 174 | 2014 => array( |
175 | 175 | 1=>array('less'=>6), |
176 | - 2=>array('between'=>array(13,24)), |
|
177 | - 4=>array('between'=>array(10,28)), |
|
178 | - 5=>array('between'=>array(1,6)) |
|
176 | + 2=>array('between'=>array(13, 24)), |
|
177 | + 4=>array('between'=>array(10, 28)), |
|
178 | + 5=>array('between'=>array(1, 6)) |
|
179 | 179 | ), |
180 | 180 | 2015 => array( |
181 | 181 | 7=>array('more'=>21), |
182 | 182 | 8=>array('all'=>1), |
183 | 183 | 9=>array('less'=>7, 'more'=>17), |
184 | 184 | 10=>array('less'=>12), |
185 | - 11=>array('between'=>array(10,16)), |
|
185 | + 11=>array('between'=>array(10, 16)), |
|
186 | 186 | 12=>array('more'=>17) |
187 | 187 | ), |
188 | 188 | 2016 => array( |
189 | 189 | 1=>array('less'=>5), |
190 | - 2=>array('between'=>array(11,22)) |
|
190 | + 2=>array('between'=>array(11, 22)) |
|
191 | 191 | ) |
192 | 192 | ); |
193 | 193 | # Lords differences |
@@ -199,15 +199,15 @@ discard block |
||
199 | 199 | $GLOBALS['recessdates'][101][2010][12]['more'] = 22; |
200 | 200 | $GLOBALS['recessdates'][101][2011] = array( |
201 | 201 | 1 => array('less'=>10), |
202 | - 2 => array('between'=>array(16,28)), |
|
203 | - 4 => array('between'=>array(6,26)), |
|
202 | + 2 => array('between'=>array(16, 28)), |
|
203 | + 4 => array('between'=>array(6, 26)), |
|
204 | 204 | 5 => array('more'=>25), |
205 | 205 | 6 => array('less'=>6), |
206 | 206 | 7 => array('more'=>20), |
207 | 207 | 8 => array('all'=>1), |
208 | 208 | 9 => array('less'=>5, 'more'=>15), |
209 | 209 | 10 => array('less'=>3), |
210 | - 11=>array('between'=>array(16,21)), |
|
210 | + 11=>array('between'=>array(16, 21)), |
|
211 | 211 | 12 => array('more'=>21), |
212 | 212 | ); |
213 | 213 | |
@@ -216,74 +216,74 @@ discard block |
||
216 | 216 | 1999 => array( |
217 | 217 | 7 => array('more' => 2), |
218 | 218 | 8 => array('less' => 31), |
219 | - 10 => array('between' => array(8,25)), |
|
219 | + 10 => array('between' => array(8, 25)), |
|
220 | 220 | 12 => array('more' => 17) |
221 | 221 | ), |
222 | 222 | 2000 => array( |
223 | 223 | 1 => array('less' => 10), |
224 | - 4 => array('between' => array(7,25)), |
|
224 | + 4 => array('between' => array(7, 25)), |
|
225 | 225 | 7 => array('more' => 7), |
226 | 226 | 8 => array('all' => 1), |
227 | 227 | 9 => array('less' => 4), |
228 | - 10 => array('between' => array(6,23)), |
|
228 | + 10 => array('between' => array(6, 23)), |
|
229 | 229 | 12 => array('more' => 20) |
230 | 230 | ), |
231 | 231 | 2001 => array( |
232 | 232 | 1=>array('less'=>8), |
233 | - 2=>array('between'=>array(16,26)), |
|
234 | - 4=>array('between'=>array(6,23)), |
|
233 | + 2=>array('between'=>array(16, 26)), |
|
234 | + 4=>array('between'=>array(6, 23)), |
|
235 | 235 | 6=>array('more'=>29), |
236 | 236 | 7=>array('all'=>1), |
237 | 237 | 8=>array('all'=>1), |
238 | 238 | 9=>array('less'=>3), |
239 | - 10=>array('between'=>array(5,22)), |
|
239 | + 10=>array('between'=>array(5, 22)), |
|
240 | 240 | 12=>array('more'=>21) ), |
241 | 241 | 2002 => array( |
242 | 242 | 1=>array('less'=>7), |
243 | - 2=>array('between'=>array(15,25)), |
|
243 | + 2=>array('between'=>array(15, 25)), |
|
244 | 244 | 3=>array('more'=>28), |
245 | 245 | 4=>array('less'=>15), |
246 | 246 | 7=>array('more'=>10), |
247 | 247 | 8=>array('all'=>1), |
248 | 248 | 9=>array('less'=>2), |
249 | - 10=>array('between'=>array(11,28)), |
|
249 | + 10=>array('between'=>array(11, 28)), |
|
250 | 250 | 12=>array('more'=>20) ), |
251 | 251 | 2003 => array( |
252 | 252 | 1=>array('less'=>6), |
253 | - 4=>array('between'=>array(0,31)), |
|
253 | + 4=>array('between'=>array(0, 31)), |
|
254 | 254 | 5=>array('less'=>2), |
255 | 255 | 6=>array('more'=>27), |
256 | 256 | 7=>array('all'=>1), |
257 | 257 | 8=>array('all'=>1), |
258 | - 10=>array('between'=>array(10,27)), |
|
258 | + 10=>array('between'=>array(10, 27)), |
|
259 | 259 | 12=>array('more'=>19)), |
260 | 260 | 2004 => array( |
261 | 261 | 1=>array('less'=>5), |
262 | - 2=>array('between'=>array(13,23)), |
|
263 | - 4=>array('between'=>array(2,19)), |
|
262 | + 2=>array('between'=>array(13, 23)), |
|
263 | + 4=>array('between'=>array(2, 19)), |
|
264 | 264 | 6=>array('more'=>25), |
265 | 265 | 7=>array('all'=>1), |
266 | 266 | 8=>array('less'=>30), |
267 | - 10=>array('between'=>array(10,23)), |
|
267 | + 10=>array('between'=>array(10, 23)), |
|
268 | 268 | 12=>array('more'=>26) ), |
269 | 269 | 2005 => array( |
270 | 270 | 1=>array('less'=>8), |
271 | - 2=>array('between'=>array(11,21)), |
|
271 | + 2=>array('between'=>array(11, 21)), |
|
272 | 272 | 3=>array('more'=>24), |
273 | 273 | 4=>array('less'=>11), |
274 | 274 | 7=>array('more'=>1), |
275 | 275 | 8=>array('all'=>1), |
276 | 276 | 9=>array('less'=>5), |
277 | - 10=>array('between'=>array(7,24)), |
|
277 | + 10=>array('between'=>array(7, 24)), |
|
278 | 278 | 12=>array('more'=>23) ), |
279 | 279 | 2006 => array( |
280 | 280 | 1=>array('less'=>9), |
281 | - 2=>array('between'=>array(10,20)), |
|
281 | + 2=>array('between'=>array(10, 20)), |
|
282 | 282 | 4=>array('less'=>18), |
283 | 283 | 7=>array('more'=>0), |
284 | 284 | 8=>array('all'=>1), |
285 | 285 | 9=>array('less'=>4), |
286 | - 10=>array('between'=>array(6,23)), |
|
286 | + 10=>array('between'=>array(6, 23)), |
|
287 | 287 | 12=>array('more'=>22), |
288 | 288 | ), |
289 | 289 | 2007 => array( |
@@ -293,18 +293,18 @@ discard block |
||
293 | 293 | 7=>array('all'=>1), |
294 | 294 | 8=>array('all'=>1), |
295 | 295 | 9=>array('less'=>3), |
296 | - 10=>array('between'=>array(5,22)), |
|
296 | + 10=>array('between'=>array(5, 22)), |
|
297 | 297 | 12=>array('more'=>21), |
298 | 298 | ), |
299 | 299 | 2008 => array( |
300 | 300 | 1=>array('less'=>5), |
301 | - 2=>array('between'=>array(8,18)), |
|
301 | + 2=>array('between'=>array(8, 18)), |
|
302 | 302 | 3=>array('more'=>28), |
303 | 303 | 4=>array('less'=>14), |
304 | 304 | 6=>array('more'=>27), |
305 | 305 | 7=>array('all'=>1), |
306 | 306 | 8=>array('all'=>1), |
307 | - 10=>array('between'=>array(10,27)), |
|
307 | + 10=>array('between'=>array(10, 27)), |
|
308 | 308 | ), |
309 | 309 | ); |
310 | 310 | |
@@ -369,39 +369,39 @@ discard block |
||
369 | 369 | else |
370 | 370 | $to = "$year-9-" . $dates[$year][9]['less']; |
371 | 371 | } |
372 | - if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
372 | + if ((isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) |
|
373 | 373 | || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) |
374 | 374 | || (isset($dates[$year][$month]['between']) && $day > $dates[$year][$month]['between'][0] && $day < $dates[$year][$month]['between'][1]) |
375 | - || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) { |
|
375 | + || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3])) { |
|
376 | 376 | switch ($month) { |
377 | 377 | case 1: case 12: $recess = 'Christmas Recess'; break; |
378 | - case 2: if ($body==1 || $body==101) $recess = 'Half Term Week'; |
|
379 | - elseif ($body==4) $recess = 'February Recess'; |
|
378 | + case 2: if ($body == 1 || $body == 101) $recess = 'Half Term Week'; |
|
379 | + elseif ($body == 4) $recess = 'February Recess'; |
|
380 | 380 | break; |
381 | - case 3: if ($body==1 || $body==101) $recess = 'Easter Recess'; |
|
382 | - elseif ($body==4) $recess = 'Spring Recess'; |
|
381 | + case 3: if ($body == 1 || $body == 101) $recess = 'Easter Recess'; |
|
382 | + elseif ($body == 4) $recess = 'Spring Recess'; |
|
383 | 383 | break; |
384 | 384 | case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
385 | 385 | $recess = 'Election Recess'; |
386 | - } elseif ($body==4 && $year==2003) { |
|
386 | + } elseif ($body == 4 && $year == 2003) { |
|
387 | 387 | $recess = 'Election Recess'; |
388 | - } elseif ($body==1 || $body==101) { |
|
388 | + } elseif ($body == 1 || $body == 101) { |
|
389 | 389 | $recess = 'Easter Recess'; |
390 | - } elseif ($body==4) { |
|
390 | + } elseif ($body == 4) { |
|
391 | 391 | $recess = 'Spring Recess'; |
392 | 392 | } |
393 | 393 | break; |
394 | - case 5: if ($year==2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
394 | + case 5: if ($year == 2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) { |
|
395 | 395 | $recess = 'Election Recess'; |
396 | 396 | } else { |
397 | 397 | $recess = 'Whit Recess'; |
398 | 398 | } |
399 | 399 | break; |
400 | - case 6: if ($year==2001) { |
|
400 | + case 6: if ($year == 2001) { |
|
401 | 401 | $recess = 'Election Recess'; |
402 | - } elseif ($body==1 || $body==101) { |
|
402 | + } elseif ($body == 1 || $body == 101) { |
|
403 | 403 | $recess = 'Whit Recess'; |
404 | - } elseif ($body==4) { |
|
404 | + } elseif ($body == 4) { |
|
405 | 405 | $recess = 'Summer Recess'; |
406 | 406 | } else { |
407 | 407 | trigger_error("Argh6"); |
@@ -411,15 +411,15 @@ discard block |
||
411 | 411 | break; |
412 | 412 | case 9: if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
413 | 413 | $recess = 'Summer Recess'; |
414 | - } elseif ($body==1 || $body==101) { |
|
414 | + } elseif ($body == 1 || $body == 101) { |
|
415 | 415 | $recess = 'Conference Recess'; |
416 | 416 | } else { |
417 | 417 | trigger_error("Argh9"); |
418 | 418 | } |
419 | 419 | break; |
420 | - case 10: if ($body==1 || $body==101) $recess = 'Conference Recess'; |
|
421 | - elseif ($body==4) $recess = 'Autumn Recess'; |
|
422 | - elseif ($body==5) $recess = 'Halloween Recess'; |
|
420 | + case 10: if ($body == 1 || $body == 101) $recess = 'Conference Recess'; |
|
421 | + elseif ($body == 4) $recess = 'Autumn Recess'; |
|
422 | + elseif ($body == 5) $recess = 'Halloween Recess'; |
|
423 | 423 | break; |
424 | 424 | case 11: $recess = 'Autumn Recess'; |
425 | 425 | break; |
@@ -427,12 +427,12 @@ discard block |
||
427 | 427 | } |
428 | 428 | if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) { |
429 | 429 | $to = "$year-$month-" . $dates[$year][$month]['less']; |
430 | - if ($month==1) |
|
431 | - $from = ($year-1)."-12-" . $dates[$year-1][12]['more']; |
|
430 | + if ($month == 1) |
|
431 | + $from = ($year - 1) . "-12-" . $dates[$year - 1][12]['more']; |
|
432 | 432 | else { |
433 | - for ($newmonth = $month-1; $newmonth>=1; $newmonth--) { |
|
433 | + for ($newmonth = $month - 1; $newmonth >= 1; $newmonth--) { |
|
434 | 434 | if (isset($dates[$year][$newmonth]['more'])) { |
435 | - $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more']; |
|
435 | + $from = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['more']; |
|
436 | 436 | break; |
437 | 437 | } |
438 | 438 | } |
@@ -440,12 +440,12 @@ discard block |
||
440 | 440 | } |
441 | 441 | if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) { |
442 | 442 | $from = "$year-$month-" . $dates[$year][$month]['more']; |
443 | - if ($month==12) |
|
444 | - $to = ($year+1)."-01-" . $dates[$year+1][1]['less']; |
|
443 | + if ($month == 12) |
|
444 | + $to = ($year + 1) . "-01-" . $dates[$year + 1][1]['less']; |
|
445 | 445 | else { |
446 | - for ($newmonth = $month+1; $newmonth<=12; $newmonth++) { |
|
446 | + for ($newmonth = $month + 1; $newmonth <= 12; $newmonth++) { |
|
447 | 447 | if (isset($dates[$year][$newmonth]['less'])) { |
448 | - $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less']; |
|
448 | + $to = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['less']; |
|
449 | 449 | break; |
450 | 450 | } |
451 | 451 | } |
@@ -114,7 +114,10 @@ discard block |
||
114 | 114 | // 'foot' - For the bottom stripe on hansard debates/wrans listings. |
115 | 115 | // $id is the value of an id for this div (if blank, not used). |
116 | 116 | ?> |
117 | - <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' ' . $extra_class; ?>"<?php |
|
117 | + <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') { |
|
118 | + echo ' ' . $extra_class; |
|
119 | +} |
|
120 | +?>"<?php |
|
118 | 121 | if ($id != '') { |
119 | 122 | print ' id="' . $id . '"'; |
120 | 123 | } |
@@ -479,7 +482,9 @@ discard block |
||
479 | 482 | |
480 | 483 | global $DATA, $this_page; |
481 | 484 | |
482 | - if ($this->page_started()) return; |
|
485 | + if ($this->page_started()) { |
|
486 | + return; |
|
487 | + } |
|
483 | 488 | // The page's HTML hasn't been started yet, so we'd better do it. |
484 | 489 | |
485 | 490 | // Set the page title (in the <title></title>). |
@@ -629,7 +634,9 @@ discard block |
||
629 | 634 | $URL->insert(array('adv' => 1)); |
630 | 635 | echo ' <a href="' . $URL->generate() . '">More options</a>'; |
631 | 636 | echo '<br>'; |
632 | - if ($wtt) print '<input type="hidden" name="wtt" value="1">'; |
|
637 | + if ($wtt) { |
|
638 | + print '<input type="hidden" name="wtt" value="1">'; |
|
639 | + } |
|
633 | 640 | } else { ?> |
634 | 641 | <form action="http://www.writetothem.com/lords" method="get"> |
635 | 642 | <input type="hidden" name="pid" value="<?=_htmlentities(get_http_var('pid')) ?>"> |
@@ -753,8 +760,7 @@ discard block |
||
753 | 760 | // The return url for after the user has logged in. |
754 | 761 | if (get_http_var("ret") != "") { |
755 | 762 | $returl = get_http_var("ret"); |
756 | - } |
|
757 | - else { |
|
763 | + } else { |
|
758 | 764 | $returl = $glossary_returl; |
759 | 765 | } |
760 | 766 | ?> |
@@ -803,15 +809,13 @@ discard block |
||
803 | 809 | else { |
804 | 810 | $letters[] = "<li class=\"on\">" . $letter . "</li>"; |
805 | 811 | } |
806 | - } |
|
807 | - elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
812 | + } elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
808 | 813 | $URL = new URL('glossary'); |
809 | 814 | $URL->insert(array('az' => $letter)); |
810 | 815 | $letter_link = $URL->generate('url'); |
811 | 816 | |
812 | 817 | $letters[] = "<li><a href=\"" . $letter_link . "\">" . $letter . "</a></li>"; |
813 | - } |
|
814 | - else { |
|
818 | + } else { |
|
815 | 819 | $letters[] = '<li>' . $letter . '</li>'; |
816 | 820 | } |
817 | 821 | } |
@@ -851,8 +855,7 @@ discard block |
||
851 | 855 | $URL->insert(array("delete_confirm" => $term['glossary_id'])); |
852 | 856 | $delete_url = $URL->generate(); |
853 | 857 | $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>"; |
854 | - } |
|
855 | - else { |
|
858 | + } else { |
|
856 | 859 | $admin_links = ""; |
857 | 860 | } |
858 | 861 | |
@@ -862,8 +865,7 @@ discard block |
||
862 | 865 | $user_link = $URL->generate('url'); |
863 | 866 | |
864 | 867 | $user_details = "\t\t\t\t<p><small>contributed by user <a href=\"" . $user_link . "\">" . $term['firstname'] . " " . $term['lastname'] . "</a></small>" . $admin_links . "</p>\n"; |
865 | - } |
|
866 | - else { |
|
868 | + } else { |
|
867 | 869 | $user_details = ""; |
868 | 870 | } |
869 | 871 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public $within_stripe_sidebar = false; |
20 | 20 | |
21 | 21 | public function page_start() { |
22 | - if ( !$this->page_started() ) { |
|
22 | + if (!$this->page_started()) { |
|
23 | 23 | $this->checkForAdmin(); |
24 | 24 | $this->displayHeader(); |
25 | 25 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $data = $h->data; |
34 | 34 | $data = array_merge($u->data, $data); |
35 | - if ( isset($page_errors) ) { |
|
35 | + if (isset($page_errors)) { |
|
36 | 36 | $data['page_errors'] = $page_errors; |
37 | 37 | } |
38 | 38 | $data['banner_text'] = ''; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $THISPAGE = new URL($this_page); |
53 | 53 | |
54 | 54 | $LOGINURL = new URL('userlogin'); |
55 | - $LOGINURL->insert(array('ret' => $THISPAGE->generate('none') )); |
|
55 | + $LOGINURL->insert(array('ret' => $THISPAGE->generate('none'))); |
|
56 | 56 | |
57 | 57 | $text = "<a href=\"" . $LOGINURL->generate() . "\">You'd better sign in!</a>"; |
58 | 58 | } else { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | public function page_end() { |
70 | - if ( !$this->page_started() ) { |
|
70 | + if (!$this->page_started()) { |
|
71 | 71 | $this->page_start(); |
72 | 72 | } |
73 | 73 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - public function stripe_start($type='side', $id='', $extra_class = '') { |
|
104 | + public function stripe_start($type = 'side', $id = '', $extra_class = '') { |
|
105 | 105 | // $type is one of: |
106 | 106 | // 'full' - a full width div |
107 | 107 | // 'side' - a white stripe with a coloured sidebar. |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | - public function stripe_end ($contents = array(), $extra = '') { |
|
134 | + public function stripe_end($contents = array(), $extra = '') { |
|
135 | 135 | // $contents is an array containing 0 or more hashes. |
136 | 136 | // Each hash has two values, 'type' and 'content'. |
137 | 137 | // 'Type' could be one of these: |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public function include_sidebar_template($sidebarname) { |
235 | 235 | global $this_page, $DATA; |
236 | 236 | |
237 | - $sidebarpath = INCLUDESPATH.'easyparliament/sidebars/'.$sidebarname.'.php'; |
|
237 | + $sidebarpath = INCLUDESPATH . 'easyparliament/sidebars/' . $sidebarname . '.php'; |
|
238 | 238 | |
239 | 239 | if (file_exists($sidebarpath)) { |
240 | 240 | include $sidebarpath; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | |
245 | - public function block_start($data=array()) { |
|
245 | + public function block_start($data = array()) { |
|
246 | 246 | // Starts a 'block' div, used mostly on the home page, |
247 | 247 | // on the MP page, and in the sidebars. |
248 | 248 | // $data is a hash like this: |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | if (is_string($message)) { |
390 | 390 | // Sometimes we're just sending a single line to this function |
391 | 391 | // rather like the bigger array... |
392 | - $message = array ( |
|
392 | + $message = array( |
|
393 | 393 | 'text' => $message |
394 | 394 | ); |
395 | 395 | } |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | // if the page has started then we're most likely in an old school page |
398 | 398 | // so we should just print out the error, otherwise stick it in the error |
399 | 399 | // global which will then be displayed by the header template |
400 | - if ( $this->page_started() ) { |
|
400 | + if ($this->page_started()) { |
|
401 | 401 | $this->message($message, 'error'); |
402 | 402 | } else { |
403 | - if ( !isset($page_errors) ) { |
|
403 | + if (!isset($page_errors)) { |
|
404 | 404 | $page_errors = array(); |
405 | 405 | } |
406 | - $page_errors[] = $message; |
|
406 | + $page_errors[] = $message; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if ($fatal) { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | |
423 | - public function message($message, $class='') { |
|
423 | + public function message($message, $class = '') { |
|
424 | 424 | // Generates a very simple but common page content. |
425 | 425 | // Used for when a user logs out, or votes, or any simple thing |
426 | 426 | // where there's a little message and probably a link elsewhere. |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | if ($page_title != '') { |
499 | 499 | $page_title .= ': '; |
500 | 500 | } |
501 | - $page_title .= format_date ($info['date'], SHORTDATEFORMAT); |
|
501 | + $page_title .= format_date($info['date'], SHORTDATEFORMAT); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | if ($page_title != '') { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | |
554 | 554 | if (isset($nextprev['up'])) { |
555 | 555 | |
556 | - $uplink = '<span class="up"><a href="' . $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>'; |
|
556 | + $uplink = '<span class="up"><a href="' . $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>'; |
|
557 | 557 | if (get_http_var('s')) { |
558 | 558 | $URL = new URL($this_page); |
559 | 559 | $uplink .= '<br><a href="' . $URL->generate() . '">Remove highlighting</a>'; |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | $next = $nextprev['next']; |
569 | 569 | |
570 | 570 | if (isset($next['url'])) { |
571 | - $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' »</a>'; |
|
571 | + $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' »</a>'; |
|
572 | 572 | } else { |
573 | 573 | $nextlink = $next['body'] . ' »'; |
574 | 574 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | } |
586 | 586 | |
587 | 587 | |
588 | - public function search_form($value='') { |
|
588 | + public function search_form($value = '') { |
|
589 | 589 | global $SEARCHENGINE; |
590 | 590 | // Search box on the search page. |
591 | 591 | // If $value is set then it will be displayed in the form. |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | } |
616 | 616 | |
617 | 617 | echo '<div class="mainsearchbox">'; |
618 | - if ($wtt<2) { |
|
618 | + if ($wtt < 2) { |
|
619 | 619 | echo '<form action="', $URL->generate(), '" method="get">'; |
620 | 620 | if (get_http_var('o')) { |
621 | 621 | echo '<input type="hidden" name="o" value="', _htmlentities(get_http_var('o')), '">'; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | echo '<input type="hidden" name="house" value="', _htmlentities(get_http_var('house')), '">'; |
625 | 625 | } |
626 | 626 | echo '<input type="text" name="q" value="', _htmlentities($value), '" size="50"> '; |
627 | - echo '<input type="submit" value=" ', ($wtt?'Modify search':'Search'), ' ">'; |
|
627 | + echo '<input type="submit" value=" ', ($wtt ? 'Modify search' : 'Search'), ' ">'; |
|
628 | 628 | $URL = new URL('search'); |
629 | 629 | $URL->insert(array('adv' => 1)); |
630 | 630 | echo ' <a href="' . $URL->generate() . '">More options</a>'; |
@@ -646,16 +646,16 @@ discard block |
||
646 | 646 | $ordering = 'd'; |
647 | 647 | } |
648 | 648 | |
649 | - if ($ordering=='r') { |
|
649 | + if ($ordering == 'r') { |
|
650 | 650 | print '<strong>Sorted by relevance</strong>'; |
651 | 651 | } else { |
652 | 652 | printf("<a href='%s'>Sort by relevance</a>", $orderUrl->generate('html', array('o'=>'r'))); |
653 | 653 | } |
654 | 654 | |
655 | 655 | print " | "; |
656 | - if ($ordering=='d') { |
|
656 | + if ($ordering == 'd') { |
|
657 | 657 | print '<strong>Sorted by date: newest</strong> / <a href="' . $orderUrl->generate('html', array('o'=>'o')) . '">oldest</a>'; |
658 | - } elseif ($ordering=='o') { |
|
658 | + } elseif ($ordering == 'o') { |
|
659 | 659 | print '<strong>Sorted by date:</strong> <a href="' . $orderUrl->generate('html', array('o'=>'d')) . '">newest</a> / <strong>oldest</strong>'; |
660 | 660 | } else { |
661 | 661 | printf("Sort by date: <a href='%s'>newest</a> / <a href='%s'>oldest</a>", |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | print " | "; |
666 | - if ($ordering=='p') { |
|
666 | + if ($ordering == 'p') { |
|
667 | 667 | print '<strong>Use by person</strong>'; |
668 | 668 | } else { |
669 | 669 | printf('<a href="%s">Show use by person</a>', $orderUrl->generate('html', array('o'=>'p'))); |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | include_once INCLUDESPATH . 'easyparliament/templates/html/search_advanced.php'; |
688 | 688 | } |
689 | 689 | |
690 | - public function login_form ($errors = array()) { |
|
690 | + public function login_form($errors = array()) { |
|
691 | 691 | // Used for /user/login/ and /user/prompt/ |
692 | 692 | // $errors is a hash of potential errors from a previous log in attempt. |
693 | 693 | ?> |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | public function glossary_atoz(&$GLOSSARY) { |
792 | 792 | // Print out a nice list of lettered links to glossary pages |
793 | 793 | |
794 | - $letters = array (); |
|
794 | + $letters = array(); |
|
795 | 795 | |
796 | 796 | foreach ($GLOSSARY->alphabet as $letter => $eps) { |
797 | 797 | // if we're writing out the current letter (list or item) |
@@ -824,14 +824,14 @@ discard block |
||
824 | 824 | <div class="letters"> |
825 | 825 | <ul> |
826 | 826 | <?php |
827 | - for ($n=0; $n<13; $n++) { |
|
827 | + for ($n = 0; $n < 13; $n++) { |
|
828 | 828 | print $letters[$n]; |
829 | 829 | } |
830 | 830 | ?> |
831 | 831 | </ul> |
832 | 832 | <ul> |
833 | 833 | <?php |
834 | - for ($n=13; $n<26; $n++) { |
|
834 | + for ($n = 13; $n < 26; $n++) { |
|
835 | 835 | print $letters[$n]; |
836 | 836 | } |
837 | 837 | ?> |
@@ -850,12 +850,12 @@ discard block |
||
850 | 850 | |
851 | 851 | // add some extra controls for the administrators |
852 | 852 | if ($this_page == "admin_glossary") { |
853 | - print "<a id=\"gl".$term['glossary_id']."\"></a>"; |
|
853 | + print "<a id=\"gl" . $term['glossary_id'] . "\"></a>"; |
|
854 | 854 | print "<h3>" . $term['title'] . "</h3>"; |
855 | 855 | $URL = new URL('admin_glossary'); |
856 | 856 | $URL->insert(array("delete_confirm" => $term['glossary_id'])); |
857 | 857 | $delete_url = $URL->generate(); |
858 | - $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>"; |
|
858 | + $admin_links = "<br><small><a href=\"" . $delete_url . "\">delete</a></small>"; |
|
859 | 859 | } |
860 | 860 | else { |
861 | 861 | $admin_links = ""; |
@@ -878,9 +878,9 @@ discard block |
||
878 | 878 | // Add a direct search link for current glossary item |
879 | 879 | $URL = new URL('search'); |
880 | 880 | // remember to quote the term for phrase matching in search |
881 | - $URL->insert(array('s' => '"'.$term['title'].'"')); |
|
881 | + $URL->insert(array('s' => '"' . $term['title'] . '"')); |
|
882 | 882 | $search_url = $URL->generate(); |
883 | - printf ("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']); |
|
883 | + printf("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']); |
|
884 | 884 | } |
885 | 885 | } |
886 | 886 | |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | |
956 | 956 | // Generate all the page links. |
957 | 957 | $URL = new URL($this_page); |
958 | - $URL->insert( array('wtt' => get_http_var('wtt')) ); |
|
958 | + $URL->insert(array('wtt' => get_http_var('wtt'))); |
|
959 | 959 | if (isset($pagedata['s'])) { |
960 | 960 | # XXX: Should be taken out in *one* place, not here + search_form etc. |
961 | 961 | $value = $pagedata['s']; |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | |
1094 | 1094 | $body = trim_characters($report['body'], 0, 40); |
1095 | 1095 | |
1096 | - $tabledata['rows'][] = array ( |
|
1096 | + $tabledata['rows'][] = array( |
|
1097 | 1097 | _htmlentities($report['firstname'] . ' ' . $report['lastname']), |
1098 | 1098 | _htmlentities($body), |
1099 | 1099 | $report['reported'], |
@@ -1124,13 +1124,13 @@ discard block |
||
1124 | 1124 | // $page is the name of the page the dates should link to. |
1125 | 1125 | |
1126 | 1126 | // Create array containing abbreviations of days of week. |
1127 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
1127 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
1128 | 1128 | |
1129 | 1129 | // What is the first day of the month in question? |
1130 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
1130 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
1131 | 1131 | |
1132 | 1132 | // How many days does this month contain? |
1133 | - $numberDays = date('t',$firstDayOfMonth); |
|
1133 | + $numberDays = date('t', $firstDayOfMonth); |
|
1134 | 1134 | |
1135 | 1135 | // Retrieve some information about the first day of the |
1136 | 1136 | // month in question. |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | |
1212 | 1212 | // Is the $currentDay a member of $dateArray? If so, |
1213 | 1213 | // the day should be linked. |
1214 | - if (in_array($currentDay,$dateArray)) { |
|
1214 | + if (in_array($currentDay, $dateArray)) { |
|
1215 | 1215 | |
1216 | 1216 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
1217 | 1217 | |
@@ -1312,8 +1312,8 @@ discard block |
||
1312 | 1312 | // Returns HTML suitable for putting in the sidebar on Admin pages. |
1313 | 1313 | global $this_page, $DATA; |
1314 | 1314 | |
1315 | - $pages = array ('admin_home', |
|
1316 | - 'admin_comments','admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches', |
|
1315 | + $pages = array('admin_home', |
|
1316 | + 'admin_comments', 'admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches', |
|
1317 | 1317 | 'alert_stats', 'admin_statistics', 'admin_reportstats', |
1318 | 1318 | 'admin_commentreports', 'admin_glossary', 'admin_glossary_pending', 'admin_badusers', |
1319 | 1319 | 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_featured', 'admin_topics' |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | $hansardmajors[104] = $hansardmajors[4]; |
126 | 126 | |
127 | -$parties = array ( |
|
127 | +$parties = array( |
|
128 | 128 | 'Bp' => 'Bishop', |
129 | 129 | 'Con' => 'Conservative', |
130 | 130 | 'CWM' => 'Deputy Speaker', |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | */ |
167 | 167 | |
168 | 168 | // Constants for various house types |
169 | -define ('HOUSE_TYPE_ROYAL', 0); |
|
170 | -define ('HOUSE_TYPE_COMMONS', 1); |
|
171 | -define ('HOUSE_TYPE_LORDS', 2); |
|
172 | -define ('HOUSE_TYPE_NI', 3); |
|
173 | -define ('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | -define ('HOUSE_TYPE_WALES', 5); |
|
169 | +define('HOUSE_TYPE_ROYAL', 0); |
|
170 | +define('HOUSE_TYPE_COMMONS', 1); |
|
171 | +define('HOUSE_TYPE_LORDS', 2); |
|
172 | +define('HOUSE_TYPE_NI', 3); |
|
173 | +define('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | +define('HOUSE_TYPE_WALES', 5); |