@@ -22,14 +22,14 @@ |
||
22 | 22 | |
23 | 23 | <div class="business-section__primary"> |
24 | 24 | <ul class="business-list"> |
25 | - <?php foreach ( $content['data'] as $date => $bills ) { ?> |
|
25 | + <?php foreach ($content['data'] as $date => $bills) { ?> |
|
26 | 26 | <li> |
27 | 27 | <span class="business-list__title"> |
28 | 28 | <h3> |
29 | 29 | <?= $date ?> |
30 | 30 | </h3> |
31 | 31 | </span> |
32 | - <?php foreach ( $bills as $bill ) { ?> |
|
32 | + <?php foreach ($bills as $bill) { ?> |
|
33 | 33 | <p> |
34 | 34 | <a href="<?= $bill['url'] ?>" class="business-list__title"> |
35 | 35 | <?= $bill['bill'] ?> – <?= $bill['sitting'] ?> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | foreach ( $calendar as $year => $months ) { |
3 | 3 | foreach ($months as $month => $dates) { |
4 | - include '_calendar.php'; |
|
4 | + include '_calendar.php'; |
|
5 | 5 | } |
6 | 6 | } ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - foreach ( $calendar as $year => $months ) { |
|
2 | + foreach ($calendar as $year => $months) { |
|
3 | 3 | foreach ($months as $month => $dates) { |
4 | 4 | include '_calendar.php'; |
5 | 5 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <a href="<?= $item['list_url'] ?>" class="business-list__title"> |
2 | 2 | <h3> |
3 | - <?php if ( isset( $item['parent'] ) ) { ?> |
|
3 | + <?php if (isset($item['parent'])) { ?> |
|
4 | 4 | <?= $item['parent']['body'] ?> |
5 | 5 | <br><?= $item['body'] ?> |
6 | 6 | <?php } else { ?> |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | </h3> |
10 | 10 | <span class="business-list__meta"> |
11 | 11 | <?= format_date($item['hdate'], LONGERDATEFORMAT) ?> |
12 | - <?= isset($item['contentcount']) ? '· ' . $item['contentcount'] . ( $item['contentcount'] == 1 ? ' speech' : ' speeches' ) : '' ?> |
|
12 | + <?= isset($item['contentcount']) ? '· '.$item['contentcount'].($item['contentcount'] == 1 ? ' speech' : ' speeches') : '' ?> |
|
13 | 13 | </span> |
14 | 14 | </a> |
15 | -<?php if ( isset( $item['child'] ) ) { ?> |
|
15 | +<?php if (isset($item['child'])) { ?> |
|
16 | 16 | <p class="business-list__excerpt"> |
17 | - <?php if ( isset($item['child']['speaker']) && count($item['child']['speaker']) > 0 ) { ?> |
|
17 | + <?php if (isset($item['child']['speaker']) && count($item['child']['speaker']) > 0) { ?> |
|
18 | 18 | <a href="<?= $item['child']['speaker']['url'] ?>"><?= $item['child']['speaker']['name'] ?></a> |
19 | 19 | <?php } ?> |
20 | - <?= strip_tags(trim_characters( $item['child']['body'], 0, 200 )) ?> |
|
20 | + <?= strip_tags(trim_characters($item['child']['body'], 0, 200)) ?> |
|
21 | 21 | </p> |
22 | 22 | <?php } ?> |
@@ -32,8 +32,8 @@ |
||
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <?php } else { |
35 | - $section = false; include '_section_content.php'; |
|
36 | - } ?> |
|
35 | + $section = false; include '_section_content.php'; |
|
36 | + } ?> |
|
37 | 37 | |
38 | 38 | </div> |
39 | 39 |
@@ -19,11 +19,11 @@ |
||
19 | 19 | </div> |
20 | 20 | <div class="full-page"> |
21 | 21 | |
22 | - <?php if ( count($data['rows']) == 0 ) { ?> |
|
22 | + <?php if (count($data['rows']) == 0) { ?> |
|
23 | 23 | <div class="debate-speech"> |
24 | 24 | <div class="full-page__row"> |
25 | 25 | <div class="full-page__unit"> |
26 | - <?php if ( $col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND' ) { ?> |
|
26 | + <?php if ($col_country == 'SCOTLAND' || $col_country == 'NORTHERN IRELAND') { ?> |
|
27 | 27 | We only have information about columns for debates in the House of Commons and the House of Lords. |
28 | 28 | <?php } else { ?> |
29 | 29 | We can't find anything in column <?= $column ?> on <?= $debate_day_human ?>. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ($dayOfWeek < 0) { |
42 | 42 | $dayOfWeek = 6; |
43 | 43 | } |
44 | - ?> |
|
44 | + ?> |
|
45 | 45 | <?php } |
46 | 46 | if (!isset($years)) { ?> |
47 | 47 | <div class="calendar__controls"> |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } else { |
128 | 128 | $day_section = $section; |
129 | 129 | if ($section == 'sp') { |
130 | - $day_section = 'spdebates'; |
|
130 | + $day_section = 'spdebates'; |
|
131 | 131 | } |
132 | 132 | $urls[$day_section . 'day']->insert(array('d'=>$date)); |
133 | 133 | print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>"; |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | - <?php if(isset($month)){ |
|
3 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
2 | + <?php if (isset($month)) { |
|
3 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
4 | 4 | |
5 | 5 | // What is the first day of the month in question? |
6 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
6 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
7 | 7 | |
8 | 8 | // How many days does this month contain? |
9 | - $numberDays = date('t',$firstDayOfMonth); |
|
9 | + $numberDays = date('t', $firstDayOfMonth); |
|
10 | 10 | |
11 | 11 | // Retrieve some information about the first day of the |
12 | 12 | // month in question. |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (isset($info['onday'])) { |
19 | 19 | // 'onday' is like 'yyyy-mm-dd'. |
20 | 20 | $datebits = explode('-', $info['onday']); |
21 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
21 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
22 | 22 | $toDay = $datebits[2]; |
23 | 23 | } else { |
24 | 24 | $toDay = ''; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <?php } |
46 | 46 | if (!isset($years)) { ?> |
47 | 47 | <div class="calendar__controls"> |
48 | - <?php if ( isset($prev) ) { ?> |
|
48 | + <?php if (isset($prev)) { ?> |
|
49 | 49 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
50 | 50 | <?php } else { ?> |
51 | 51 | <span class="calendar__controls__previous"> </span> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <span class="calendar__controls__current"> |
54 | 54 | <?= $monthName ?> <?= $year ?> |
55 | 55 | </span> |
56 | - <?php if ( isset($next) ) { ?> |
|
56 | + <?php if (isset($next)) { ?> |
|
57 | 57 | <a href="<?= $next['url'] ?>" class="calendar__controls__next">→</a> |
58 | 58 | <?php } else { ?> |
59 | 59 | <span class="calendar__controls__next"> </span> |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | // sittings - e.g. WH is only Tuesday-Thursday |
107 | 107 | if ($currentDay == $toDay) { |
108 | 108 | print '<td class="on"'; |
109 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] && $recess[0] != 1) print ' title="'.$recess[0].'"'; |
|
110 | 110 | print '>'; |
111 | 111 | } elseif ($recess[0]) { |
112 | 112 | print '<td class="no"'; |
113 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
113 | + if ($recess[0] != 1) print ' title="'.$recess[0].'"'; |
|
114 | 114 | print '>'; |
115 | 115 | } else { |
116 | 116 | print '<td>'; |
@@ -118,26 +118,26 @@ discard block |
||
118 | 118 | |
119 | 119 | // Is the $currentDay a member of $dates? If so, |
120 | 120 | // the day should be linked. |
121 | - if (in_array($currentDay,$dates)) { |
|
121 | + if (in_array($currentDay, $dates)) { |
|
122 | 122 | |
123 | 123 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
124 | 124 | |
125 | 125 | if ($currentDay == $toDay) { |
126 | - print '<span>' . $currentDay . '</span></td>'; |
|
126 | + print '<span>'.$currentDay.'</span></td>'; |
|
127 | 127 | } else { |
128 | 128 | $day_section = $section; |
129 | 129 | if ($section == 'sp') { |
130 | 130 | $day_section = 'spdebates'; |
131 | 131 | } |
132 | - $urls[$day_section . 'day']->insert(array('d'=>$date)); |
|
133 | - print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>"; |
|
132 | + $urls[$day_section.'day']->insert(array('d'=>$date)); |
|
133 | + print "<a href=\"".$urls[$day_section.'day']->generate()."\">$currentDay</a></td>"; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // $currentDay is not a member of $dates. |
137 | 137 | |
138 | 138 | } else { |
139 | 139 | |
140 | - print '<span>' . $currentDay . '</span></td>'; |
|
140 | + print '<span>'.$currentDay.'</span></td>'; |
|
141 | 141 | } |
142 | 142 | // Increment counters |
143 | 143 | |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | </tr> |
157 | 157 | </tbody> |
158 | 158 | </table> |
159 | - <?php if(!isset($years)){ ?> |
|
159 | + <?php if (!isset($years)) { ?> |
|
160 | 160 | <div class="calendar__footer"> |
161 | 161 | <?php |
162 | 162 | $y = $urls['day']; |
163 | 163 | $y->reset(); |
164 | - $y->insert(array( 'y' => $year )); |
|
164 | + $y->insert(array('y' => $year)); |
|
165 | 165 | $url = $y->generate(); |
166 | 166 | ?> |
167 | 167 | <a href="<?= $url ?>">See all of <?= $year ?></a> |
@@ -106,11 +106,15 @@ |
||
106 | 106 | // sittings - e.g. WH is only Tuesday-Thursday |
107 | 107 | if ($currentDay == $toDay) { |
108 | 108 | print '<td class="on"'; |
109 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
109 | + if ($recess[0] && $recess[0]!=1) { |
|
110 | + print ' title="'.$recess[0].'"'; |
|
111 | + } |
|
110 | 112 | print '>'; |
111 | 113 | } elseif ($recess[0]) { |
112 | 114 | print '<td class="no"'; |
113 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
115 | + if ($recess[0]!=1) { |
|
116 | + print ' title="'.$recess[0].'"'; |
|
117 | + } |
|
114 | 118 | print '>'; |
115 | 119 | } else { |
116 | 120 | print '<td>'; |
@@ -6,24 +6,24 @@ |
||
6 | 6 | </div> |
7 | 7 | |
8 | 8 | <?php |
9 | - if ( isset($content['data']['data']) ) { |
|
9 | + if (isset($content['data']['data'])) { |
|
10 | 10 | $data = $content['data']['data']; |
11 | 11 | include '_business_list.php'; ?> |
12 | 12 | <div class="business-section__secondary"> |
13 | 13 | <div class="business-section__what-is-this"> |
14 | 14 | <h3>What is this?</h3> |
15 | - <?php include '_' . $section . '_desc.php'; ?> |
|
15 | + <?php include '_'.$section.'_desc.php'; ?> |
|
16 | 16 | </div> |
17 | 17 | <?php |
18 | 18 | $calendar = $content['calendar']['years']; |
19 | 19 | include '_calendar_section.php'; |
20 | - if ( !isset($no_survey) ) { |
|
21 | - include( dirname(__FILE__) . '/../sidebar/looking_for.php' ); |
|
20 | + if (!isset($no_survey)) { |
|
21 | + include(dirname(__FILE__).'/../sidebar/looking_for.php'); |
|
22 | 22 | } |
23 | 23 | ?> |
24 | - <?php if ( isset($content['rssurl']) ) { ?> |
|
24 | + <?php if (isset($content['rssurl'])) { ?> |
|
25 | 25 | <p class="rss-feed"> |
26 | - <a href="<?= WEBPATH . $content['rssurl'] ?>">RSS feed of <?= $title ?></a> |
|
26 | + <a href="<?= WEBPATH.$content['rssurl'] ?>">RSS feed of <?= $title ?></a> |
|
27 | 27 | </p> |
28 | 28 | <?php } ?> |
29 | 29 | </div> |
@@ -24,29 +24,29 @@ discard block |
||
24 | 24 | <ul class="business-list"> |
25 | 25 | <?php |
26 | 26 | $first = 0; |
27 | - foreach ( $content['rows'] as $row ) { |
|
28 | - if ( $row['htype'] == 10 ) { |
|
29 | - if ( !$first ) { |
|
27 | + foreach ($content['rows'] as $row) { |
|
28 | + if ($row['htype'] == 10) { |
|
29 | + if (!$first) { |
|
30 | 30 | print '</li>'; |
31 | 31 | $first = 1; |
32 | 32 | } ?> |
33 | 33 | <li> |
34 | - <a <?= isset($row['sitting']) ? 'id="sitting' . $row['sitting'] . '" ' : '' ?>href="<?= $row['listurl'] ?>" class="business-list__title"> |
|
34 | + <a <?= isset($row['sitting']) ? 'id="sitting'.$row['sitting'].'" ' : '' ?>href="<?= $row['listurl'] ?>" class="business-list__title"> |
|
35 | 35 | <h3> |
36 | 36 | <?= $row['body'] ?> |
37 | 37 | </h3> |
38 | 38 | </a> |
39 | 39 | <p class="business-list__meta"> |
40 | - <?php if ( isset($row['sitting']) ) { ?> |
|
40 | + <?php if (isset($row['sitting'])) { ?> |
|
41 | 41 | <?= make_ranking($row['sitting']) ?> sitting · |
42 | 42 | <?php } ?> |
43 | - <?= format_date($row['hdate'], LONGERDATEFORMAT ) ?> |
|
44 | - <?php if ( $row['contentcount'] > 0 ) { ?> |
|
45 | - · <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?> |
|
43 | + <?= format_date($row['hdate'], LONGERDATEFORMAT) ?> |
|
44 | + <?php if ($row['contentcount'] > 0) { ?> |
|
45 | + · <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'].' speeches' ?> |
|
46 | 46 | <?php } ?> |
47 | 47 | </p> |
48 | 48 | <p class="business-list__excerpt"> |
49 | - <?= trim_characters($row['excerpt'], 0, 200 ) ?> |
|
49 | + <?= trim_characters($row['excerpt'], 0, 200) ?> |
|
50 | 50 | </p> |
51 | 51 | <?php } else { ?> |
52 | 52 | <ul> |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | </a> |
59 | 59 | <?php if (isset($row['contentcount'])) { ?> |
60 | 60 | <p class="business-list__meta"> |
61 | - <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?> |
|
61 | + <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'].' speeches' ?> |
|
62 | 62 | </p> |
63 | 63 | <?php } ?> |
64 | - <?php if ( isset($row['excerpt']) ) { ?> |
|
64 | + <?php if (isset($row['excerpt'])) { ?> |
|
65 | 65 | <p class="business-list__excerpt"> |
66 | 66 | <?= trim_characters($row['excerpt'], 0, 200) ?> |
67 | 67 | </p> |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | </ul> |
74 | 74 | </div> |
75 | 75 | |
76 | - <?php if ( isset($content['info']['committee']) ) { |
|
76 | + <?php if (isset($content['info']['committee'])) { |
|
77 | 77 | $committee = $content['info']['committee']; |
78 | 78 | ?> |
79 | 79 | <div class="business-section__secondary"> |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | |
86 | 86 | <p><strong>Chairpersons</strong></p> |
87 | 87 | <ul> |
88 | - <?php foreach( $committee['chairmen'] as $chair ) { ?> |
|
88 | + <?php foreach ($committee['chairmen'] as $chair) { ?> |
|
89 | 89 | <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li> |
90 | 90 | <?php } ?> |
91 | 91 | </ul> |
92 | 92 | <p><strong>Members</strong></p> |
93 | 93 | <ul> |
94 | - <?php foreach( $committee['members'] as $chair ) { ?> |
|
94 | + <?php foreach ($committee['members'] as $chair) { ?> |
|
95 | 95 | <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li> |
96 | 96 | <?php } ?> |
97 | 97 | </ul> |
@@ -49,7 +49,7 @@ |
||
49 | 49 | <?php } ?> |
50 | 50 | </a> |
51 | 51 | <?php } |
52 | - if ( isset($row['excerpt']) ) { ?> |
|
52 | + if ( isset($row['excerpt']) ) { ?> |
|
53 | 53 | <p class="business-list__excerpt"> |
54 | 54 | <?= trim_characters($row['excerpt'], 0, 200 ) ?> |
55 | 55 | </p> |
@@ -6,32 +6,32 @@ discard block |
||
6 | 6 | <?= $parent_title ?> |
7 | 7 | </h1> |
8 | 8 | <p class="business-section__header__date"> |
9 | - <?= format_date( $info['date'], LONGERDATEFORMAT ) ?> |
|
9 | + <?= format_date($info['date'], LONGERDATEFORMAT) ?> |
|
10 | 10 | </p> |
11 | 11 | </div> |
12 | - <?php if ( isset($rows) ) { ?> |
|
12 | + <?php if (isset($rows)) { ?> |
|
13 | 13 | <div class="business-section__primary"> |
14 | 14 | <ul class="business-list"> |
15 | 15 | <?php |
16 | 16 | $prevlevel = ''; |
17 | - foreach ( $rows as $row ) { ?> |
|
18 | - <?php if ( $row['htype'] == 10 ) { |
|
19 | - if ( $prevlevel == 'sub' ) { ?> |
|
17 | + foreach ($rows as $row) { ?> |
|
18 | + <?php if ($row['htype'] == 10) { |
|
19 | + if ($prevlevel == 'sub') { ?> |
|
20 | 20 | </ul> |
21 | 21 | </li> |
22 | - <?php } elseif ( $prevlevel == 'top' ) { ?> |
|
22 | + <?php } elseif ($prevlevel == 'top') { ?> |
|
23 | 23 | </li> |
24 | 24 | <?php } ?> |
25 | 25 | <li> |
26 | 26 | <?php } else { |
27 | - if ( $prevlevel == '' ) { ?> |
|
27 | + if ($prevlevel == '') { ?> |
|
28 | 28 | <li> |
29 | - <?php } elseif ( $prevlevel == 'top' ) { ?> |
|
29 | + <?php } elseif ($prevlevel == 'top') { ?> |
|
30 | 30 | <ul> |
31 | 31 | <li> |
32 | 32 | <?php } ?> |
33 | 33 | <?php } ?> |
34 | - <?php if ( isset($row['excerpt']) && strstr($row['excerpt'], "was asked—") ) { ?> |
|
34 | + <?php if (isset($row['excerpt']) && strstr($row['excerpt'], "was asked—")) { ?> |
|
35 | 35 | <div class="business-list__title"> |
36 | 36 | <h3> |
37 | 37 | <?= $row['body'] ?> |
@@ -42,26 +42,26 @@ discard block |
||
42 | 42 | <h3> |
43 | 43 | <?= $row['body'] ?> |
44 | 44 | </h3> |
45 | - <?php if ( isset($row['contentcount']) && $row['contentcount'] > 0 ) { ?> |
|
45 | + <?php if (isset($row['contentcount']) && $row['contentcount'] > 0) { ?> |
|
46 | 46 | <span class="business-list__meta"> |
47 | - <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?> |
|
47 | + <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'].' speeches' ?> |
|
48 | 48 | </span> |
49 | 49 | <?php } ?> |
50 | 50 | </a> |
51 | 51 | <?php } |
52 | - if ( isset($row['excerpt']) ) { ?> |
|
52 | + if (isset($row['excerpt'])) { ?> |
|
53 | 53 | <p class="business-list__excerpt"> |
54 | - <?= trim_characters($row['excerpt'], 0, 200 ) ?> |
|
54 | + <?= trim_characters($row['excerpt'], 0, 200) ?> |
|
55 | 55 | </p> |
56 | 56 | <?php } ?> |
57 | - <?php if ( $row['htype'] == 10 ) { |
|
57 | + <?php if ($row['htype'] == 10) { |
|
58 | 58 | $prevlevel = 'top'; |
59 | 59 | } else { |
60 | 60 | $prevlevel = 'sub'; ?> |
61 | 61 | </li> |
62 | 62 | <?php } ?> |
63 | 63 | <?php } ?> |
64 | - <?php if ( $prevlevel == 'sub' ) { ?> |
|
64 | + <?php if ($prevlevel == 'sub') { ?> |
|
65 | 65 | </ul> |
66 | 66 | </li> |
67 | 67 | <?php } ?> |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | <div class="business-section__secondary"> |
71 | 71 | <div class="business-section__what-is-this"> |
72 | 72 | <h3>What is this?</h3> |
73 | - <?php include '_' . $section . '_desc.php'; ?> |
|
73 | + <?php include '_'.$section.'_desc.php'; ?> |
|
74 | 74 | </div> |
75 | 75 | <?php |
76 | 76 | include '_calendar_section.php'; |
77 | - include( dirname(__FILE__) . '/../sidebar/looking_for.php' ); |
|
77 | + include(dirname(__FILE__).'/../sidebar/looking_for.php'); |
|
78 | 78 | ?> |
79 | 79 | </div> |
80 | 80 | <?php } else { ?> |
@@ -84,6 +84,6 @@ |
||
84 | 84 | <?php } ?> |
85 | 85 | </div> |
86 | 86 | |
87 | - <?php $search_title = "Search $title"; include '_search.php'; ?> |
|
87 | + <?php $search_title = "search $title"; include '_search.php'; ?> |
|
88 | 88 | |
89 | 89 | </div> |
@@ -12,9 +12,9 @@ |
||
12 | 12 | if ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { |
13 | 13 | $body = preg_replace('# (S\d[O0WF]-\d+)[, ]#', ' <a href="/spwrans/?spid=$1">$1</a> ', $body); |
14 | 14 | $body = preg_replace_callback('#<citation id="uk\.org\.publicwhip/(.*?)/(.*?)">\[(.*?)\]</citation>#', function($matches) { |
15 | - if ($matches[1] == 'spor') { |
|
16 | - $href_segment = 'sp/?g'; |
|
17 | - } elseif ($matches[1] == 'spwa') { |
|
15 | + if ($matches[1] == 'spor') { |
|
16 | + $href_segment = 'sp/?g'; |
|
17 | + } elseif ($matches[1] == 'spwa') { |
|
18 | 18 | $href_segment = 'spwrans/?'; |
19 | 19 | } else { |
20 | 20 | $href_segment = 'debates/?'; |
@@ -1,4 +1,4 @@ discard block |
||
1 | - <?php foreach($data['rows'] as $speech) { ?> |
|
1 | + <?php foreach ($data['rows'] as $speech) { ?> |
|
2 | 2 | |
3 | 3 | <?php |
4 | 4 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | $href_segment = 'debates/?'; |
21 | 21 | } |
22 | - return '[<a href="' . $href_segment . 'id=' . $matches[2] . '\">' . $matches[3] . '</a>]'; |
|
22 | + return '[<a href="'.$href_segment.'id='.$matches[2].'\">'.$matches[3].'</a>]'; |
|
23 | 23 | }, |
24 | 24 | $body); |
25 | 25 | $body = str_replace('href="../../../', 'href="http://www.scottish.parliament.uk/', $body); |
@@ -65,34 +65,34 @@ discard block |
||
65 | 65 | 'url' => $speech['source_url'] |
66 | 66 | ); |
67 | 67 | $major = $data['info']['major']; |
68 | - if ($major==1 || $major==2 || (($major==3 || $major==4) && isset($speech['speaker']['house'])) || $major==101 || $major==6) { |
|
68 | + if ($major == 1 || $major == 2 || (($major == 3 || $major == 4) && isset($speech['speaker']['house'])) || $major == 101 || $major == 6) { |
|
69 | 69 | $source['title'] = 'Citation: '; |
70 | - if ($major==1 || $major==2) { |
|
70 | + if ($major == 1 || $major == 2) { |
|
71 | 71 | $source['title'] .= 'HC'; |
72 | - } elseif ($major==3 || $major==4) { |
|
73 | - if ($speech['speaker']['house']==1) { |
|
72 | + } elseif ($major == 3 || $major == 4) { |
|
73 | + if ($speech['speaker']['house'] == 1) { |
|
74 | 74 | $source['title'] .= 'HC'; |
75 | 75 | } else { |
76 | 76 | $source['title'] .= 'HL'; |
77 | 77 | } |
78 | - } elseif ($major==6) { |
|
78 | + } elseif ($major == 6) { |
|
79 | 79 | $source['title'] .= $data['section_title']; |
80 | 80 | } else { |
81 | 81 | $source['title'] .= 'HL'; |
82 | 82 | } |
83 | - $source['title'] .= ' Deb, ' . format_date($data['info']['date'], LONGDATEFORMAT) . ', c' . $speech['colnum']; |
|
84 | - if ($major==2) { |
|
83 | + $source['title'] .= ' Deb, '.format_date($data['info']['date'], LONGDATEFORMAT).', c'.$speech['colnum']; |
|
84 | + if ($major == 2) { |
|
85 | 85 | $source['title'] .= 'WH'; |
86 | - } elseif ($major==3) { |
|
86 | + } elseif ($major == 3) { |
|
87 | 87 | $source['title'] .= 'W'; |
88 | - } elseif ($major==4) { |
|
88 | + } elseif ($major == 4) { |
|
89 | 89 | $source['title'] .= 'WS'; |
90 | 90 | } |
91 | 91 | } else { |
92 | 92 | $source['title'] = null; |
93 | 93 | } |
94 | 94 | |
95 | - if ($hansardmajors[$data['info']['major']]['location']=='Scotland'){ |
|
95 | + if ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { |
|
96 | 96 | $source['text'] = 'Official Report source'; |
97 | 97 | } else { |
98 | 98 | $source['text'] = 'Hansard source'; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | <div class="debate-speech__speaker-and-content"> |
111 | 111 | |
112 | - <?php if(isset($speech['speaker']) && count($speech['speaker']) > 0) { ?> |
|
112 | + <?php if (isset($speech['speaker']) && count($speech['speaker']) > 0) { ?> |
|
113 | 113 | <h2 class="debate-speech__speaker"> |
114 | 114 | <?php |
115 | 115 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $speaker['party'] != 'Deputy Speaker' && |
136 | 136 | $speaker['constituency'] |
137 | 137 | ) { |
138 | - $speaker_position .= ', ' . $speaker['constituency']; |
|
138 | + $speaker_position .= ', '.$speaker['constituency']; |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | <?php } ?> |
167 | 167 | <div class="debate-speech__content"><?=$body ?></div> |
168 | 168 | |
169 | - <?php if ( $section ) { |
|
169 | + <?php if ($section) { |
|
170 | 170 | if ($speech['voting_data']) { ?> |
171 | 171 | |
172 | 172 | <div class="debate-speech__question-answered"> |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | |
192 | 192 | // Video |
193 | 193 | if ($data['info']['major'] == 1 && !$individual_item) { # Commons debates only |
194 | - if ($speech['video_status']&4) { ?> |
|
194 | + if ($speech['video_status'] & 4) { ?> |
|
195 | 195 | <a href="<?= $speech['commentsurl'] ?>" class="watch debate-speech__meta__link" onclick="return moveVideo(\'debate/'<?= $speech['gid'] ?>\');">Watch this</a> |
196 | 196 | <?php |
197 | - } elseif (!$speech['video'] && $speech['video_status']&1 && !($speech['video_status']&8)) { |
|
197 | + } elseif (!$speech['video'] && $speech['video_status'] & 1 && !($speech['video_status'] & 8)) { |
|
198 | 198 | $gid_type = $data['info']['major'] == 1 ? 'debate' : 'lords'; ?> |
199 | 199 | <a href="/video/?from=debate&gid=<?= $gid_type ?>/<?= $speech['gid'] ?>" class="timestamp debate-speech__meta__link">Video match this</a> |
200 | 200 | <?php |
@@ -284,28 +284,28 @@ discard block |
||
284 | 284 | $has_content = false; |
285 | 285 | } |
286 | 286 | if ($has_content) { |
287 | - print '<a href="' . $row['listurl'] . '">' . $row['body'] . '</a> '; |
|
287 | + print '<a href="'.$row['listurl'].'">'.$row['body'].'</a> '; |
|
288 | 288 | // For the "x speeches, x comments" text. |
289 | 289 | $moreinfo = array(); |
290 | 290 | if ($hansardmajors[$row['major']]['type'] != 'other') { |
291 | 291 | // All wrans have 2 speeches, so no need for this. |
292 | 292 | // All WMS have 1 speech |
293 | 293 | $plural = $row['contentcount'] == 1 ? 'speech' : 'speeches'; |
294 | - $moreinfo[] = $row['contentcount'] . " $plural"; |
|
294 | + $moreinfo[] = $row['contentcount']." $plural"; |
|
295 | 295 | } |
296 | 296 | if ($row['totalcomments'] > 0) { |
297 | 297 | $plural = $row['totalcomments'] == 1 ? 'annotation' : 'annotations'; |
298 | - $moreinfo[] = $row['totalcomments'] . " $plural"; |
|
298 | + $moreinfo[] = $row['totalcomments']." $plural"; |
|
299 | 299 | } |
300 | 300 | if (count($moreinfo) > 0) { |
301 | - print "<small>(" . implode (', ', $moreinfo) . ") </small>"; |
|
301 | + print "<small>(".implode(', ', $moreinfo).") </small>"; |
|
302 | 302 | } |
303 | 303 | } else { |
304 | 304 | // Nothing in this item, so no link. |
305 | 305 | print $row['body']; |
306 | 306 | } |
307 | 307 | if (isset($row['excerpt'])) { |
308 | - print "<p class=\"subrows__excerpt\">" . trim_characters($row['excerpt'], 0, 200) . "</p>"; |
|
308 | + print "<p class=\"subrows__excerpt\">".trim_characters($row['excerpt'], 0, 200)."</p>"; |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | print '</ul></div></div></div>'; |
@@ -157,7 +157,7 @@ |
||
157 | 157 | <?php # XXX |
158 | 158 | if ($data['info']['major'] == 8 && preg_match('#\d{4}-\d\d-\d\d\.(.*?)\.q#', $speech['gid'], $m)) { |
159 | 159 | ?><p class="debate-speech__question_id"><small> |
160 | - <?= "Question $m[1]" ?> |
|
160 | + <?= "question $m[1]" ?> |
|
161 | 161 | </small></p> |
162 | 162 | <?php } ?> |
163 | 163 | </h2> |