@@ -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)) { |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | </div> |
| 114 | 114 | |
| 115 | 115 | <ul class="debate-speech__meta debate-speech__links"> |
| 116 | - <?php if ( $division['debate_url'] ) { ?> |
|
| 116 | + <?php if ($division['debate_url']) { ?> |
|
| 117 | 117 | <li class="link-to-speech"> |
| 118 | 118 | <a class="link debate-speech__meta__link" href="<?= $division['debate_url'] ?>">Show full debate</a> |
| 119 | 119 | </li> |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | ?> |
| 10 | 10 | <ul class="division-list"> |
| 11 | 11 | <?php foreach ($votes as $vote) { |
| 12 | - $voter = sprintf('<a href="/mp/?p=%d">%s</a>', $vote['person_id'], $vote['name']); |
|
| 13 | - if ($vote['teller']) { |
|
| 14 | - $tellers[] = $voter; |
|
| 15 | - } else { ?> |
|
| 12 | + $voter = sprintf('<a href="/mp/?p=%d">%s</a>', $vote['person_id'], $vote['name']); |
|
| 13 | + if ($vote['teller']) { |
|
| 14 | + $tellers[] = $voter; |
|
| 15 | + } else { ?> |
|
| 16 | 16 | <li><?= $voter ?></li> |
| 17 | 17 | <?php |
| 18 | 18 | } |
@@ -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 @@ discard block |
||
| 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"> |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | <br> |
| 30 | 30 | <span class="business-list__meta"> |
| 31 | 31 | <?= $division['summary'] ?> |
| 32 | - <?= $division['mp_vote'] !== '' ? '. <b>Your MP, ' . $mp_name . ', ' . $division['mp_vote'] . '.</b>': '' ?> |
|
| 32 | + <?= $division['mp_vote'] !== '' ? '. <b>Your MP, ' . $mp_name . ', ' . $division['mp_vote'] . '.</b>' : '' ?> |
|
| 33 | 33 | </span> |
| 34 | 34 | </p> |
| 35 | 35 | </li> |
@@ -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"; |