@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $last_result = $info['total_results']; |
45 | 45 | } |
46 | 46 | |
47 | - print "\t\t\t\t<h3 style='font-weight:normal'>Results <strong>" . number_format($info['first_result']) . '-' . number_format($last_result) . '</strong> of ' . number_format($info['total_results']) . " for <strong>" . _htmlentities($searchdescription) . "</strong></h3>\n"; |
|
47 | + print "\t\t\t\t<h3 style='font-weight:normal'>Results <strong>".number_format($info['first_result']).'-'.number_format($last_result).'</strong> of '.number_format($info['total_results'])." for <strong>"._htmlentities($searchdescription)."</strong></h3>\n"; |
|
48 | 48 | |
49 | 49 | } elseif ($info['total_results'] == 0) { |
50 | 50 | echo '<h3 style="font-weight:normal">Your search for <strong>', _htmlentities($searchdescription), '</strong> did not match anything.</h3>'; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $u = new URL('search'); |
55 | 55 | $u->reset(); |
56 | 56 | $u->insert(array('s' => $info['spelling_correction'])); |
57 | - echo '<p><big>Did you mean: <a href="' . $u->generate(), '">', $info['spelling_correction'] . '</a>?</big></p>'; |
|
57 | + echo '<p><big>Did you mean: <a href="'.$u->generate(), '">', $info['spelling_correction'].'</a>?</big></p>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($match = get_http_var('match')) { |
@@ -66,35 +66,35 @@ discard block |
||
66 | 66 | if (isset ($data['rows']) && count($data['rows']) > 0) { |
67 | 67 | |
68 | 68 | echo '<dl id="searchresults">'; |
69 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
69 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
70 | 70 | |
71 | 71 | $row = $data['rows'][$i]; |
72 | 72 | echo '<dt><a href="', $row['listurl'], '">'; |
73 | 73 | if (isset($row['parent']) && count($row['parent']) > 0) { |
74 | - echo ('<strong>' . $row['parent']['body'] . '</strong>'); |
|
74 | + echo ('<strong>'.$row['parent']['body'].'</strong>'); |
|
75 | 75 | } |
76 | - echo '</a> <small>(' . format_date($row['hdate'], LONGDATEFORMAT) . ')'; |
|
76 | + echo '</a> <small>('.format_date($row['hdate'], LONGDATEFORMAT).')'; |
|
77 | 77 | if (isset($row['video_status']) && ($row['video_status'] == 5 || $row['video_status'] == 7)) { |
78 | 78 | echo ' <em>has video</em> '; |
79 | 79 | } |
80 | 80 | if (isset($row['collapsed']) && $row['collapsed'] && $row['subsection_id']) { |
81 | 81 | $URL = new URL('search'); |
82 | - $URL->insert(array('s' => $info['s'] . " segment:$row[subsection_id]" )); |
|
82 | + $URL->insert(array('s' => $info['s']." segment:$row[subsection_id]")); |
|
83 | 83 | echo ' <a href="', $URL->generate(), '">See ', $row['collapsed'], |
84 | - ' other result', $row['collapsed']>1?'s':'', ' from this ', |
|
84 | + ' other result', $row['collapsed'] > 1 ? 's' : '', ' from this ', |
|
85 | 85 | $hansardmajors[$row['major']]['singular'], '</a>'; |
86 | 86 | } |
87 | 87 | echo '</small>'; |
88 | 88 | if ($match = get_http_var('match')) { |
89 | - echo ' – <a href="/search/record.php?result=', $row['gid'] , '&match=', _htmlspecialchars($match), '">This is the correct match</a>'; |
|
89 | + echo ' – <a href="/search/record.php?result=', $row['gid'], '&match=', _htmlspecialchars($match), '">This is the correct match</a>'; |
|
90 | 90 | } |
91 | 91 | echo '</dt> <dd><p>'; |
92 | 92 | if (isset($row['speaker']) && count($row['speaker'])) { |
93 | - echo "<em>" . ucfirst($row['speaker']['name']) . "</em>"; |
|
93 | + echo "<em>".ucfirst($row['speaker']['name'])."</em>"; |
|
94 | 94 | if ($row['extract']) echo ": "; |
95 | 95 | } |
96 | 96 | |
97 | - echo $row['extract'] . "</p></dd>\n"; |
|
97 | + echo $row['extract']."</p></dd>\n"; |
|
98 | 98 | |
99 | 99 | } |
100 | 100 |
@@ -91,7 +91,9 @@ |
||
91 | 91 | echo '</dt> <dd><p>'; |
92 | 92 | if (isset($row['speaker']) && count($row['speaker'])) { |
93 | 93 | echo "<em>" . ucfirst($row['speaker']['name']) . "</em>"; |
94 | - if ($row['extract']) echo ": "; |
|
94 | + if ($row['extract']) { |
|
95 | + echo ": "; |
|
96 | + } |
|
95 | 97 | } |
96 | 98 | |
97 | 99 | echo $row['extract'] . "</p></dd>\n"; |
@@ -1,8 +1,8 @@ discard block |
||
1 | - <?php if ( $featured['featured'] ) { ?> |
|
1 | + <?php if ($featured['featured']) { ?> |
|
2 | 2 | <h2>In the news</h2> |
3 | - <?php if ( isset($featured['headline']) ) { ?> |
|
3 | + <?php if (isset($featured['headline'])) { ?> |
|
4 | 4 | <h3 class="in-the-news__topic"><a href="<?= $featured['list_url'] ?>"><?= $featured['headline'] ?></a></h3> |
5 | - <?php if ( isset($featured['context']) ) { ?> |
|
5 | + <?php if (isset($featured['context'])) { ?> |
|
6 | 6 | <p class="in-the-news__context"><?= $featured['context'] ?></p> |
7 | 7 | <?php } ?> |
8 | 8 | <?php } ?> |
@@ -15,21 +15,21 @@ discard block |
||
15 | 15 | <p class="meta excerpt__category"><a href="<?= $featured['more_url'] ?>"><?= $featured['desc'] ?></a></p> |
16 | 16 | <p class="excerpt__statement"> |
17 | 17 | <q> |
18 | - <?php if ( $featured['child']['speaker'] ) { ?> |
|
18 | + <?php if ($featured['child']['speaker']) { ?> |
|
19 | 19 | <a href="<?= $featured['child']['speaker']['url'] ?>"><?= $featured['child']['speaker']['name'] ?></a> : |
20 | 20 | <?php } ?> |
21 | 21 | <?= trim_characters($featured['child']['body'], 0, 200) ?> |
22 | 22 | </q> |
23 | 23 | </p> |
24 | 24 | </div> |
25 | - <?php if ( count($featured['related']) ) { ?> |
|
25 | + <?php if (count($featured['related'])) { ?> |
|
26 | 26 | <div class="in-the-news__key-events"> |
27 | 27 | <!-- No maximum, but less than 4 looks best --> |
28 | 28 | <ul class="key-events__list"> |
29 | 29 | <li> |
30 | 30 | <h4>Key events</h4> |
31 | 31 | </li> |
32 | - <?php foreach ( $featured['related'] as $related ) { ?> |
|
32 | + <?php foreach ($featured['related'] as $related) { ?> |
|
33 | 33 | <li> |
34 | 34 | <a href="<?= $related['list_url'] ?>"><?= $related['parent']['body'] ?></a> |
35 | 35 | <p class="meta"><?= format_date($related['hdate'], SHORTDATEFORMAT) ?></p> |
@@ -1,10 +1,10 @@ discard block |
||
1 | - <?php if ( isset( $recent['child'] ) ) { ?> |
|
1 | + <?php if (isset($recent['child'])) { ?> |
|
2 | 2 | <li class="parliamentary-excerpt"> |
3 | - <h3 class="excerpt__title"><a href="<?= $recent['list_url'] ?>"><?= $recent['parent']['body'] ? $recent['parent']['body'] . ' : ' : '' ?><?= $recent['body'] ?></a></h3> |
|
3 | + <h3 class="excerpt__title"><a href="<?= $recent['list_url'] ?>"><?= $recent['parent']['body'] ? $recent['parent']['body'].' : ' : '' ?><?= $recent['body'] ?></a></h3> |
|
4 | 4 | <p class="meta"><?=format_date($recent['hdate'], LONGERDATEFORMAT); ?></p> |
5 | 5 | <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p> |
6 | 6 | <p class="excerpt__statement"> |
7 | - <?php if ( isset($recent['child']['speaker']) && count($recent['child']['speaker']) ) { ?> |
|
7 | + <?php if (isset($recent['child']['speaker']) && count($recent['child']['speaker'])) { ?> |
|
8 | 8 | <a href="<?= $recent['child']['speaker']['url'] ?>"><?= $recent['child']['speaker']['name'] ?></a> |
9 | 9 | <?php } ?> |
10 | 10 | <?= trim_characters($recent['child']['body'], 0, 200) ?> |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | <?php } else { ?> |
14 | 14 | <li class="parliamentary-excerpt"> |
15 | 15 | <h3 class="excerpt__title"><?= $recent['desc'] ?></h3> |
16 | - <?php foreach ( $recent['data'] as $date => $details ) { ?> |
|
16 | + <?php foreach ($recent['data'] as $date => $details) { ?> |
|
17 | 17 | <p class="meta"><?= $date ?></p> |
18 | 18 | <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p> |
19 | - <?php foreach ( $details as $bill ) { ?> |
|
19 | + <?php foreach ($details as $bill) { ?> |
|
20 | 20 | <p class="excerpt__statement"> |
21 | 21 | <a href="<?= $bill['url'] ?>"><?= $bill['bill'] ?>, <?= $bill['sitting'] ?></a> |
22 | 22 | </p> |
@@ -42,24 +42,24 @@ |
||
42 | 42 | ?> |
43 | 43 | <dl id="searchresults"> |
44 | 44 | <?php |
45 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
45 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
46 | 46 | |
47 | 47 | $row = $data['rows'][$i]; |
48 | 48 | |
49 | 49 | ?> |
50 | 50 | <dt><a href="<?php echo $row['listurl']; ?>"><?php |
51 | 51 | if (isset($row['parent']) && count($row['parent']) > 0) { |
52 | - echo ('<strong>' . $row['parent']['body'] . '</strong>'); |
|
52 | + echo ('<strong>'.$row['parent']['body'].'</strong>'); |
|
53 | 53 | } |
54 | - echo ('</a> <small>(' . format_date($row['hdate'], SHORTDATEFORMAT) . ')</small>'); |
|
54 | + echo ('</a> <small>('.format_date($row['hdate'], SHORTDATEFORMAT).')</small>'); |
|
55 | 55 | ?></dt> |
56 | 56 | <dd><p><?php |
57 | 57 | |
58 | 58 | if (isset($row['speaker']['name'])) { |
59 | - echo "<em>" . $row['speaker']['name'] . "</em>: "; |
|
59 | + echo "<em>".$row['speaker']['name']."</em>: "; |
|
60 | 60 | } |
61 | 61 | |
62 | - echo $row['extract'] . "</p></dd>\n"; |
|
62 | + echo $row['extract']."</p></dd>\n"; |
|
63 | 63 | |
64 | 64 | } |
65 | 65 |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="search-page__section__secondary search-page-sidebar"> |
2 | - <?php if ( isset( $search_sidebar['email'] ) ) { ?> |
|
2 | + <?php if (isset($search_sidebar['email'])) { ?> |
|
3 | 3 | <h2>Create an alert</h2> |
4 | 4 | <p class="sidebar-item-with-icon"> |
5 | 5 | <a href="<?= $search_sidebar['email'] ?>">Subscribe to an email alert</a> |
6 | 6 | for <em class="current-search-term"><?= $search_sidebar['email_desc'] ?></em> |
7 | - <?php if (isset( $search_sidebar['email_section'] ) ) { ?> |
|
7 | + <?php if (isset($search_sidebar['email_section'])) { ?> |
|
8 | 8 | <br><small>(or just <a href="<?= $search_sidebar['email_section'] ?>"><?= $search_sidebar['email_desc_section'] ?></a>)</small> |
9 | 9 | <?php } ?> |
10 | 10 | </p> |
@@ -16,5 +16,5 @@ discard block |
||
16 | 16 | <?php } ?> |
17 | 17 | |
18 | 18 | |
19 | - <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?> |
|
19 | + <?php include(dirname(__FILE__).'/../sidebar/looking_for.php') ?> |
|
20 | 20 | </div> |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | <div class="search-page__section__primary"> |
10 | 10 | <h2>Who says <em class="current-search-term"><?= _htmlentities($searchstring) ?></em> the most?</h2> |
11 | 11 | |
12 | - <?php if ( isset($error) ) { ?> |
|
13 | - <?php if ( $error == 'No results' && isset( $house ) && $house != 0 ) { ?> |
|
12 | + <?php if (isset($error)) { ?> |
|
13 | + <?php if ($error == 'No results' && isset($house) && $house != 0) { ?> |
|
14 | 14 | <ul class="search-result-display-options"> |
15 | 15 | <li> |
16 | - <?php if ( $house == 1 ) { ?> |
|
16 | + <?php if ($house == 1) { ?> |
|
17 | 17 | No results for MPs only |
18 | - <?php } else if ( $house == 2 ) { ?> |
|
18 | + <?php } else if ($house == 2) { ?> |
|
19 | 19 | No results for Peers only |
20 | - <?php } else if ( $house == 4 ) { ?> |
|
20 | + <?php } else if ($house == 4) { ?> |
|
21 | 21 | No results for MSPs only |
22 | - <?php } else if ( $house == 3 ) { ?> |
|
22 | + <?php } else if ($house == 3) { ?> |
|
23 | 23 | No results for MLAs only |
24 | 24 | <?php } ?> |
25 | 25 | | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php } ?> |
32 | 32 | <?php } ?> |
33 | 33 | |
34 | - <?php if ( $wtt ) { ?> |
|
34 | + <?php if ($wtt) { ?> |
|
35 | 35 | <p><strong>Now, try reading what a couple of these Lords are saying, |
36 | 36 | to help you find someone appropriate. When you've found someone, |
37 | 37 | hit the "I want to write to this Lord" button on their results page |
@@ -39,37 +39,37 @@ discard block |
||
39 | 39 | </strong></p> |
40 | 40 | <?php } ?> |
41 | 41 | |
42 | - <?php if ( isset($speakers) && count($speakers) ) { ?> |
|
42 | + <?php if (isset($speakers) && count($speakers)) { ?> |
|
43 | 43 | |
44 | - <?php if ( !$wtt ) { ?> |
|
44 | + <?php if (!$wtt) { ?> |
|
45 | 45 | <ul class="search-result-display-options"> |
46 | 46 | <li>Results grouped by person</li> |
47 | 47 | <li> |
48 | - <?php if ( $house == 0 ) { ?> |
|
48 | + <?php if ($house == 0) { ?> |
|
49 | 49 | Show All |
50 | 50 | <?php } else { ?> |
51 | 51 | <a href="<?= $this_url->generate('html') ?>">Show All</a> |
52 | 52 | <?php } ?> |
53 | 53 | | |
54 | - <?php if ( $house == 1 ) { ?> |
|
54 | + <?php if ($house == 1) { ?> |
|
55 | 55 | MPs only |
56 | 56 | <?php } else { ?> |
57 | 57 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
58 | 58 | <?php } ?> |
59 | 59 | | |
60 | - <?php if ( $house == 2 ) { ?> |
|
60 | + <?php if ($house == 2) { ?> |
|
61 | 61 | Peers only |
62 | 62 | <?php } else { ?> |
63 | 63 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
64 | 64 | <?php } ?> |
65 | 65 | | |
66 | - <?php if ( $house == 4 ) { ?> |
|
66 | + <?php if ($house == 4) { ?> |
|
67 | 67 | MSPs only |
68 | 68 | <?php } else { ?> |
69 | 69 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
70 | 70 | <?php } ?> |
71 | 71 | | |
72 | - <?php if ( $house == 3 ) { ?> |
|
72 | + <?php if ($house == 3) { ?> |
|
73 | 73 | MLAs only |
74 | 74 | <?php } else { ?> |
75 | 75 | <a href="<?= $this_url->generate('html', array('house'=>3)) ?>">MLAs only</a> |
@@ -90,33 +90,33 @@ discard block |
||
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <?php foreach ( $speakers as $pid => $speaker ) { ?> |
|
93 | + <?php foreach ($speakers as $pid => $speaker) { ?> |
|
94 | 94 | |
95 | - <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?> |
|
95 | + <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?> |
|
96 | 96 | |
97 | 97 | <tr> |
98 | 98 | <td><?= $speaker['count'] ?></td> |
99 | 99 | <td> |
100 | - <?php if ( $pid ) { ?> |
|
101 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
100 | + <?php if ($pid) { ?> |
|
101 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
102 | 102 | <a href="/search/?q=<?= _htmlentities($searchstring) ?>&pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&wtt=2' : '' ?>"> |
103 | 103 | <?php } ?> |
104 | 104 | <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?> |
105 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
105 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
106 | 106 | </a> |
107 | 107 | <?php } ?> |
108 | - <?php if ( isset($speaker['party']) ) { ?> |
|
108 | + <?php if (isset($speaker['party'])) { ?> |
|
109 | 109 | <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span> |
110 | 110 | <?php } ?> |
111 | - <?php if ( $house != 2 ) { ?> |
|
112 | - <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
|
111 | + <?php if ($house != 2) { ?> |
|
112 | + <?= isset($speaker['office']) ? ' - '.join('; ', $speaker['office']) : '' ?> |
|
113 | 113 | <?php } ?> |
114 | 114 | <?php } else { // no $pid ?> |
115 | 115 | <?= $speaker['name'] ?> |
116 | 116 | <?php } ?> |
117 | 117 | </td> |
118 | 118 | <td> |
119 | - <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
|
119 | + <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?> |
|
120 | 120 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
121 | 121 | <?php } else { ?> |
122 | 122 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
@@ -3,8 +3,8 @@ |
||
3 | 3 | <h3 class="search-result__title"><a href="<?= $member->url() ?>"><?= $member->full_name() ?></a></h3> |
4 | 4 | <p class="search-result__description"> |
5 | 5 | <?php $details = $member->getMostRecentMembership(); ?> |
6 | - <?= $details['left_house'] != '9999-12-31' ? 'Former ' : '' ?><?= $details['party'] ? $details['party'] . ' ' : '' ?><?= $details['rep_name'] ?><?= $details['cons'] ? ', ' . $details['cons'] : ''?> |
|
7 | - <?php if ( $details['entered_house'] || ( $details['left_house'] && $details['left_house'] != '9999-12-31' ) ) { ?> |
|
6 | + <?= $details['left_house'] != '9999-12-31' ? 'Former ' : '' ?><?= $details['party'] ? $details['party'].' ' : '' ?><?= $details['rep_name'] ?><?= $details['cons'] ? ', '.$details['cons'] : ''?> |
|
7 | + <?php if ($details['entered_house'] || ($details['left_house'] && $details['left_house'] != '9999-12-31')) { ?> |
|
8 | 8 | , <?= format_date($details['entered_house'], SHORTDATEFORMAT) ?> – <?= $details['left_house'] != '9999-12-31' ? format_date($details['left_house'], SHORTDATEFORMAT) : '' ?> |
9 | 9 | <?php } ?> |
10 | 10 | </p> |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <div class="full-page"> |
2 | - <div class="full-page__row search-page <?php if ( !$searchstring ) { ?>search-page--blank<?php } ?>"> |
|
2 | + <div class="full-page__row search-page <?php if (!$searchstring) { ?>search-page--blank<?php } ?>"> |
|
3 | 3 | |
4 | 4 | <form class="js-search-form-without-options"> |
5 | 5 | <?php include 'form_main.php'; ?> |
6 | 6 | </form> |
7 | 7 | |
8 | - <?php if ( $searchstring && !isset($warnings) ) { ?> |
|
8 | + <?php if ($searchstring && !isset($warnings)) { ?> |
|
9 | 9 | <div class="search-page__section search-page__section--results"> |
10 | 10 | <div class="search-page__section__primary"> |
11 | - <?php if ( $cons ) { ?> |
|
12 | - <?php if ( count($cons) > 1 ) { |
|
11 | + <?php if ($cons) { ?> |
|
12 | + <?php if (count($cons) > 1) { |
|
13 | 13 | $types = array(); |
14 | - if ( $mp_types['mp'] > 0 ) { |
|
14 | + if ($mp_types['mp'] > 0) { |
|
15 | 15 | $types[] = 'MPs'; |
16 | 16 | } |
17 | - if ( $mp_types['former'] > 0 ) { |
|
17 | + if ($mp_types['former'] > 0) { |
|
18 | 18 | $types[] = 'former MPs'; |
19 | 19 | } |
20 | 20 | $desc = ucfirst(implode(' and ', $types)); |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | <?php } else { // count($cons) <= 1 ?> |
24 | 24 | <h2><?= $mp_types['former'] ? 'Former ' : '' ?>MP for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
25 | 25 | <?php } ?> |
26 | - <?php foreach ( $cons as $member ) { ?> |
|
26 | + <?php foreach ($cons as $member) { ?> |
|
27 | 27 | <?php include('person.php'); ?> |
28 | 28 | <?php } ?> |
29 | 29 | <?php } ?> |
30 | 30 | |
31 | - <?php if ( $members ) { ?> |
|
31 | + <?php if ($members) { ?> |
|
32 | 32 | <h2>People matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
33 | - <?php foreach ( $members as $member ) { ?> |
|
33 | + <?php foreach ($members as $member) { ?> |
|
34 | 34 | <?php include('person.php'); ?> |
35 | 35 | <?php } ?> |
36 | 36 | <hr> |
@@ -38,25 +38,25 @@ discard block |
||
38 | 38 | |
39 | 39 | <?php if ($glossary) { ?> |
40 | 40 | <h2>Glossary items matching <em class="current-search-term"><?= _htmlentities($searchstring) ?></em></h2> |
41 | - <?php foreach ( $glossary as $item ) { ?> |
|
41 | + <?php foreach ($glossary as $item) { ?> |
|
42 | 42 | <?php include('glossary.php'); ?> |
43 | 43 | <?php } ?> |
44 | 44 | <hr> |
45 | 45 | <?php } ?> |
46 | 46 | |
47 | - <?php if ( isset($pid) && $wtt == 2 ) { ?> |
|
47 | + <?php if (isset($pid) && $wtt == 2) { ?> |
|
48 | 48 | <p>I want to <a href="https://www.writetothem.com/lords/?pid=<?= $pid ?>">write to <?= $wtt_lord_name ?></a></p> |
49 | 49 | <?php } ?> |
50 | 50 | |
51 | - <?php if ( isset($error) ) { ?> |
|
51 | + <?php if (isset($error)) { ?> |
|
52 | 52 | There was an error – <?= $error ?> – searching for <em class="current-search-term"><?= _htmlentities($searchstring) ?></em>. |
53 | 53 | <?php } else { ?> |
54 | 54 | <h2> |
55 | - <?php if ( $pagination_links ) { ?> |
|
55 | + <?php if ($pagination_links) { ?> |
|
56 | 56 | Results <?= $pagination_links['first_result'] ?>–<?= $pagination_links['last_result'] ?> of <?= $info['total_results'] ?> |
57 | - <?php } else if ( $info['total_results'] == 1 ) { ?> |
|
57 | + <?php } else if ($info['total_results'] == 1) { ?> |
|
58 | 58 | The only result |
59 | - <?php } else if ( $info['total_results'] == 0 ) { ?> |
|
59 | + <?php } else if ($info['total_results'] == 0) { ?> |
|
60 | 60 | There were no results |
61 | 61 | <?php } else { ?> |
62 | 62 | All <?= $info['total_results'] ?> results |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | for <em class="current-search-term"><?= _htmlentities($searchdescription) ?></em> |
65 | 65 | </h2> |
66 | 66 | |
67 | - <?php if ( $info['spelling_correction'] ) { ?> |
|
68 | - <p>Did you mean <a href="/search/?q=<?= urlencode($info['spelling_correction']) ?>"><?= _htmlentities( $info['spelling_correction_display'] ) ?></a>?</p> |
|
67 | + <?php if ($info['spelling_correction']) { ?> |
|
68 | + <p>Did you mean <a href="/search/?q=<?= urlencode($info['spelling_correction']) ?>"><?= _htmlentities($info['spelling_correction_display']) ?></a>?</p> |
|
69 | 69 | <?php } ?> |
70 | 70 | |
71 | - <?php if ( $info['total_results'] ) { ?> |
|
71 | + <?php if ($info['total_results']) { ?> |
|
72 | 72 | <ul class="search-result-display-options"> |
73 | - <?php if ( $sort_order == 'relevance' ) { ?> |
|
73 | + <?php if ($sort_order == 'relevance') { ?> |
|
74 | 74 | <li>Sorted by relevance</li> |
75 | 75 | <li>Sort by date: <a href="<?= $urls['newest'] ?>">newest</a> / <a href="<?= $urls['oldest'] ?>">oldest</a></li> |
76 | - <?php } else if ( $sort_order == 'oldest' ) { ?> |
|
76 | + <?php } else if ($sort_order == 'oldest') { ?> |
|
77 | 77 | <li>Sort by <a href="<?= $urls['relevance'] ?>">relevance</a></li> |
78 | 78 | <li>Sorted by date: <a href="<?= $urls['newest'] ?>">newest</a> / oldest</li> |
79 | 79 | <?php } else { ?> |
@@ -84,25 +84,25 @@ discard block |
||
84 | 84 | </ul> |
85 | 85 | <?php } ?> |
86 | 86 | |
87 | - <?php foreach ( $rows as $result ) { ?> |
|
87 | + <?php foreach ($rows as $result) { ?> |
|
88 | 88 | <div class="search-result search-result--generic"> |
89 | 89 | <h3 class="search-result__title"><a href="<?= $result['listurl'] ?>"><?= $result['parent']['body'] ?></a> (<?= format_date($result['hdate'], SHORTDATEFORMAT) ?>)</h3> |
90 | - <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'] . ': ' : '' ?><?= $result['extract'] ?></p> |
|
90 | + <p class="search-result__description"><?= isset($result['speaker']) ? $result['speaker']['name'].': ' : '' ?><?= $result['extract'] ?></p> |
|
91 | 91 | </div> |
92 | 92 | <?php } ?> |
93 | 93 | |
94 | 94 | <hr> |
95 | 95 | |
96 | - <?php if ( $pagination_links ) { ?> |
|
96 | + <?php if ($pagination_links) { ?> |
|
97 | 97 | <div class="search-result-pagination"> |
98 | - <?php if ( isset($pagination_links['prev']) ) { ?> |
|
98 | + <?php if (isset($pagination_links['prev'])) { ?> |
|
99 | 99 | <a href="<?= $pagination_links['firstpage']['url'] ?>" title="First page"><<</a> |
100 | 100 | <a href="<?= $pagination_links['prev']['url'] ?>" title="Previous page"><</a> |
101 | 101 | <?php } ?> |
102 | - <?php foreach ( $pagination_links['nums'] as $link ) { ?> |
|
102 | + <?php foreach ($pagination_links['nums'] as $link) { ?> |
|
103 | 103 | <a href="<?= $link['url'] ?>"<?= $link['current'] ? ' class="search-result-pagination__current-page"' : '' ?>><?= $link['page'] ?></a> |
104 | 104 | <?php } ?> |
105 | - <?php if ( isset($pagination_links['next']) ) { ?> |
|
105 | + <?php if (isset($pagination_links['next'])) { ?> |
|
106 | 106 | <a href="<?= $pagination_links['next']['url'] ?>" title="Next page">></a> |
107 | 107 | <a href="<?= $pagination_links['lastpage']['url'] ?>" title="Final page">>></a> |
108 | 108 | <?php } ?> |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <input type="text" name="q" value="<?= _htmlentities($search_keyword) ?>" class="form-control"> |
5 | 5 | <input type="submit" class="button" value="Search"> |
6 | 6 | </p> |
7 | - <?php if (isset($warnings) ) { ?> |
|
7 | + <?php if (isset($warnings)) { ?> |
|
8 | 8 | <p class="error"> |
9 | 9 | <?= $warnings ?> |
10 | 10 | </p> |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | <p> |
19 | 19 | <ul class="search-result-display-options"> |
20 | 20 | <li><a href="#options" class="search-options-toggle js-toggle-search-options">Advanced search</a></li> |
21 | - <?php if ( $is_adv ) { ?> |
|
22 | - <?= $search_phrase ? '<li>Exactly: ' . _htmlentities($search_phrase) . '</li>' : '' ?> |
|
23 | - <?= $search_exclude ? '<li>Excluding: ' . _htmlentities($search_exclude) . '</li>' : '' ?> |
|
24 | - <?= $search_from ? '<li>From: ' . _htmlentities($search_from) . '</li>' : '' ?> |
|
25 | - <?= $search_to ? '<li>To: ' . _htmlentities($search_to) . '</li>' : '' ?> |
|
26 | - <?= $search_person ? '<li>Person: ' . _htmlentities($search_person) . '</li>' : '' ?> |
|
27 | - <?= $search_section ? '<li>Section: ' . _htmlentities($search_section_pretty) . '</li>' : '' ?> |
|
28 | - <?= $search_column ? '<li>Column: ' . _htmlentities($search_column) . '</li>' : '' ?> |
|
21 | + <?php if ($is_adv) { ?> |
|
22 | + <?= $search_phrase ? '<li>Exactly: '._htmlentities($search_phrase).'</li>' : '' ?> |
|
23 | + <?= $search_exclude ? '<li>Excluding: '._htmlentities($search_exclude).'</li>' : '' ?> |
|
24 | + <?= $search_from ? '<li>From: '._htmlentities($search_from).'</li>' : '' ?> |
|
25 | + <?= $search_to ? '<li>To: '._htmlentities($search_to).'</li>' : '' ?> |
|
26 | + <?= $search_person ? '<li>Person: '._htmlentities($search_person).'</li>' : '' ?> |
|
27 | + <?= $search_section ? '<li>Section: '._htmlentities($search_section_pretty).'</li>' : '' ?> |
|
28 | + <?= $search_column ? '<li>Column: '._htmlentities($search_column).'</li>' : '' ?> |
|
29 | 29 | <?php } ?> |
30 | 30 | </ul> |
31 | 31 | </p> |