function _get_data_by_recent_debates($args) { if (!isset($args['num'])) { $args['num'] = 20; } $q = $this->db->query('select gid, minor, hdate from hansard where htype=10 and major=6 order by hdate desc limit ' . $args['num']); $data = array(); for ($i = 0; $i < $q->rows(); $i++) { $minor = $q->field($i, 'minor'); $gid = $q->field($i, 'gid'); $hdate = format_date($q->field($i, 'hdate'), LONGDATEFORMAT); $qq = $this->db->query('select title, session from bills where id=' . $minor); $title = $qq->field(0, 'title'); $session = $qq->field(0, 'session'); preg_match('#_(\\d\\d)-(\\d)_#', $gid, $m); $sitting = make_ranking($m[1] + 0) . ' sitting'; if ($m[2] > 0) { $sitting .= ", part {$m['2']}"; } $data[$hdate][] = array('bill' => $title, 'sitting' => $sitting, 'url' => "{$session}/" . urlencode($title)); } return $data; }
} // Are we going to make this (sub)section a link // and does it contain printable speeches? $has_content = true; if ($has_content) { echo '<a '; if ($row['htype'] == 10) { echo 'name="sitting', $row['sitting']; if ($row['part'] > 0) { echo "_{$row['part']}"; } echo '" '; } echo 'href="' . $row['listurl'] . '"><strong>' . $row['body']; if ($row['htype'] == 10) { $sitting = make_ranking($row['sitting']); echo ", {$sitting} sitting"; if ($row['part'] > 0) { echo ", part {$row['part']}"; } } echo '</strong></a> '; // For the "x speeches, x comments" text. $moreinfo = array(); $plural = $row['contentcount'] == 1 ? 'speech' : 'speeches'; $moreinfo[] = $row['contentcount'] . " {$plural}"; if ($row['totalcomments'] > 0) { $plural = $row['totalcomments'] == 1 ? 'annotation' : 'annotations'; $moreinfo[] = $row['totalcomments'] . " {$plural}"; } if (count($moreinfo) > 0) {
function _get_data_by_recent_pbc_debates($args) { if (!isset($args['num'])) { $args['num'] = 20; } $q = $this->db->query('select gid, minor, hdate from hansard where htype=10 and major=6 order by hdate desc limit ' . $args['num']); $data = array(); for ($i = 0; $i < $q->rows(); $i++) { $minor = $q->field($i, 'minor'); $gid = $q->field($i, 'gid'); $hdate = format_date($q->field($i, 'hdate'), LONGDATEFORMAT); $qq = $this->db->query('select title, session from bills where id=' . $minor); $title = $qq->field(0, 'title'); $session = $qq->field(0, 'session'); list($sitting, $part) = $this->_get_sitting($gid); $sitting_txt = make_ranking($sitting) . ' sitting'; if ($part > 0) { $sitting .= ", part {$part}"; } $data[$hdate][] = array('bill' => $title, 'sitting' => $sitting_txt, 'url' => "/pbc/{$session}/" . urlencode(str_replace(' ', '_', $title)) . '/#sitting' . $sitting); } return $data; }
function expenses_printout($col, $extra_info, $style) { for ($ey = 2007; $ey >= 2002; --$ey) { $k = 'expenses' . $ey . '_' . $col; $kr = $k . '_rank'; print '<td class="row-' . $style . '">'; if (isset($extra_info[$k])) { print '£' . number_format(str_replace(',', '', $extra_info[$k])); } elseif ($col == 'col7a') { print 'N/A'; } else { print ' '; } if (isset($extra_info[$kr]) && isset($extra_info[$k]) && $extra_info[$k] > 0) { print ' ('; if (isset($extra_info[$kr . '_joint'])) { print 'joint '; } print make_ranking($extra_info[$kr]) . ")"; } if ($col == 'col5' && $ey == 2007) { print '<sup><a href="#travel2007">*</a></sup>'; } print '</td>'; } }
function display_stats_line_house($house, $category, $blurb, $type, $inwhat, $extra_info, $minister, $afterstuff) { if ($category == 'wrans_asked_inlastyear' || $category == 'debate_sectionsspoken_inlastyear' || $category =='comments_on_speeches' || $category == 'Lwrans_asked_inlastyear' || $category == 'Ldebate_sectionsspoken_inlastyear' || $category =='Lcomments_on_speeches') { if ($extra_info[$category]==0) { $blurb = preg_replace('#<a.*?>#', '', $blurb); $inwhat = preg_replace('#<\/a>#', '', $inwhat); } } if ($house==2) $inwhat = str_replace('MP', 'Lord', $inwhat); print '<li>' . $blurb; print '<strong>' . $extra_info[$category]; if ($type) print ' ' . make_plural($type, $extra_info[$category]); print '</strong>'; print $inwhat; if ($minister===2) { print ' — Speakers/ deputy speakers do not ask written questions'; } elseif ($minister) print ' — Ministers do not ask written questions'; else { $type = ($house==1?'MP':($house==2?'Lord':'MLA')); if (!get_http_var('rem') && isset($extra_info[$category . '_quintile'])) { print ' — '; $q = $extra_info[$category . '_quintile']; if ($q == 0) { print 'well above average'; } elseif ($q == 1) { print 'above average'; } elseif ($q == 2) { print 'average'; } elseif ($q == 3) { print 'below average'; } elseif ($q == 4) { print 'well below average'; } else { print '[Impossible quintile!]'; } print ' amongst '; print $type . 's'; } elseif (!get_http_var('rem') && isset($extra_info[$category . '_rank'])) { print ' — '; #if (isset($extra_info[$category . '_rank_joint'])) # print 'joint '; print make_ranking($extra_info[$category . '_rank']) . ' out of ' . $extra_info[$category . '_rank_outof']; print ' ' . $type . 's'; } } print ".$afterstuff"; return true; }
href="<?php echo $row['listurl']; ?> " class="business-list__title"> <h3> <?php echo $row['body']; ?> </h3> </a> <p class="business-list__meta"> <?php if (isset($row['sitting'])) { ?> <?php echo make_ranking($row['sitting']); ?> sitting · <?php } ?> <?php echo format_date($row['hdate'], LONGERDATEFORMAT); ?> <?php if ($row['contentcount'] > 0) { ?> · <?php echo $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches'; ?> <?php
function video_front_page() { $db = new ParlDB; $statuses = array( 0 => 'Unstamped', 4 => 'Timestamped by users', ); $q = $db->query('select video_status&4 as checked,count(*) as c from hansard where major=1 and video_status>0 and video_status<8 and video_status!=2 and htype in (12,13) group by video_status&4'); $totaliser = array(0=>0, 4=>0); for ($i=0; $i<$q->rows(); $i++) { $status = $q->field($i, 'checked'); $count = $q->field($i, 'c'); $totaliser[$status] = $count; } $percentage = round($totaliser[4] / ($totaliser[0]+$totaliser[4]) * 10000) / 100; $out = "$totaliser[4] timestamped out of " . ($totaliser[0] + $totaliser[4]) . " ($percentage%)" ?> <p style="margin-top:1em"><big>TheyWorkForYou has video of the House of Commons from the BBC, and the text of Hansard from Parliament. Now we need <strong>your</strong> help to match up the two.</big></p> <p>We've written a little Flash app where you can (hopefully) match up the written speech being displayed to what's playing on the video. We'll then store your results and use them to put the video, timestamped to the right location, on the relevant page of TheyWorkForYou.</p> <p>If you're a registered user and logged in, your timestampings will appear in our chart below – there may be prizes for best timestampers… :) Registration is not needed to timestamp videos, but you can <a href="/user/?pg=join&ret=/video/">register here</a> if you want.</p> <p id="video_attract"><? if ($totaliser[0]) { echo '<a href="next.php?action=random">Give me a random speech that needs timestamping</a>'; } else { echo 'Wow, everything that can currently be timestamped appears to have been, thanks!'; } ?></p> <div id="top" style="float: left; width: 45%;"> <? list($out_today, $rank_today) = display_league(20, 'and date(whenstamped)=current_date'); list($out_week, $rank_week) = display_league(40, 'and date(whenstamped)>current_date-interval 28 day'); list($out_overall, $rank_overall) = display_league(100); $out_overall = ''; global $THEUSER; if ($THEUSER->user_id() && ($rank_today || $rank_week || $rank_overall)) { echo '<p align="center"><big>You are '; if ($rank_today) echo make_ranking($rank_today), ' today, '; if ($rank_week) echo make_ranking($rank_week), ' last 4 weeks, '; if ($rank_overall) echo make_ranking($rank_overall), ' overall'; echo '</big></p>'; } if ($out_today) echo "<h3>Top timestampers (today)</h3> <ol>$out_today</ol>"; if ($out_week) echo "<h3>Top timestampers (last 4 weeks)</h3> <ol>$out_week</ol>"; if ($out_overall) echo "<h3>Top timestampers (overall)</h3> <ol>$out_overall</ol>"; echo '</div>'; ?> <div style="float: right; width: 50%"> <img align="right" width=200 height=100 src="http://chart.apis.google.com/chart?chs=200x100&cht=gom&chd=t:<?php echo $percentage; ?> " alt="<?php echo $percentage; ?> % of speeches have been timestamped"> <h3>Totaliser</h3> <ul><?php echo $out; ?> </ul> <? $q = $db->query('select video_status&4 as checked,count(*) as c from hansard where major=1 and video_status>0 and video_status<8 and video_status!=2 and htype in (12,13) and hdate=(select max(hdate) from hansard where major=1) group by video_status&4'); $totaliser = array(0=>0, 4=>0); for ($i=0; $i<$q->rows(); $i++) { $status = $q->field($i, 'checked'); $count = $q->field($i, 'c'); $totaliser[$status] = $count; } $total_possible = $totaliser[0] + $totaliser[4]; if ($total_possible == 0) { $percentage = 0; $out = 'Nothing possible to timestamp on most recent day'; } else { $percentage = round($totaliser[4] / $total_possible * 10000) / 100; $out = "$totaliser[4] timestamped out of $total_possible ($percentage%)"; } ?> <h3 style="padding-top:0.5em;clear:right">Totaliser for most recent day</h3> <img align="right" width=200 height=100 src="http://chart.apis.google.com/chart?chs=200x100&cht=gom&chd=t:<?php echo $percentage; ?> " alt="<?php echo $percentage; ?> % of speeches have been timestamped"> <ul><?php echo $out; ?> </ul> <h3 style="clear:both;margin-top:1em">Latest stamped</h3> <ul> <? $q = $db->query('select hansard.gid, body, major from video_timestamps, hansard, epobject where (user_id != -1 or user_id is null) and video_timestamps.deleted=0 and video_timestamps.gid = hansard.gid and hansard.subsection_id = epobject.epobject_id order by whenstamped desc limit 20'); for ($i=0; $i<$q->rows(); $i++) { $gid = $q->field($i, 'gid'); $body = $q->field($i, 'body'); if ($q->field($i, 'major') == 101) { $url = '/lords/?gid='; } else { $url = '/debate/?id='; } echo '<li><a href="', $url, fix_gid_from_db($gid) . '">' . $body . '</a>'; } echo '</ul></div>'; }
function expenses_extra_travel($extra_info, $year) { $out = '<p class="extra-travel-info"><a name="travel' . $year . '"></a><sup>' . (2010 - $year) . '</sup> <small>'; $regular_travel_header = FALSE; foreach (array('a' => 'Mileage', 'b' => 'Rail', 'c' => 'Air', 'd' => 'Misc') as $let => $desc) { $travel_field = $extra_info['expenses' . $year . '_colmp_reg_travel_' . $let]; if ($travel_field > 0) { if ($regular_travel_header == FALSE) { $out .= 'Regular journeys between home/constituency/Westminster: '; } $regular_travel_header = TRUE; $out .= $desc . ' £' . number_format(str_replace(',', '', $travel_field)); if (isset($extra_info['expenses' . $year . '_colmp_reg_travel_' . $let . '_rank'])) { $out .= ' (' . make_ranking($extra_info['expenses' . $year . '_colmp_reg_travel_' . $let . '_rank']) . ')'; } $out .= '. '; } } $other_travel_header = FALSE; foreach (array('a' => 'Mileage', 'b' => 'Rail', 'c' => 'Air', 'd' => 'European') as $let => $desc) { $travel_field = $extra_info['expenses' . $year . '_colmp_other_travel_' . $let]; if ($travel_field > 0) { if ($other_travel_header == FALSE) { $out .= 'Other: '; } $other_travel_header = TRUE; $out .= $desc . ' £' . number_format(str_replace(',', '', $travel_field)); if (isset($extra_info['expenses' . $year . '_colmp_other_travel_' . $let . '_rank'])) { $out .= ' (' . make_ranking($extra_info['expenses' . $year . '_colmp_other_travel_' . $let . '_rank']) . ')'; } $out .= '. '; } } $out .= '</small></p>'; return $out; }
function expenses_item($ey, $col, $extra_info) { $k = 'expenses' . $ey . '_' . $col; $kr = $k . '_rank'; if (isset($extra_info[$k])) { $amount = '£' . number_format(str_replace(',', '', $extra_info[$k])); } elseif ($col == 'col7a' or $col == 'colfamily_travel_a' or $col == 'colspouse_travel_a' or $col == 'colcomms_allowance') { $amount = 'N/A'; } else { $amount = ''; } $rank = ''; if (isset($extra_info[$kr]) && isset($extra_info[$k]) && $extra_info[$k] > 0) { $rank = ' ('; if (isset($extra_info[$kr . '_joint'])) { $rank .= 'joint '; } $rank .= make_ranking($extra_info[$kr]) . ")"; } $extra = ''; if ($col == 'col5' && $ey == 2007 && isset($extra_info['expenses2007_col5a']) && $extra_info['expenses2007_col5'] > 0) { $extra = '<sup><a href="#travel2007">**</a></sup>'; } if ($col == 'col5' && $ey == 2008 && isset($extra_info['expenses2008_colmp_reg_travel_a']) && $extra_info['expenses2008_col5'] > 0) { $extra = '<sup><a href="#travel2008">*</a></sup>'; } return array($amount, $rank, $extra); }
function display_member($member, $extra_info) { global $THEUSER, $DATA, $this_page; #$title = ucfirst($member['full_name']); /* if (isset($extra_info["public_whip_dreammp996_distance"])) { $dmpscore = floatval($extra_info["public_whip_dreammp996_distance"]); $strongly_foi = "voted " . score_to_strongly(1.0 - $dmpscore); } if ($extra_info["public_whip_dreammp996_both_voted"] == 0) { $strongly_foi = "has never voted on"; } $this->block_start(array('id'=>'black', 'title'=>"Freedom of Information and Parliament")); print "<p>There is currently a Bill before Parliament which will make Parliament exempt from Freedom of Information requests. This Bill will remove your legal right to see some of the information on this page, notably expenses, replacing it with a weaker promise that could be retracted later.</p> <p>Even if this bill is amended to exclude expenses, exemption from the Freedom of Information Act may prevent TheyWorkForYou from adding useful information of new sorts in the future. The Bill is not backed or opposed by a specific party, and TheyWorkForYou remains strictly neutral on all issues that do not affect our ability to serve the public.</p> <p><a href=\"somewhere\">Join the Campaign to keep Parliament transparent (external)</a>.</p>"; print 'For your information, '.$title.' MP <a href="http://www.publicwhip.org.uk/mp.php?mpid='.$member['member_id'].'&dmp=996">'.$strongly_foi.'</a> this Bill.'; $this->block_end(); */ if (isset($extra_info["is_speaker_candidate"]) && $extra_info["is_speaker_candidate"] == 1 && isset($extra_info["speaker_candidate_contacted_on"]) || isset($extra_info['speaker_candidate_response']) && $extra_info['speaker_candidate_response']) { $just_response = false; if ($extra_info['is_speaker_candidate'] == 0) { $just_response = true; } // days since originally contacted $contact_date_string = $extra_info["speaker_candidate_contacted_on"]; $contact_date_midnight = strtotime($contact_date_string); $days_since_contact = floor((time() - $contact_date_midnight) / 86400); if ($days_since_contact == 1) { $days_since_string = $days_since_contact . ' day ago'; } elseif ($days_since_contact > 1) { $days_since_string = $days_since_contact . ' days ago'; } else { $days_since_string = 'today'; } $reply_time = "*unknown*"; if (isset($extra_info["speaker_candidate_replied_on"])) { $reply_date_string = $extra_info["speaker_candidate_replied_on"]; $reply_date_midnight = strtotime($reply_date_string); $days_for_reply = floor(($reply_date_midnight - $contact_date_midnight) / 86400); if ($days_for_reply == 0) { $reply_time = "in less than 24 hours"; } elseif ($days_for_reply == 1) { $reply_time = "in 1 day"; } else { $reply_time = "in {$days_for_reply} days"; } } if ($just_response) { $spk_cand_title = $member['full_name'] . ' endorses our Speaker principles'; } else { if (isset($extra_info["speaker_candidate_elected"]) && $extra_info["speaker_candidate_elected"] == 1) { $spk_cand_title = 'LATEST: ' . $member['full_name'] . ' elected Speaker. Here\'s what he endorsed:'; } else { $spk_cand_title = 'IMPORTANT: ' . $member['full_name'] . ' was a Candidate for Speaker.'; } } $this->block_start(array('id' => 'campaign_block', 'title' => $spk_cand_title)); if (!isset($extra_info["speaker_candidate_response"])) { print "\n You can help make sure that all the candidates understand that they\n must be a strong, Internet-savvy proponents of a better, more\n accountable era of democracy."; } print "</p>\n\n <p>mySociety asked likely candidates for the post of Speaker to endorse the\n following principles."; print "<p><strong>The three principles are:</strong></p>\n\n <ol>\n\n <li> Voters have the right to know in <strong>detail about the money</strong> that is spent to\n support MPs and run Parliament, and in similar detail how the decisions to\n spend that money are settled upon. </li>\n\n <li> Bills being considered must be published online in a much better way than\n they are now, as the <strong>Free Our Bills</strong> campaign has been suggesting for some time. </li>\n\n <li> The Internet is not a threat to a renewal in our democracy, it is one of\n its best hopes. Parliament should appoint a senior officer with direct working\n experience of the <strong>power of the Internet</strong> who reports directly to the Speaker,\n and who will help Parliament adapt to a new era of transparency and\n effectiveness. </li>\n\n </ol>"; if (isset($extra_info["speaker_candidate_response"]) && $extra_info["speaker_candidate_response"]) { print "</p><p><strong><big>Update: " . $member['full_name'] . " MP replied {$reply_time}. " . $extra_info["speaker_candidate_response_summary"] . " Here's the reply in full: </big></strong></p>"; print "<blockquote><div id='speaker_candidate_response'>"; print $extra_info["speaker_candidate_response"]; print "</div></blockquote>"; } else { print "<p> We contacted " . $member['full_name'] . " MP to ask for an endorsement " . $days_since_string . ". "; print "They have not yet replied.</p>"; } $this->block_end(); } $is_lord = false; foreach ($member['houses'] as $house) { if ($house == 2) { $is_lord = true; } continue; if (!$member['current_member'][$house]) { $title .= ', former'; } if ($house == 1) { $title .= ' MP'; } if ($house == 3) { $title .= ' MLA'; } if ($house == 4) { $title .= ' MSP'; } } #if ($rssurl = $DATA->page_metadata($this_page, 'rss')) { # $title = '<a href="' . WEBPATH . $rssurl . '"><img src="' . WEBPATH . 'images/rss.gif" alt="RSS feed" border="0" align="right"></a> ' . $title; #} print '<p class="printonly">This data was produced by TheyWorkForYou from a variety of sources.</p>'; //get the correct image (with special case for lords) if ($is_lord) { list($image, $sz) = find_rep_image($member['person_id'], false, 'lord'); } else { list($image, $sz) = find_rep_image($member['person_id'], false, true); } //show image echo '<p class="person">'; echo '<img class="portrait" alt="Photo of ', $member['full_name'], '" src="', $image, '"'; if ($sz == 'S') { echo ' height="118"'; } echo '></p>'; //work out person's description $desc = ''; $last_item = end($member['houses']); foreach ($member['houses'] as $house) { if ($house == 0) { $desc .= '<li><strong>Acceded on '; $desc .= $member['entered_house'][0]['date_pretty']; $desc .= '</strong></li>'; $desc .= '<li><strong>Coronated on 2 June 1953</strong></li>'; continue; } $party = $member['left_house'][$house]['party']; if ($house == 1 && isset($member['entered_house'][2])) { continue; } # Same info is printed further down if (!$member['current_member'][$house]) { $desc .= 'Former '; } $party_br = ''; if (preg_match('#^(.*?)\\s*\\((.*?)\\)$#', $party, $m)) { $party_br = $m[2]; $party = $m[1]; } if ($party != 'unknown') { $desc .= htmlentities($party); } if ($party == 'Speaker' || $party == 'Deputy Speaker') { $desc .= ', and '; # XXX: Will go horribly wrong if something odd happens if ($party == 'Deputy Speaker') { $last = end($member['other_parties']); $desc .= $last['from'] . ' '; } } if ($house == 1 || $house == 3 || $house == 4) { $desc .= ' '; if ($house == 1) { $desc .= 'MP'; } if ($house == 3) { $desc .= 'MLA'; } if ($house == 4) { $desc .= 'MSP'; } if ($party_br) { $desc .= " ({$party_br})"; } $desc .= ' for ' . $member['left_house'][$house]['constituency']; } if ($house == 2 && $party != 'Bishop') { $desc .= ' Peer'; } if ($house != $last_item) { $desc .= ', '; } } //headings echo '<h2>' . $member['full_name'] . '</h2>'; echo '<h3>' . $desc . '</h3>'; //History echo '<ul class="hilites">'; if ($member['other_constituencies']) { print "<li>Also represented " . join('; ', array_keys($member['other_constituencies'])); print '</li>'; } if ($member['other_parties'] && $member['party'] != 'Speaker' && $member['party'] != 'Deputy Speaker') { print "<li>Changed party "; foreach ($member['other_parties'] as $r) { $out[] = 'from ' . $r['from'] . ' on ' . format_date($r['date'], SHORTDATEFORMAT); } print join('; ', $out); print '</li>'; } // Ministerial position if (array_key_exists('office', $extra_info)) { $mins = array(); foreach ($extra_info['office'] as $row) { if ($row['to_date'] == '9999-12-31' && $row['source'] != 'chgpages/selctee') { $m = prettify_office($row['position'], $row['dept']); $m .= ' (since ' . format_date($row['from_date'], SHORTDATEFORMAT) . ')'; $mins[] = $m; } } if ($mins) { print '<li>' . join('<br>', $mins) . '</li>'; } } echo '<br class="clear">'; //if dummy image, show message asking for a photo if (!exists_rep_image($member['person_id'])) { // For MPs, prompt for photo echo '<p class="missingphoto">'; if ($member['current_member_anywhere']) { echo 'Help, we\'re missing a photo of ' . $member['full_name'] . '! If you are ' . $member['full_name'] . ', or have a photo of them (that you have copyright of) <a href="mailto:team@theyworkforyou.com">please email it to us</a>.'; } else { echo 'Help, we\'re missing a photo of ' . $member['full_name'] . '! If have a photo of them (that you have copyright of), or can locate a copyright free photo of them <a href="mailto:team@theyworkforyou.com">please email it to us</a>.'; } echo '</p>'; } if (isset($member['left_house'][1]) && isset($member['entered_house'][2])) { print '<li><strong>Entered the House of Lords '; if (strlen($member['entered_house'][2]['date_pretty']) == 4) { print 'in '; } else { print 'on '; } print $member['entered_house'][2]['date_pretty'] . '</strong>'; print '</strong>'; if ($member['entered_house'][2]['reason']) { print ' — ' . $member['entered_house'][2]['reason']; } print '</li>'; print '<li><strong>Previously MP for '; print $member['left_house'][1]['constituency'] . ' until '; print $member['left_house'][1]['date_pretty'] . '</strong>'; if ($member['left_house'][1]['reason']) { print ' — ' . $member['left_house'][1]['reason']; } print '</li>'; } elseif (isset($member['entered_house'][2]['date'])) { print '<li><strong>Became a Lord '; if (strlen($member['entered_house'][2]['date_pretty']) == 4) { print 'in '; } else { print 'on '; } print $member['entered_house'][2]['date_pretty'] . '</strong>'; if ($member['entered_house'][2]['reason']) { print ' — ' . $member['entered_house'][2]['reason']; } print '</li>'; } if (in_array(2, $member['houses']) && !$member['current_member'][2]) { print '<li><strong>Left Parliament on ' . $member['left_house'][2]['date_pretty'] . '</strong>'; if ($member['left_house'][2]['reason']) { print ' — ' . $member['left_house'][2]['reason']; } print '</li>'; } if (isset($extra_info['lordbio'])) { echo '<li><strong>Positions held at time of appointment:</strong> ', $extra_info['lordbio'], ' <small>(from <a href="', $extra_info['lordbio_from'], '">Number 10 press release</a>)</small></li>'; } if (isset($member['entered_house'][1]['date'])) { print '<li><strong>Entered Parliament on '; print $member['entered_house'][1]['date_pretty'] . '</strong>'; if ($member['entered_house'][1]['reason']) { print ' — ' . $member['entered_house'][1]['reason']; } print '</li>'; } if (in_array(1, $member['houses']) && !$member['current_member'][1] && !isset($member['entered_house'][2])) { print '<li><strong>Left Parliament '; if (strlen($member['left_house'][1]['date_pretty']) == 4) { print 'in '; } else { print 'on '; } echo $member['left_house'][1]['date_pretty'] . '</strong>'; if ($member['left_house'][1]['reason']) { print ' — ' . $member['left_house'][1]['reason']; } print '</li>'; } if (isset($member['entered_house'][3]['date'])) { print '<li><strong>Entered the Assembly on '; print $member['entered_house'][3]['date_pretty'] . '</strong>'; if ($member['entered_house'][3]['reason']) { print ' — ' . $member['entered_house'][3]['reason']; } print '</li>'; } if (in_array(3, $member['houses']) && !$member['current_member'][3]) { print '<li><strong>Left the Assembly on ' . $member['left_house'][3]['date_pretty'] . '</strong>'; if ($member['left_house'][3]['reason']) { print ' — ' . $member['left_house'][3]['reason']; } print '</li>'; } if (isset($member['entered_house'][4]['date'])) { print '<li><strong>Entered the Scottish Parliament on '; print $member['entered_house'][4]['date_pretty'] . '</strong>'; if ($member['entered_house'][4]['reason']) { print ' — ' . $member['entered_house'][4]['reason']; } print '</li>'; } if (in_array(4, $member['houses']) && !$member['current_member'][4]) { print '<li><strong>Left the Scottish Parliament on ' . $member['left_house'][4]['date_pretty'] . '</strong>'; if ($member['left_house'][4]['reason']) { print ' — ' . $member['left_house'][4]['reason']; } print '</li>'; } if (isset($extra_info['majority_in_seat'])) { ?> <li><strong>Majority:</strong> <?php echo number_format($extra_info['majority_in_seat']); ?> votes. <?php if (isset($extra_info['swing_to_lose_seat_today'])) { /* if (isset($extra_info['swing_to_lose_seat_today_quintile'])) { $q = $extra_info['swing_to_lose_seat_today_quintile']; if ($q == 0) { print 'Very safe seat'; } elseif ($q == 1) { print 'Safe seat'; } elseif ($q == 2) { print ''; } elseif ($q == 3) { print 'Unsafe seat'; } elseif ($q == 4) { print 'Very unsafe seat'; } else { print '[Impossible quintile!]'; } } */ print ' — ' . make_ranking($extra_info['swing_to_lose_seat_today_rank']); ?> out of <?php echo $extra_info['swing_to_lose_seat_today_rank_outof']; ?> MPs. <?php } ?> </li> <?php } if ($member['party'] == 'Sinn Fein' && in_array(1, $member['houses'])) { print '<li>Sinn Féin MPs do not take their seats in Parliament</li>'; } print "</ul>"; print '<br class="clear"/>'; print "<ul class=\"hilites\">"; if ($member['the_users_mp'] == true) { $pc = $THEUSER->postcode(); ?> <li><a href="http://www.writetothem.com/?a=WMC&pc=<?php echo htmlentities(urlencode($pc)); ?> "><strong>Send a message to <?php echo $member['full_name']; ?> </strong></a> (only use this for <em>your</em> MP) <small>(via WriteToThem.com)</small></li> <li><a href="http://www.hearfromyourmp.com/?pc=<?php echo htmlentities(urlencode($pc)); ?> "><strong>Get messages from your MP</strong></a> <small>(via HearFromYourMP)</small></strong></a></li> <?php } elseif ($member['current_member'][1]) { ?> <li><a href="http://www.writetothem.com/"><strong>Send a message to your MP</strong></a> <small>(via WriteToThem.com)</small></li> <li><a href="http://www.hearfromyourmp.com/"><strong>Sign up to <em>HearFromYourMP</em></strong></a> to get messages from your MP</li> <?php } elseif ($member['current_member'][3]) { ?> <li><a href="http://www.writetothem.com/"><strong>Send a message to your MLA</strong></a> <small>(via WriteToThem.com)</small></li> <?php } elseif ($member['current_member'][4]) { ?> <li><a href="http://www.writetothem.com/"><strong>Send a message to your MSP</strong></a> <small>(via WriteToThem.com)</small></li> <?php } elseif ($member['current_member'][2]) { ?> <li><a href="http://www.writetothem.com/?person=uk.org.publicwhip/person/<?php echo $member['person_id']; ?> "><strong>Send a message to <?php echo $member['full_name']; ?> </strong></a> <small>(via WriteToThem.com)</small></li> <?php } # If they're currently an MLA, a Lord or a non-Sinn Fein MP if ($member['current_member'][0] || $member['current_member'][2] || $member['current_member'][3] || $member['current_member'][1] && $member['party'] != 'Sinn Fein' || $member['current_member'][4]) { print '<li><a href="' . WEBPATH . 'alert/?only=1&pid=' . $member['person_id'] . '"><strong>Email me whenever ' . $member['full_name'] . ' speaks</strong></a> (no more than once per day)</li>'; } # Video if ($member['current_member'][1] && $member['party'] != 'Sinn Fein') { echo '<li>Help us add video by <a href="/video/next.php?action=random&pid=' . $member['person_id'] . '"><strong>matching a speech by ' . $member['full_name'] . '</strong></a>'; } ?> </ul> <ul class="jumpers hilites"> <?php if (in_array(1, $member['houses']) && $member['party'] != 'Sinn Fein' || in_array(2, $member['houses'])) { echo '<li><a href="#votingrecord">Voting record</a></li>'; if ($member['current_member'][1]) { echo '<li><a href="#topics">Committees and topics of interest</a></li>'; } } if (!in_array(1, $member['houses']) || $member['party'] != 'Sinn Fein' || in_array(3, $member['houses'])) { echo '<li><a href="#hansard">Most recent appearances</a></li>'; } echo '<li><a href="#numbers">Numerology</a></li>'; if (isset($extra_info['register_member_interests_html'])) { echo '<li><a href="#register">Register of Members’ Interests</a></li>'; } if (isset($extra_info['expenses2004_col1']) || isset($extra_info['expenses2006_col1']) || isset($extra_info['expenses2007_col1']) || isset($extra_info['expenses2008_col1'])) { echo '<li><a href="#expenses">Expenses</a></li>'; } if (isset($extra_info['edm_ais_url'])) { ?> <li><a href="<?php echo $extra_info['edm_ais_url']; ?> ">Early Day Motions signed by this MP</a> <small>(From edmi.parliament.uk)</small></li> <?php } ?> </ul> <?php # Big don't-print for SF MPs $chairmens_panel = false; if (in_array(1, $member['houses']) && $member['party'] != 'Sinn Fein' || in_array(2, $member['houses'])) { // Voting Record. ?> <a name="votingrecord"></a> <?php //$this->block_start(array('id'=>'votingrecord', 'title'=>'Voting record (from PublicWhip)')); print '<h4>Voting record (from PublicWhip)</h4>'; $displayed_stuff = 0; function display_dream_comparison($extra_info, $member, $dreamid, $desc, $inverse, $search) { if (isset($extra_info["public_whip_dreammp{$dreamid}_distance"])) { if ($extra_info["public_whip_dreammp{$dreamid}_both_voted"] == 0) { $dmpdesc = 'Has <strong>never voted</strong> on'; } else { $dmpscore = floatval($extra_info["public_whip_dreammp{$dreamid}_distance"]); print "<!-- distance {$dreamid}: {$dmpscore} -->"; if ($inverse) { $dmpscore = 1.0 - $dmpscore; } $english = score_to_strongly($dmpscore); if ($extra_info["public_whip_dreammp{$dreamid}_both_voted"] == 1) { $english = preg_replace('#(very )?(strongly|moderately) #', '', $english); } $dmpdesc = 'Voted <strong>' . $english . '</strong>'; // How many votes Dream MP and MP both voted (and didn't abstain) in // $extra_info["public_whip_dreammp${dreamid}_both_voted"]; } $search_link = WEBPATH . "search/?s=" . urlencode($search) . "&pid=" . $member['person_id'] . "&pop=1"; ?> <li> <?php echo $dmpdesc; ?> <?php echo $desc; ?> . <small class="unneededprintlinks"> <a href="http://www.publicwhip.org.uk/mp.php?mpid=<?php echo $member['member_id']; ?> &dmp=<?php echo $dreamid; ?> ">votes</a>, <a href="<?php echo $search_link; ?> ">speeches</a> </small> </li> <?php return true; } return false; } if ($member['party'] == 'Speaker' || $member['party'] == 'Deputy Speaker') { if ($member['party'] == 'Speaker') { $art = 'the'; } else { $art = 'a'; } echo "<p>As {$art} {$member['party']}, {$member['full_name']} cannot vote (except to break a tie).</p>"; } if (isset($extra_info["public_whip_dreammp230_distance"]) || isset($extra_info["public_whip_dreammp996_distance"])) { # XXX $displayed_stuff = 1; ?> <p id="howvoted">How <?php echo $member['full_name']; ?> voted on key issues since 2001:</p> <ul id="dreamcomparisons"> <?php $got_dream = false; $got_dream |= display_dream_comparison($extra_info, $member, 996, "a <strong>transparent Parliament</strong>", false, '"freedom of information"'); if (in_array(1, $member['houses'])) { $got_dream |= display_dream_comparison($extra_info, $member, 811, "introducing a <strong>smoking ban</strong>", false, "smoking"); } #$got_dream |= display_dream_comparison($extra_info, $member, 856, "the <strong>changes to parliamentary scrutiny in the <a href=\"http://en.wikipedia.org/wiki/Legislative_and_Regulatory_Reform_Bill\">Legislative and Regulatory Reform Bill</a></strong>", false, "legislative and regulatory reform bill"); $got_dream |= display_dream_comparison($extra_info, $member, 1051, "introducing <strong>ID cards</strong>", false, "id cards"); $got_dream |= display_dream_comparison($extra_info, $member, 363, "introducing <strong>foundation hospitals</strong>", false, "foundation hospital"); $got_dream |= display_dream_comparison($extra_info, $member, 1052, "introducing <strong>student top-up fees</strong>", false, "top-up fees"); if (in_array(1, $member['houses'])) { $got_dream |= display_dream_comparison($extra_info, $member, 1053, "Labour's <strong>anti-terrorism laws</strong>", false, "terrorism"); } $got_dream |= display_dream_comparison($extra_info, $member, 1049, "the <strong>Iraq war</strong>", false, "iraq"); $got_dream |= display_dream_comparison($extra_info, $member, 975, "an <strong>investigation</strong> into the Iraq war", false, "iraq"); $got_dream |= display_dream_comparison($extra_info, $member, 984, "replacing <strong>Trident</strong>", false, "trident"); $got_dream |= display_dream_comparison($extra_info, $member, 1050, "the <strong>hunting ban</strong>", false, "hunting"); $got_dream |= display_dream_comparison($extra_info, $member, 826, "equal <strong>gay rights</strong>", false, "gay"); $got_dream |= display_dream_comparison($extra_info, $member, 1030, "laws to <strong>stop climate change</strong>", false, "climate change"); if (!$got_dream) { print "<li>" . $member['full_name'] . " has not voted enough in this parliament to have any scores.</li>"; } print '</ul>'; ?> <p class="italic"> <small>Read about <a href="<?php echo WEBPATH; ?> help/#votingrecord">how the voting record is decided</a>.</small> </p> <?php } ?> <?php // Links to full record at Guardian and Public Whip $record = array(); if (isset($extra_info['guardian_howtheyvoted'])) { $record[] = '<a href="' . $extra_info['guardian_howtheyvoted'] . '" title="At The Guardian">well-known issues</a> <small>(from the Guardian)</small>'; } if (isset($extra_info['public_whip_division_attendance']) && $extra_info['public_whip_division_attendance'] != 'n/a') { $record[] = '<a href="http://www.publicwhip.org.uk/mp.php?id=uk.org.publicwhip/member/' . $member['member_id'] . '&showall=yes#divisions" title="At Public Whip">their full record</a>'; } if (count($record) > 0) { $displayed_stuff = 1; ?> <p>More on <?php echo implode(' & ', $record); ?> </p> <?php } // Rebellion rate if (isset($extra_info['public_whip_rebellions']) && $extra_info['public_whip_rebellions'] != 'n/a') { $displayed_stuff = 1; ?> <ul> <li><a href="http://www.publicwhip.org.uk/mp.php?id=uk.org.publicwhip/member/<?php echo $member['member_id']; ?> #divisions" title="See more details at Public Whip"> <strong><?php echo htmlentities(ucfirst($extra_info['public_whip_rebel_description'])); ?> rebels</strong></a> against their party<?php if (isset($extra_info['public_whip_rebelrank'])) { echo " in this parliament"; /* — "; if (isset($extra_info['public_whip_rebelrank_joint'])) print 'joint '; echo make_ranking($extra_info['public_whip_rebelrank']); echo " most rebellious of "; echo $extra_info['public_whip_rebelrank_outof']; echo ($member['house']=='House of Commons') ? " MPs" : ' Lords'; */ } ?> . </li> </ul><?php } if (!$displayed_stuff) { print '<p>No data to display yet.</p>'; } # Topics of interest only for MPs at the moment if ($member['current_member'][1]) { # in_array(1, $member['houses']) ?> <a name="topics"></a> <h4>Committees and topics of interest</h4> <?php $topics_block_empty = true; // Select committee membership if (array_key_exists('office', $extra_info)) { $mins = array(); foreach ($extra_info['office'] as $row) { if ($row['to_date'] == '9999-12-31' && $row['source'] == 'chgpages/selctee') { $m = prettify_office($row['position'], $row['dept']); if ($row['from_date'] != '2004-05-28') { $m .= ' <small>(since ' . format_date($row['from_date'], SHORTDATEFORMAT) . ')</small>'; } $mins[] = $m; if ($row['dept'] == "Chairmen's Panel Committee") { $chairmens_panel = true; } } } if ($mins) { print "<h5>Select Committee membership</h5>"; print "<ul>"; foreach ($mins as $min) { print '<li>' . $min . '</li>'; } print "</ul>"; $topics_block_empty = false; } } $wrans_dept = false; $wrans_dept_1 = null; $wrans_dept_2 = null; if (isset($extra_info['wrans_departments'])) { $wrans_dept = true; $wrans_dept_1 = "<li><strong>Departments:</strong> " . $extra_info['wrans_departments'] . "</p>"; } if (isset($extra_info['wrans_subjects'])) { $wrans_dept = true; $wrans_dept_2 = "<li><strong>Subjects (based on headings added by Hansard):</strong> " . $extra_info['wrans_subjects'] . "</p>"; } if ($wrans_dept) { print "<p><strong>Asks most questions about</strong></p>"; print "<ul>"; if ($wrans_dept_1) { print $wrans_dept_1; } if ($wrans_dept_2) { print $wrans_dept_2; } print "</ul>"; $topics_block_empty = false; $WRANSURL = new URL('search'); $WRANSURL->insert(array('pid' => $member['person_id'], 's' => 'section:wrans', 'pop' => 1)); ?> <p><small>(based on <a href="<?php echo $WRANSURL->generate(); ?> ">written questions asked by <?php echo $member['full_name']; ?> </a> and answered by departments)</small></p><?php } # Public Bill Committees if (count($extra_info['pbc'])) { $topics_block_empty = false; print '<h5>Public Bill Committees <small>(sittings attended)</small></h5>'; if ($member['party'] == 'Scottish National Party') { echo '<p><em>SNP MPs only attend sittings where the legislation pertains to Scotland.</em></p>'; } echo '<ul>'; foreach ($extra_info['pbc'] as $bill_id => $arr) { print '<li>'; if ($arr['chairman']) { print 'Chairman, '; } print '<a href="/pbc/' . $arr['session'] . '/' . urlencode($arr['title']) . '">' . $arr['title'] . ' Committee</a> <small>(' . $arr['attending'] . ' out of ' . $arr['outof'] . ')</small>'; } print '</ul>'; } if ($topics_block_empty) { print "<p><em>This MP is not currently on any select or public bill committee\nand has had no written questions answered for which we know the department or subject.</em></p>"; } } } if (!in_array(1, $member['houses']) || $member['party'] != 'Sinn Fein' || in_array(3, $member['houses'])) { ?> <a name="hansard"></a> <?php $title = 'Most recent appearances'; if ($rssurl = $DATA->page_metadata($this_page, 'rss')) { $title = '<a href="' . WEBPATH . $rssurl . '"><img src="' . WEBPATH . 'images/rss.gif" alt="RSS feed" border="0" align="right"></a> ' . $title; } print "<h4>{$title}</h4>"; //$this->block_start(array('id'=>'hansard', 'title'=>$title)); // This is really far from ideal - I don't really want $PAGE to know // anything about HANSARDLIST / DEBATELIST / WRANSLIST. // But doing this any other way is going to be a lot more work for little // benefit unfortunately. twfy_debug_timestamp(); $HANSARDLIST = new HANSARDLIST(); $searchstring = "speaker:{$member['person_id']}"; global $SEARCHENGINE; $SEARCHENGINE = new SEARCHENGINE($searchstring); $args = array('s' => $searchstring, 'p' => 1, 'num' => 3, 'pop' => 1, 'o' => 'd'); $HANSARDLIST->display('search_min', $args); twfy_debug_timestamp(); $MOREURL = new URL('search'); $MOREURL->insert(array('pid' => $member['person_id'], 'pop' => 1)); ?> <p id="moreappear"><a href="<?php echo $MOREURL->generate(); ?> #n4">More of <?php echo ucfirst($member['full_name']); ?> 's recent appearances</a></p> <?php if ($rssurl = $DATA->page_metadata($this_page, 'rss')) { // If we set an RSS feed for this page. $HELPURL = new URL('help'); ?> <p class="unneededprintlinks"><a href="<?php echo WEBPATH . $rssurl; ?> " title="XML version of this person's recent appearances">RSS feed</a> (<a href="<?php echo $HELPURL->generate(); ?> #rss" title="An explanation of what RSS feeds are for">?</a>)</p> <?php } // $this->block_end(); } # End Sinn Fein ?> <a name="numbers"></a> <?php //$this->block_start(array('id'=>'numbers', 'title'=>'Numerology')); print "<h4>Numerology</h4>"; $displayed_stuff = 0; ?> <p><em>Please note that numbers do not measure quality. Also, representatives may do other things not currently covered by this site.</em> (<a href="<?php echo WEBPATH; ?> help/#numbers">More about this</a>)</p> <ul> <?php $since_text = 'in the last year'; #if ($member['entered_house'] > '2005-05-05') # $since_text = 'since joining Parliament'; $MOREURL = new URL('search'); $section = 'section:debates section:whall section:lords section:ni'; $MOREURL->insert(array('pid' => $member['person_id'], 's' => $section, 'pop' => 1)); if ($member['party'] != 'Sinn Fein') { $displayed_stuff |= display_stats_line('debate_sectionsspoken_inlastyear', 'Has spoken in <a href="' . $MOREURL->generate() . '">', 'debate', '</a> ' . $since_text, '', $extra_info); $MOREURL->insert(array('pid' => $member['person_id'], 's' => 'section:wrans', 'pop' => 1)); // We assume that if they've answered a question, they're a minister $minister = 0; $Lminister = false; if (isset($extra_info['wrans_answered_inlastyear']) && $extra_info['wrans_answered_inlastyear'] > 0 && $extra_info['wrans_asked_inlastyear'] == 0) { $minister = 1; } if (isset($extra_info['Lwrans_answered_inlastyear']) && $extra_info['Lwrans_answered_inlastyear'] > 0 && $extra_info['Lwrans_asked_inlastyear'] == 0) { $Lminister = true; } if ($member['party'] == 'Speaker' || $member['party'] == 'Deputy Speaker') { $minister = 2; } $displayed_stuff |= display_stats_line('wrans_asked_inlastyear', 'Has received answers to <a href="' . $MOREURL->generate() . '">', 'written question', '</a> ' . $since_text, '', $extra_info, $minister, $Lminister); } if (isset($extra_info['select_committees'])) { print "<li>Is a member of <strong>{$extra_info['select_committees']}</strong> select committee"; if ($extra_info['select_committees'] != 1) { print "s"; } if (isset($extra_info['select_committees_chair'])) { print " ({$extra_info['select_committees_chair']} as chair)"; } print '.</li>'; } $wtt_displayed = display_writetothem_numbers(2008, $extra_info); $displayed_stuff |= $wtt_displayed; if (!$wtt_displayed) { $wtt_displayed = display_writetothem_numbers(2007, $extra_info); $displayed_stuff |= $wtt_displayed; if (!$wtt_displayed) { $wtt_displayed = display_writetothem_numbers(2006, $extra_info); $displayed_stuff |= $wtt_displayed; if (!$wtt_displayed) { $displayed_stuff |= display_writetothem_numbers(2005, $extra_info); } } } $after_stuff = ' <small>(From Public Whip)</small>'; if ($member['party'] == 'Scottish National Party') { $after_stuff .= '<br><em>Note SNP MPs do not vote on legislation not affecting Scotland.</em>'; } elseif ($member['party'] == 'Speaker' || $member['party'] == 'Deputy Speaker') { $after_stuff .= '<br><em>Speakers and deputy speakers cannot vote except to break a tie.</em>'; } if ($member['party'] != 'Sinn Fein') { $displayed_stuff |= display_stats_line('public_whip_division_attendance', 'Has voted in <a href="http://www.publicwhip.org.uk/mp.php?id=uk.org.publicwhip/member/' . $member['member_id'] . '&showall=yes#divisions" title="See more details at Public Whip">', 'of vote', '</a> in parliament with this affiliation', $after_stuff, $extra_info); if ($chairmens_panel) { print '<br><em>Members of the Chairmen\'s Panel act for the Speaker when chairing things such as Public Bill Committees, and as such do not vote on Bills they are involved in chairing.</em>'; } $displayed_stuff |= display_stats_line('comments_on_speeches', 'People have made <a href="' . WEBPATH . 'comments/recent/?pid=' . $member['person_id'] . '">', 'annotation', "</a> on this MP’s speeches", '', $extra_info); $displayed_stuff |= display_stats_line('reading_age', 'This MP\'s speeches, in Hansard, are readable by an average ', '', ' year old, going by the <a href="http://en.wikipedia.org/wiki/Flesch-Kincaid_Readability_Test">Flesch-Kincaid Grade Level</a> score', '', $extra_info); } if (isset($extra_info['number_of_alerts'])) { $displayed_stuff = 1; ?> <li><strong><?php echo htmlentities($extra_info['number_of_alerts']); ?> </strong> <?php echo $extra_info['number_of_alerts'] == 1 ? 'person is' : 'people are'; ?> tracking whenever <?php if ($member['house_disp'] == 1) { print 'this MP'; } elseif ($member['house_disp'] == 2) { print 'this peer'; } elseif ($member['house_disp'] == 3) { print 'this MLA'; } elseif ($member['house_disp'] == 4) { print 'this MSP'; } elseif ($member['house_disp'] == 0) { print $member['full_name']; } ?> speaks<?php if ($member['current_member'][0] || $member['current_member'][2] || $member['current_member'][3] || $member['current_member'][1] && $member['party'] != 'Sinn Fein' || $member['current_member'][4]) { print ' — <a href="' . WEBPATH . 'alert/?only=1&pid=' . $member['person_id'] . '">email me whenever ' . $member['full_name'] . ' speaks</a>'; } print '.</li>'; } if ($member['party'] != 'Sinn Fein') { $displayed_stuff |= display_stats_line('three_word_alliterations', 'Has used three-word alliterative phrases (e.g. "she sells seashells") ', 'time', ' in debates', ' <small>(<a href="' . WEBPATH . 'help/#numbers">Why is this here?</a>)</small>', $extra_info); if (isset($extra_info['three_word_alliteration_content'])) { print "\n<!-- " . $extra_info['three_word_alliteration_content'] . " -->\n"; } } # $displayed_stuff |= display_stats_line('ending_with_a_preposition', "Has ended a sentence with 'with' ", 'time', ' in debates', '', $extra_info); # $displayed_stuff |= display_stats_line('only_asked_why', "Has made a speech consisting solely of 'Why?' ", 'time', ' in debates', '', $extra_info); ?> </ul> <?php if (!$displayed_stuff) { print '<p>No data to display yet.</p>'; } //$this->block_end(); if (isset($extra_info['register_member_interests_html'])) { ?> <a name="register"></a> <?php print "<h4>Register of Members' Interests</h4>"; if ($extra_info['register_member_interests_html'] != '') { echo $extra_info['register_member_interests_html']; } else { echo "\t\t\t\t<p>Nil</p>\n"; } echo '<p class="italic">'; if (isset($extra_info['register_member_interests_date'])) { echo 'Register last updated: '; echo format_date($extra_info['register_member_interests_date'], SHORTDATEFORMAT); echo '. '; } echo '<a href="http://www.publications.parliament.uk/pa/cm/cmregmem/061106/memi01.htm">More about the Register</a>'; echo '</p>'; print '<p><strong><a href="' . WEBPATH . 'regmem/?p=' . $member['person_id'] . '">View the history of this MP\'s entries in the Register</a></strong></p>'; } if (isset($extra_info['expenses2004_col1']) || isset($extra_info['expenses2006_col1']) || isset($extra_info['expenses2007_col1']) || isset($extra_info['expenses2008_col1'])) { include_once INCLUDESPATH . 'easyparliament/expenses.php'; ?> <a name="expenses"></a> <?php $title = 'Expenses'; print "<h4>" . $title . "</h4>"; echo expenses_display_table($extra_info); } }