コード例 #1
0
$data['party'] = $MEMBER->party_text();
$data['party_short'] = $MEMBER->party();
$data['current_member_anywhere'] = $MEMBER->current_member_anywhere();
$data['current_member'] = $MEMBER->current_member();
$data['the_users_mp'] = $MEMBER->the_users_mp();
$data['user_postcode'] = $THEUSER->postcode;
$data['houses'] = $MEMBER->houses();
$data['member_url'] = $MEMBER->url();
// If there's photo attribution information, copy it into data
foreach (['photo_attribution_text', 'photo_attribution_link'] as $key) {
    if (isset($MEMBER->extra_info[$key])) {
        $data[$key] = $MEMBER->extra_info[$key];
    }
}
$data['image'] = $MEMBER->image();
$data['member_summary'] = person_summary_description($MEMBER);
$data['enter_leave'] = $MEMBER->getEnterLeaveStrings();
$data['entry_date'] = $MEMBER->getEntryDate();
$data['is_new_mp'] = $MEMBER->isNew();
$data['other_parties'] = $MEMBER->getOtherPartiesString();
$data['other_constituencies'] = $MEMBER->getOtherConstituenciesString();
$data['rebellion_rate'] = person_rebellion_rate($MEMBER);
$data['recent_appearances'] = person_recent_appearances($MEMBER);
$data['useful_links'] = person_useful_links($MEMBER);
$data['topics_of_interest'] = person_topics($MEMBER);
$data['current_offices'] = $MEMBER->offices('current');
$data['previous_offices'] = $MEMBER->offices('previous');
$data['register_interests'] = person_register_interests($MEMBER, $MEMBER->extra_info);
# People who are or were MPs and Lords potentially have voting records, except Sinn Fein MPs
$data['has_voting_record'] = $MEMBER->house(HOUSE_TYPE_COMMONS) && $MEMBER->party() != 'SF' || $MEMBER->house(HOUSE_TYPE_LORDS);
# Everyone who is currently somewhere has email alert signup, apart from current Sinn Fein MPs who are not MLAs
コード例 #2
0
ファイル: person.php プロジェクト: nallachaitu/theyworkforyou
$member['has_expenses'] = isset($extra_info['expenses2004_col1']) || isset($extra_info['expenses2006_col1']) || isset($extra_info['expenses2007_col1']) || isset($extra_info['expenses2008_col1']);

# First, the special Speaker box.
# person_speaker_special($member, $extra_info);

# Heading/ picture
print '<p class="printonly">This data was produced by TheyWorkForYou from a variety of sources.</p>';

if ($member['has_email_alerts']) {
    print '<p class="informational alert">';
    print '<a href="' . WEBPATH . 'alert/?only=1&amp;pid='.$member['person_id'].'"><strong>Email me updates on '. $member['full_name']. '&rsquo;s activity</strong></a>
    <span>(no more than once per day)</span></p>';
}

person_image($member);
echo '<h1>' . $member['full_name'] . '<br><span>' . person_summary_description($member) . '</span></h1>';

# History
echo '<ul>';

	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);
コード例 #3
0
ファイル: person.php プロジェクト: sebbacon/theyworkforyou
# Special 2010 election bit
if (isset($member['left_house'][1]) && $member['left_house'][1]['date'] == '2010-04-12') {
    global $THEUSER;
    $bound_pc = '';
    if ($THEUSER->postcode_is_set()) {
        $bound_pc = '?pc=' . urlencode($THEUSER->postcode());
    }
    print '<p class="informational">Constituency boundaries are changing for this election.
<a href="/boundaries/' . $bound_pc . '">Find out what constituency you will be in</a>.
</p>';
}
# Heading/ picture
print '<p class="printonly">This data was produced by TheyWorkForYou from a variety of sources.</p>';
person_image($member);
echo '<h2>' . $member['full_name'] . '</h2>';
echo '<h3>' . person_summary_description($member) . '</h3>';
# History
echo '<ul>';
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 positions