• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP find_rep_image函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中find_rep_image函数的典型用法代码示例。如果您正苦于以下问题:PHP find_rep_image函数的具体用法?PHP find_rep_image怎么用?PHP find_rep_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了find_rep_image函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _api_getMP_row

function _api_getMP_row($row)
{
    global $parties;
    $row['full_name'] = member_full_name($row['house'], $row['title'], $row['first_name'], $row['last_name'], $row['constituency']);
    # We need 'name' to maintain backwards compatibility due to OA-476
    $row['name'] = $row['full_name'];
    if (isset($parties[$row['party']])) {
        $row['party'] = $parties[$row['party']];
    }
    list($image, $sz) = find_rep_image($row['person_id']);
    if ($image) {
        $row['image'] = $image;
    }
    # Ministerialships and Select Committees
    $db = new ParlDB();
    $q = $db->query('SELECT * FROM moffice WHERE to_date="9999-12-31" and person=' . $row['person_id'] . ' ORDER BY from_date DESC');
    for ($i = 0; $i < $q->rows(); $i++) {
        $row['office'][] = $q->row($i);
    }
    foreach ($row as $k => $r) {
        if (is_string($r)) {
            $row[$k] = html_entity_decode($r);
        }
    }
    return $row;
}
开发者ID:leowmjw,项目名称:twfy,代码行数:26,代码来源:api_getMP.php


示例2: _api_getPerson_row

function _api_getPerson_row($row, $has_party = FALSE)
{
    global $parties;
    $row['full_name'] = member_full_name($row['house'], $row['title'], $row['first_name'], $row['last_name'], $row['constituency']);
    if ($row['house'] == 1) {
        $URL = new URL('mp');
        $row['url'] = $URL->generate('none') . make_member_url($row['full_name'], $row['constituency'], $row['house']);
    }
    if ($has_party && isset($parties[$row['party']])) {
        $row['party'] = $parties[$row['party']];
    }
    list($image, $sz) = find_rep_image($row['person_id']);
    if ($image) {
        list($width, $height) = getimagesize(str_replace(IMAGEPATH, BASEDIR . '/images/', $image));
        $row['image'] = $image;
        $row['image_height'] = $height;
        $row['image_width'] = $width;
    }
    if ($row['house'] == 1 && ($row['left_house'] == '9999-12-31' || $row['left_house'] == '2010-04-12')) {
        # XXX
        # Ministerialships and Select Committees
        $db = new ParlDB();
        $q = $db->query('SELECT * FROM moffice WHERE to_date="9999-12-31" and person=' . $row['person_id'] . ' ORDER BY from_date DESC');
        for ($i = 0; $i < $q->rows(); $i++) {
            $row['office'][] = $q->row($i);
        }
    }
    foreach ($row as $k => $r) {
        if (is_string($r)) {
            $row[$k] = html_entity_decode($r);
        }
    }
    return $row;
}
开发者ID:sebbacon,项目名称:theyworkforyou,代码行数:34,代码来源:api_getPerson.php


示例3: _api_getMSP_row

function _api_getMSP_row($row)
{
    global $parties;
    $row['full_name'] = member_full_name($row['house'], $row['title'], $row['first_name'], $row['last_name'], $row['constituency']);
    if (isset($parties[$row['party']])) {
        $row['party'] = $parties[$row['party']];
    }
    list($image, $sz) = find_rep_image($row['person_id']);
    if ($image) {
        $row['image'] = $image;
    }
    $row = array_map('html_entity_decode', $row);
    return $row;
}
开发者ID:leowmjw,项目名称:twfy,代码行数:14,代码来源:api_getMSP.php


示例4: _api_getPerson_row

function _api_getPerson_row($row, $has_party = FALSE)
{
    global $parties;
    $row['full_name'] = member_full_name($row['house'], $row['title'], $row['first_name'], $row['last_name'], $row['constituency']);
    if ($has_party && isset($parties[$row['party']])) {
        $row['party'] = $parties[$row['party']];
    }
    list($image, $sz) = find_rep_image($row['person_id']);
    if ($image) {
        $row['image'] = $image;
    }
    foreach ($row as $k => $r) {
        if (is_string($r)) {
            $row[$k] = html_entity_decode($r);
        }
    }
    return $row;
}
开发者ID:palfrey,项目名称:twfy,代码行数:18,代码来源:api_getPerson.php


示例5: render_mps_row

function render_mps_row($mp, &$style, $order, $MPURL) {
	$style = $style == '1' ? '2' : '1';
	$name = member_full_name(4, $mp['title'], $mp['first_name'], $mp['last_name'], $mp['constituency']);
	?>
<tr>
    <td class="row">
    <?php 
    list($image, $sz) = find_rep_image($mp['person_id'], true, true);
    if ($image) {
        echo '<a href="' . $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 1) . '" class="speakerimage"><img height="59" class="portrait" alt="" src="', $image, '"';
        echo '></a>';
    }
    ?>
    </td>
<td class="row-<?php 
    echo $style;
    ?>
"><a href="<?php 
    echo $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 4);
    ?>
"><?php 
    echo $name;
    ?>
</a></td>
<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['party'];
    ?>
</td>
<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['constituency'];
    ?>
</td>
</tr>
<?php 
}
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:41,代码来源:people_msps.php


示例6: person_image

function person_image($member) {
	$is_lord = in_array(2, $member['houses']);
	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);		    
	}
	echo '<p class="person">';
	echo '<img class="portrait" alt="Photo of ', $member['full_name'], '" src="', $image, '"';
	if ($sz=='S') echo ' height="118"';
	echo '></p>';
}
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:12,代码来源:person.php


示例7: display_form

function display_form($errors = array()) {
    global $db; 

    $out = '';
    if ($errors) {
        $out .= '<ul id="error"><li>' . join('</li><li>', $errors) . '</li></ul>';
    }
    $out .= <<<EOF
<p>Photos are automatically added in git and committed. Because of this,
only use this interface on a development version of the site which is
in a git checkout (francis.theyworkforyou.com or similar). Then deploy
to the live site.
</p>
<form method="post" action="photos.php" enctype="multipart/form-data">
<div class="row">
<span class="label"><label for="form_pid">Person:</label></span>
<span class="formw"><select id="form_pid" name="pid"></span>
EOF;

    $query = 'SELECT house, person_id, title, first_name, last_name, constituency, party
        FROM member
        WHERE house>0 GROUP by person_id
        ORDER BY house, last_name, first_name
    ';
    $q = $db->query($query);

    $houses = array(1 => 'MP', 'Lord', 'MLA', 'MSP');

    for ($i=0; $i<$q->rows(); $i++) {
        $p_id = $q->field($i, 'person_id');
        $house = $q->field($i, 'house');
        $desc = $q->field($i, 'last_name') . ', ' . $q->field($i, 'title') . ' ' . $q->field($i, 'first_name') .
                " " . $houses[$house];
        if ($q->field($i, 'party')) $desc .= ' (' . $q->field($i, 'party') . ')';
        $desc .= ', ' . $q->field($i, 'constituency');

        list($dummy, $sz) = find_rep_image($p_id);
        if ($sz == 'L') {
            $desc .= ' [has large photo]';
        } elseif ($sz == 'S') {
            $desc .= ' [has small photo]';
        } else {
            $desc .= ' [no photo]';
        }
        $out .= '<option value="'.$p_id.'">'.$desc.'</option>' . "\n";
    }

    $out .= <<<EOF
</select></span>
</div>
<div class="row">
    <span class="label"><label for="form_photo">Photo:</label></span>
    <span class="formw"><input type="file" name="photo" id="form_photo" size="50"></span>
</div>
<div class="row">
    <span class="label">&nbsp;</span>
    <span class="formw"><input type="submit" name="submit_photo" value="Upload photo"></span>
</div>
</form>

<p style="clear:both; margin-top: 3em"><a href="/images/mps/photo-status.php">List MPs without photos</a></p>
EOF;
    return $out;
}
开发者ID:henare,项目名称:theyworkforyou,代码行数:64,代码来源:photos.php


示例8: ParlDB

include_once 'min-init.php';
include_once INCLUDESPATH . 'easyparliament/member.php';
include_once '../api/api_functions.php';
$pid = $_GET['pid'];
$db = new ParlDB();
$q = $db->query("select * from member\n\twhere house=1 and person_id = '" . mysql_real_escape_string($pid) . "'\n\torder by left_house desc limit 1");
if (!$q->rows()) {
    print '<error>Unknown ID</error>';
    exit;
}
$row = $q->row(0);
$row['full_name'] = member_full_name($row['house'], $row['title'], $row['first_name'], $row['last_name'], $row['constituency']);
if (isset($parties[$row['party']])) {
    $row['party'] = $parties[$row['party']];
}
list($image, $sz) = find_rep_image($row['person_id'], true);
if ($image) {
    $row['image'] = $image;
}
$q = $db->query("SELECT position,dept FROM moffice WHERE to_date='9999-12-31'\n\tand source='chgpages/selctee' and person=" . mysql_real_escape_string($pid) . ' ORDER BY from_date DESC');
for ($i = 0; $i < $q->rows(); $i++) {
    $row['selctee'][] = prettify_office($q->field($i, 'position'), $q->field($i, 'dept'));
}
/*
$q = $db->query("SELECT title,chairman from pbc_members,bills where member_id=".$row['member_id']
	. ' and bill_id=bills.id');
for ($i=0; $i<$q->rows(); $i++) {
	$member = 'Member';
	if ($q->field($i, 'chairman')) {
		$member = 'Chairman';
	}
开发者ID:leowmjw,项目名称:twfy,代码行数:31,代码来源:dat.php


示例9: array

            // Used for action links (link, source, watch etc)
            $action_links = array();
                
			if (isset($row['speaker']) && count($row['speaker']) > 0) {
			    
			  // We have a speaker to print.
				$speaker = $row['speaker'];
				$speakername = ucfirst(member_full_name($speaker['house'], $speaker['title'], $speaker['first_name'], $speaker['last_name'], $speaker['constituency']));

				//speaker photo
				$missing_photo_type = 'general';
				if($data['info']['major'] == 101){
				    $missing_photo_type = "lord";
			    }
				list($image,$sz) = find_rep_image($speaker['person_id'], true, $missing_photo_type);				

				echo '<a class="speakerimage" id="speakerimage_' . $row['epobject_id'] . '" href="', $speaker['url'], '" title="See more information about ', $speakername, '" onmouseover="showPersonLinks(' . $row['epobject_id'] . ')" >';
				echo '<span><img src="', $image, '" class="portrait" alt="Photo of ', $speakername, '"';
				/*
				if (get_http_var('partycolours')) {
					echo ' style="border: 3px solid ', party_to_colour($speaker['party']), ';"';
				}
				*/
				echo '></span></a>';

				//speaker links
				echo '<div class="personinfo" id="personinfo_' . $row['epobject_id']  . '"><ul>';
				echo '<li><a href="/alert/?only=1&pid=' . $speaker['person_id'] . '">Email me when ' . $speakername .  ' speaks</a></li>';
				if($data['info']['major'] == 101 || $data['info']['major'] == 1){
				    echo '<li><a href="' . $speaker['url'] . '#votingrecord">View voting record</a></li>';												    
开发者ID:henare,项目名称:theyworkforyou,代码行数:30,代码来源:hansard_gid.php


示例10: gid_to_anchor

            }
            // gid_to_anchor() is in utility.php
            $id = 'g' . gid_to_anchor($row['gid']);
            $PAGE->stripe_start($style, $id);
            ?>
				<a name="<?php 
            echo $id;
            ?>
"></a>
<?php 
            if (isset($row['speaker']) && count($row['speaker']) > 0) {
                // We have a speaker to print.
                $speaker = $row['speaker'];
                $speakername = ucfirst(member_full_name($speaker['house'], $speaker['title'], $speaker['first_name'], $speaker['last_name'], $speaker['constituency']));
                echo '<p class="speaker"><a href="', $speaker['url'], '" title="See more information about ', $speakername, '">';
                list($image, $sz) = find_rep_image($speaker['person_id'], true);
                if ($image) {
                    echo '<img src="', $image, '" class="portrait" alt="Photo of ', $speakername, '"';
                    if (get_http_var('partycolours')) {
                        echo ' style="border: 3px solid ', party_to_colour($speaker['party']), ';"';
                    }
                    echo '>';
                }
                echo '<strong>', $speakername, '</strong></a> <small>';
                $desc = '';
                if ($speaker['house'] == 1 && $speaker['party'] != 'Speaker' && $speaker['party'] != 'Deputy Speaker' && $speaker['constituency']) {
                    $desc .= $speaker['constituency'] . ', ';
                }
                if (get_http_var('wordcolours')) {
                    $desc .= '<span style="color: ' . party_to_colour($speaker['party']) . '">';
                }
开发者ID:bruno,项目名称:twfy,代码行数:31,代码来源:hansard_gid.php


示例11: display_member


//.........这里部分代码省略.........
                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];
开发者ID:palfrey,项目名称:twfy,代码行数:67,代码来源:page.php


示例12: render_mps_row

function render_mps_row($mp, &$style, $order, $MPURL)
{
    // Stripes
    $style = $style == '1' ? '2' : '1';
    $name = member_full_name(1, $mp['title'], $mp['first_name'], $mp['last_name'], $mp['constituency']);
    #	$MPURL->insert(array('pid'=>$mp['person_id']));
    ?>
				<tr>
                <td class="row">
                <?php 
    list($image, $sz) = find_rep_image($mp['person_id'], true, true);
    if ($image) {
        echo '<a href="' . $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 1) . '" class="speakerimage"><img height="59" class="portrait" alt="" src="', $image, '"';
        echo '></a>';
    }
    ?>
                </td>
				<td class="row-<?php 
    echo $style;
    ?>
"><a href="<?php 
    echo $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 1);
    ?>
"><?php 
    echo $name;
    ?>
</a>
<?php 
    if ($mp['left_reason'] == 'general_election_not_standing') {
        print '<br><em>Standing down</em>';
    }
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['party'];
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['constituency'];
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    if (is_array($mp['pos'])) {
        print join('<br>', array_map('prettify_office', $mp['pos'], $mp['dept']));
    } elseif ($mp['pos'] || $mp['dept']) {
        print prettify_office($mp['pos'], $mp['dept']);
    } else {
        print '&nbsp;';
    }
    ?>
</td>
<?php 
    if ($order == 'expenses') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
">&pound;<?php 
        echo number_format($mp['data_value']);
        ?>
</td>
<?php 
    } elseif ($order == 'debates') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
"><?php 
        echo number_format($mp['data_value']);
        ?>
</td>
<?php 
    } elseif ($order == 'safety') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
"><?php 
        echo $mp['data_value'];
        ?>
</td>
<?php 
    }
    ?>
				</tr>
<?php 
}
开发者ID:sebbacon,项目名称:theyworkforyou,代码行数:96,代码来源:people_mps.php


示例13: exists_rep_image

function exists_rep_image($pid)
{
    $image = find_rep_image($pid, false, false);
    return $image[1] !== null;
}
开发者ID:henare,项目名称:theyworkforyou,代码行数:5,代码来源:member.php


示例14: display_member

    function display_member($member, $extra_info)
    {
        global $THEUSER, $DATA, $this_page;
        # If current Senator show their name as "Senator John Smith". Current Representative show their name as "John Smith MP"
        $title = $member['current_member'][2] ? 'Senator ' : '';
        $title .= ucfirst($member['full_name']);
        # Show current titles first
        foreach ($member['houses'] as $house) {
            if ($member['current_member'][$house]) {
                $title .= ' ';
                if ($house == 1) {
                    $title .= 'MP';
                }
            }
        }
        # Show former membership
        foreach ($member['houses'] as $house) {
            if (!$member['current_member'][$house]) {
                $title .= ', former ';
                if ($house == 1) {
                    $title .= 'Representative';
                }
                if ($house == 2) {
                    $title .= 'Senator';
                }
            }
        }
        /*		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 OpenAustralia from adding
        			useful information of new sorts in the future. The Bill is not backed
        			or opposed by a specific party, and OpenAustralia 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'].'&amp;dmp=996">'.$strongly_foi.'</a> this Bill.';
        		$this->block_end();
        */
        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 OpenAustralia from a variety of sources.</p>';
        $this->block_start(array('id' => 'mp', 'title' => $title));
        list($image, $sz) = find_rep_image($member['person_id']);
        if ($image) {
            echo '<img class="portrait" alt="Photo of ', $member['full_name'], '" src="', $image, '"';
            if ($sz == 'S') {
                echo ' height="118"';
            }
            echo '>';
        } else {
            // Prompt for photo
            echo '<div class="textportrait"><br>We\'re missing a photo!<br><br><a href="mailto:[email protected]">Email us one</a> <small>(that you have copyright of)</small><br><br></div>';
        }
        echo '<ul class="hilites">';
        $desc = '';
        foreach ($member['houses'] as $house) {
            $party = $member['left_house'][$house]['party'];
            $desc .= '<li><strong>';
            if (!$member['current_member'][$house]) {
                $desc .= 'Former ';
            }
            $desc .= htmlentities($party);
            if ($party == 'Speaker' || $party == 'Deputy-Speaker' || $party == 'President' || $party == 'Deputy-President') {
                $desc .= ', and ';
                # XXX: Will go horribly wrong if something odd happens
                if ($party == 'Deputy-Speaker') {
                    $last = end($member['other_parties']);
                    $desc .= $last['from'] . ' ';
                }
            }
            $desc .= ' ';
            if ($house == 1) {
                $desc .= 'Representative';
            }
            if ($house == 2) {
                $desc .= 'Senator';
            }
            if ($house == 3) {
                $desc .= 'MLA';
            }
            if ($house == 4) {
                $desc .= 'MSP';
            }
//.........这里部分代码省略.........
开发者ID:NathanaelB,项目名称:twfy,代码行数:101,代码来源:page.php


示例15: render_mps_row

function render_mps_row($mp, &$style, $order, $MPURL)
{
    // Stripes
    $style = $style == '1' ? '2' : '1';
    $name = member_full_name(1, $mp['title'], $mp['first_name'], $mp['last_name'], $mp['constituency']);
    $url = $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 1);
    #	$MPURL->insert(array('pid'=>$mp['person_id']));
    list($image, $sz) = find_rep_image($mp['person_id'], true);
    ?>
				<tr>
				<td class="row">
				<?php 
    if ($image) {
        echo '<a href="', $url, '">', '<img class="portrait" alt="" src="', $image, '">', '</a>';
    }
    ?>
				</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><a href="<?php 
    echo $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 1);
    ?>
"><?php 
    echo $name;
    ?>
</a></td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['party'];
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $mp['constituency'];
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    if (is_array($mp['dept'])) {
        print join('<br>', array_map('manymins', $mp['pos'], $mp['dept']));
    } elseif ($mp['dept'] || $mp['pos']) {
        print prettify_office($mp['pos'], $mp['dept']);
    } else {
        print '&nbsp;';
    }
    ?>
</td>
<?php 
    if ($order == 'expenses') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
">&pound;<?php 
        echo number_format($mp['data_value']);
        ?>
</td>
<?php 
    } elseif ($order == 'debates') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
"><?php 
        echo number_format($mp['data_value']);
        ?>
</td>
<?php 
    } elseif ($order == 'safety') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
"><?php 
        echo $mp['data_value'];
        ?>
</td>
<?php 
    }
    ?>
				</tr>
<?php 
}
开发者ID:leowmjw,项目名称:twfy,代码行数:90,代码来源:people_mps.php


示例16: ParlDB

<?php

include_once "../../../includes/easyparliament/init.php";
include_once "../../../includes/easyparliament/member.php";
$DATA->set_page_metadata($this_page, 'heading', 'MPs photo status on OpenAustralia');
$PAGE->page_start();
$PAGE->stripe_start();
$db = new ParlDB();
$query = 'SELECT person_id, first_name, last_name, constituency, party
	FROM member
	WHERE house=1 AND left_house = (SELECT MAX(left_house) FROM member) ';
$q = $db->query($query . "ORDER BY last_name, first_name");
$out = array('both' => '', 'small' => '', 'none' => '');
for ($i = 0; $i < $q->rows(); $i++) {
    $p_id = $q->field($i, 'person_id');
    list($dummy, $sz) = find_rep_image($p_id);
    if ($sz == 'L') {
        $out['both'] .= $q->field($i, 'first_name') . ' ' . $q->field($i, 'last_name') . ', ';
    } elseif ($sz == 'S') {
        $out['small'] .= $q->field($i, 'first_name') . ' ' . $q->field($i, 'last_name') . ', ';
    } else {
        $out['none'] .= '<li>' . $q->field($i, 'first_name') . ' ' . $q->field($i, 'last_name') . ' (' . $q->field($i, 'party') . ')' . ', ' . $q->field($i, 'constituency');
    }
}
print '<h3>Missing completely</h3> <ul>';
print $out['none'];
print '</ul>';
print '<h3>Large and small</h3> <p>';
print $out['both'];
print '<h3>Only small photos</h3> <p>';
print $out['small'];
开发者ID:leowmjw,项目名称:twfy,代码行数:31,代码来源:photo-status.php


示例17: display_member

    function display_member($member, $extra_info)
    {
        global $THEUSER, $DATA, $this_page;
        # If current Senator show their name as "Senator John Smith". Current Representative show their name as "John Smith MP"
        $title = $member['current_member'][2] ? 'Senator ' : '';
        $title .= ucfirst($member['full_name']);
        # Show current titles first
        foreach ($member['houses'] as $house) {
            if ($member['current_member'][$house]) {
                $title .= ' ';
                if ($house == 1) {
                    $title .= 'MP';
                }
            }
        }
        # Show former membership
        foreach ($member['houses'] as $house) {
            if (!$member['current_member'][$house]) {
                $title .= ', former ';
                if ($house == 1) {
                    $title .= 'Representative';
                }
                if ($house == 2) {
                    $title .= 'Senator';
                }
            }
        }
        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 OpenAustralia from a variety of sources.</p>';
        $this->block_start(array('id' => 'mp', 'title' => $title));
        list($image, $sz) = find_rep_image($member['person_id']);
        if ($image) {
            echo '<img class="portrait" alt="Photo of ', $member['full_name'], '" src="', $image, '"';
            if ($sz == 'S') {
                echo ' height="118"';
            }
            echo '>';
        } else {
            // Prompt for photo
            echo '<div class="textportrait"><br>We\'re missing a photo!<br><br><a href="mailto:[email protected]">Email us one</a> <small>(that you have copyright of)</small><br><br></div>';
        }
        echo '<ul class="hilites">';
        $desc = '';
        foreach ($member['houses'] as $house) {
            $party = $member['left_house'][$house]['party'];
            $desc .= '<li><strong>';
            if (!$member['current_member'][$house]) {
                $desc .= 'Former ';
            }
            $desc .= htmlentities($party);
            if ($party == 'Speaker' || $party == 'Deputy-Speaker' || $party == 'President' || $party == 'Deputy-President') {
                $desc .= ', and ';
                # XXX: Will go horribly wrong if something odd happens
                $last = end($member['other_parties']);
                $desc .= $last['from'] . ' ';
            }
            $desc .= ' ';
            if ($house == 1) {
                $desc .= 'Representative';
            }
            if ($house == 2) {
                $desc .= 'Senator';
            }
            if ($house == 3) {
                $desc .= 'MLA';
            }
            if ($house == 4) {
                $desc .= 'MSP';
            }
            $desc .= ' for ' . $member['left_house'][$house]['constituency'];
            $desc .= '</strong></li>';
        }
        print $desc;
        if ($member['other_parties'] && $member['party'] != 'Speaker' && $member['party'] != 'Deputy-Speaker' && $member['party'] != 'President' && $member['party'] != 'Deputy-President') {
            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>';
            }
        }
        if (isset($member['left_house'][1]) && isset($member['entered_house'][2])) {
            print '<li><strong>Entered the Senate ';
            if (strlen($member['entered_house'][2]['date_pretty']) == 4) {
//.........这里部分代码省略.........
开发者ID:archoo,项目名称:twfy,代码行数:101,代码来源:page.php


示例18: render_peers_row

function render_peers_row($peer, &$style, $order, $URL)
{
    global $parties;
    // Stripes
    $style = $style == '1' ? '2' : '1';
    $name = member_full_name(2, $peer['title'], $peer['first_name'], $peer['last_name'], $peer['constituency']);
    if (array_key_exists($peer['party'], $parties)) {
        $party = $parties[$peer['party']];
    } else {
        $party = $peer['party'];
    }
    #	$MPURL->insert(array('pid'=>$peer['person_id']));
    ?>
			<tr>
                <td class="row">
                <?php 
    list($image, $sz) = find_rep_image($peer['person_id'], true, 'lord');
    if ($image) {
        echo '<a href="' . $URL->generate() . make_member_url($name) . '" class="speakerimage"><img height="59" class="portrait" alt="" src="', $image, '"';
        echo '></a>';
    }
    ?>
                </td>				    
				<td class="row-<?php 
    echo $style;
    ?>
"><a href="<?php 
    echo $URL->generate() . make_member_url($name, null, 2);
    ?>
"><?php 
    echo ucfirst($name);
    ?>
</a></td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    echo $party;
    ?>
</td>
				<td class="row-<?php 
    echo $style;
    ?>
"><?php 
    if (is_array($peer['dept'])) {
        print join('<br>', array_map('manymins', $peer['pos'], $peer['dept']));
    } elseif ($peer['dept']) {
        print prettify_office($peer['pos'], $peer['dept']);
    } else {
        print '&nbsp;';
    }
    ?>
</td>

<?php 
    if ($order == 'debates') {
        ?>
				<td class="row-<?php 
        echo $style;
        ?>
"><?php 
        echo number_format($peer['data_value']);
        ?>
</td>
<?php 
    }
    ?>

			</tr>
<?php 
}
开发者ID:palfrey,项目名称:twfy,代码行数:71,代码来源:people_peers.php


示例19: MEMBER

include_once 'min-init.php';
include_once INCLUDESPATH . 'easyparliament/member.php';
include_once '../api/api_functions.php';
$pid = $_GET['pid'];
if (!$pid) {
    print '<error>No ID</error>';
    exit;
}
$member = new MEMBER(array('person_id' => $pid));
if (!$member->valid) {
    print '<error>Unknown ID</error>';
    exit;
}
$member->load_extra_info();
$row = array('person_id' => $pid, 'full_name' => $member->full_name(), 'constituency' => $member->constituency(), 'party' => $member->party_text(), 'majority_in_seat' => number_format($member->extra_info['majority_in_seat']), 'swing_to_lose_seat_today' => number_format($member->extra_info['swing_to_lose_seat_today']));
list($image, $sz) = find_rep_image($pid, true);
if ($image) {
    $row['image'] = $image;
}
foreach ($member->extra_info['office'] as $office) {
    if ($office['to_date'] == '9999-12-31' && $office['source'] == 'chgpages/selctee') {
        $row['selctee'][] = prettify_office($office['position'], $office['dept']);
    }
}
$none = false;
$output = array();
$pw_keys = array_filter(array_keys($member->extra_info), create_function('$a', '
	if (substr($a, 0, 11) != "public_whip") return false;
	if (substr($a, -7) == "_absent") return false;
	return true;
'));
开发者ID:palfrey,项目名称:twfy,代码行数:31,代码来源:dat.php



注:本文中的find_rep_image函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP find_replace_templatesets函数代码示例发布时间:2022-05-15
下一篇:
PHP find_program函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap