@@ -1,5 +1,5 @@ discard block |
||
1 | - <?php if ( isset($mini_survey) ) { |
|
2 | - if ( $mini_survey['show'] ) { ?> |
|
1 | + <?php if (isset($mini_survey)) { |
|
2 | + if ($mini_survey['show']) { ?> |
|
3 | 3 | <form class="minisurvey" method="post" action="<?=OPTION_SURVEY_URL?>"> |
4 | 4 | <p>Did you find what you were looking for?</p> |
5 | 5 | <input type="hidden" name="sourceidentifier" value="twfy-mini-2"> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | <input type="submit" value="Submit answer"> |
19 | 19 | </form> |
20 | - <?php } else if ( $mini_survey['answered'] ) { ?> |
|
20 | + <?php } else if ($mini_survey['answered']) { ?> |
|
21 | 21 | <p>Thanks for answering</p> |
22 | 22 | <?php } ?> |
23 | 23 | <?php } ?> |
@@ -41,7 +41,7 @@ |
||
41 | 41 | <div class="row nested-row"> |
42 | 42 | <div class="homepage-in-the-news homepage-content-section"> |
43 | 43 | <?php if ( $featured ) { |
44 | - include dirname(__FILE__) . "/../homepage/featured.php"; |
|
44 | + include dirname(__FILE__) . "/../homepage/featured.php"; |
|
45 | 45 | } ?> |
46 | 46 | </div> |
47 | 47 | <div class="homepage-create-alert homepage-content-section"> |
@@ -4,10 +4,10 @@ discard block |
||
4 | 4 | <div class="hero__mp-search__wrap"> |
5 | 5 | <h1>Do your MLAs represent you?</h1> |
6 | 6 | <div class="row collapse"> |
7 | - <?php if ( count($data['regional']) > 0 ) { ?> |
|
7 | + <?php if (count($data['regional']) > 0) { ?> |
|
8 | 8 | <ul class="homepage-rep-list"> |
9 | 9 | <li>Your MLAs: </li> |
10 | - <?php foreach ( $data['regional'] as $mla ) { ?> |
|
10 | + <?php foreach ($data['regional'] as $mla) { ?> |
|
11 | 11 | <li class="homepage-rep-list__rep"><a href="/mla/?p=<?= $mla['person_id'] ?>"><?= $mla['name'] ?></a></li> |
12 | 12 | <?php } ?> |
13 | 13 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | <div class="panel panel--flushtop clearfix"> |
41 | 41 | <div class="row nested-row"> |
42 | 42 | <div class="homepage-in-the-news homepage-content-section"> |
43 | - <?php if ( $featured ) { |
|
43 | + <?php if ($featured) { |
|
44 | 44 | include dirname(__FILE__) . "/../homepage/featured.php"; |
45 | 45 | } ?> |
46 | 46 | </div> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | <div class="homepage-recently homepage-content-section"> |
86 | 86 | <h2>Recently in the Northern Ireland Assembly</h2> |
87 | 87 | <ul class="recently__list"><?php |
88 | - foreach ( $debates['recent'] as $recent ) { |
|
88 | + foreach ($debates['recent'] as $recent) { |
|
89 | 89 | include dirname(__FILE__) . '/../homepage/recent-debates.php'; |
90 | 90 | } |
91 | 91 | ?></ul> |
@@ -135,12 +135,16 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | $recess_major = 1; # For all of UK Parliament |
138 | - if ($hansardmajors[$data['info']['major']]['location'] == 'NI') |
|
139 | - $recess_major = 5; |
|
140 | - elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') |
|
141 | - $recess_major = 4; # For all of Scotland |
|
142 | - elseif ($data['info']['major'] == 101) |
|
143 | - $recess_major = 101; # Lords slightly different |
|
138 | + if ($hansardmajors[$data['info']['major']]['location'] == 'NI') { |
|
139 | + $recess_major = 5; |
|
140 | + } elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { |
|
141 | + $recess_major = 4; |
|
142 | + } |
|
143 | + # For all of Scotland |
|
144 | + elseif ($data['info']['major'] == 101) { |
|
145 | + $recess_major = 101; |
|
146 | + } |
|
147 | + # Lords slightly different |
|
144 | 148 | $recess = recess_prettify($currentDay, $month, $year, $recess_major); |
145 | 149 | |
146 | 150 | // Is this day actually Today in the real world? |
@@ -149,11 +153,15 @@ discard block |
||
149 | 153 | // sittings - e.g. WH is only Tuesday-Thursday |
150 | 154 | if ($currentDay == $toDay) { |
151 | 155 | print '<td class="on"'; |
152 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
156 | + if ($recess[0] && $recess[0]!=1) { |
|
157 | + print ' title="'.$recess[0].'"'; |
|
158 | + } |
|
153 | 159 | print '>'; |
154 | 160 | } elseif ($recess[0]) { |
155 | 161 | print '<td class="no"'; |
156 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
162 | + if ($recess[0]!=1) { |
|
163 | + print ' title="'.$recess[0].'"'; |
|
164 | + } |
|
157 | 165 | print '>'; |
158 | 166 | } else { |
159 | 167 | print '<td>'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // $data['info'] may have 'onday', a 'yyyy-mm-dd' date which indicates |
24 | 24 | // which date will be highlighted (otherwise, today is). |
25 | 25 | |
26 | -include_once INCLUDESPATH."easyparliament/recess.php"; |
|
26 | +include_once INCLUDESPATH . "easyparliament/recess.php"; |
|
27 | 27 | global $PAGE, $DATA, $this_page, $hansardmajors; |
28 | 28 | |
29 | 29 | twfy_debug("TEMPLATE", "hansard_calendar.php"); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | // Create array containing abbreviations of days of week. |
43 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
43 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
44 | 44 | |
45 | 45 | // What is the first day of the month in question? |
46 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
46 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
47 | 47 | |
48 | 48 | // How many days does this month contain? |
49 | - $numberDays = date('t',$firstDayOfMonth); |
|
49 | + $numberDays = date('t', $firstDayOfMonth); |
|
50 | 50 | |
51 | 51 | // Retrieve some information about the first day of the |
52 | 52 | // month in question. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if (isset($data['info']['onday'])) { |
61 | 61 | // 'onday' is like 'yyyy-mm-dd'. |
62 | 62 | $datebits = explode('-', $data['info']['onday']); |
63 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
63 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
64 | 64 | $toDay = $datebits[2]; |
65 | 65 | } else { |
66 | 66 | $toDay = ''; |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | // sittings - e.g. WH is only Tuesday-Thursday |
150 | 150 | if ($currentDay == $toDay) { |
151 | 151 | print '<td class="on"'; |
152 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
152 | + if ($recess[0] && $recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
153 | 153 | print '>'; |
154 | 154 | } elseif ($recess[0]) { |
155 | 155 | print '<td class="no"'; |
156 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
156 | + if ($recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
157 | 157 | print '>'; |
158 | 158 | } else { |
159 | 159 | print '<td>'; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | // Is the $currentDay a member of $dates? If so, |
163 | 163 | // the day should be linked. |
164 | - if (in_array($currentDay,$dates)) { |
|
164 | + if (in_array($currentDay, $dates)) { |
|
165 | 165 | |
166 | 166 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
167 | 167 |
@@ -61,23 +61,23 @@ |
||
61 | 61 | <?php else: ?> |
62 | 62 | <ul class="vote-descriptions"> |
63 | 63 | <?php |
64 | - $policy_ids = array(); |
|
65 | - |
|
66 | - foreach ($positions as $position) { |
|
67 | - if (!in_array($position['policy_id'], $policy_ids)) { |
|
68 | - $description = ucfirst($position['desc']); |
|
69 | - $link = sprintf( |
|
70 | - '%s/divisions?policy=%s', |
|
71 | - $member_url, |
|
72 | - $position['policy_id'] |
|
73 | - ); |
|
74 | - $show_link = $position['position'] != 'has never voted on'; |
|
75 | - $key_vote = $position; |
|
76 | - include(dirname(__DIR__) . '/mp/_vote_description.php'); |
|
77 | - |
|
78 | - $policy_ids[] = $position['policy_id']; |
|
79 | - } |
|
80 | - } ?> |
|
64 | + $policy_ids = array(); |
|
65 | + |
|
66 | + foreach ($positions as $position) { |
|
67 | + if (!in_array($position['policy_id'], $policy_ids)) { |
|
68 | + $description = ucfirst($position['desc']); |
|
69 | + $link = sprintf( |
|
70 | + '%s/divisions?policy=%s', |
|
71 | + $member_url, |
|
72 | + $position['policy_id'] |
|
73 | + ); |
|
74 | + $show_link = $position['position'] != 'has never voted on'; |
|
75 | + $key_vote = $position; |
|
76 | + include(dirname(__DIR__) . '/mp/_vote_description.php'); |
|
77 | + |
|
78 | + $policy_ids[] = $position['policy_id']; |
|
79 | + } |
|
80 | + } ?> |
|
81 | 81 | </ul> |
82 | 82 | |
83 | 83 | <?php endif; ?> |
@@ -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)) { |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | </div> |
8 | 8 | <div class="business-section__primary"> |
9 | 9 | <?php |
10 | - if ( isset($divisions) && $divisions ) { |
|
11 | - $current_date = ''; |
|
12 | - ?> |
|
10 | + if ( isset($divisions) && $divisions ) { |
|
11 | + $current_date = ''; |
|
12 | + ?> |
|
13 | 13 | <ul class="business-list"> |
14 | 14 | <?php foreach ($divisions as $division) { ?> |
15 | 15 | <li id="<?= $division['division_id'] ?>"> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <h3><?= format_date($division['date'], LONGERDATEFORMAT) ?></h3> |
19 | 19 | </span> |
20 | 20 | <?php |
21 | - $current_date = $division['date']; |
|
21 | + $current_date = $division['date']; |
|
22 | 22 | } ?> |
23 | 23 | <a href="/divisions/<?= $division['division_id'] ?>" class="business-list__title"> |
24 | 24 | <h3><?= $division['division_title'] ?></h3> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | </div> |
8 | 8 | <div class="business-section__primary"> |
9 | 9 | <?php |
10 | - if ( isset($divisions) && $divisions ) { |
|
10 | + if (isset($divisions) && $divisions) { |
|
11 | 11 | $current_date = ''; |
12 | 12 | ?> |
13 | 13 | <ul class="business-list"> |
@@ -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']); |