当前位置: 首页>>代码示例>>PHP>>正文


PHP make_member_url函数代码示例

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


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

示例1: render_mps_row

function render_mps_row($mp, &$style, $order, $MPURL)
{
    $style = $style == '1' ? '2' : '1';
    $name = member_full_name(3, $mp['title'], $mp['first_name'], $mp['last_name'], $mp['constituency']);
    ?>
<tr>
<td class="row-<?php 
    echo $style;
    ?>
"><a href="<?php 
    echo $MPURL->generate() . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency'], 3);
    ?>
"><?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:leowmjw,项目名称:twfy,代码行数:33,代码来源:people_mlas.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: render_peers_row

function render_peers_row($peer, $order)
{
    global $parties;
    $name = member_full_name(2, $peer['title'], $peer['first_name'], $peer['last_name'], $peer['constituency']);
    if (strstr($name, ',')) {
        $name = "\"{$name}\"";
    }
    print $peer['person_id'] . ',' . ucfirst($name) . ',';
    if (array_key_exists($peer['party'], $parties)) {
        print $parties[$peer['party']];
    } else {
        print $peer['party'];
    }
    print ',' . 'http://' . DOMAIN . WEBPATH . 'senator/' . make_member_url($name, $peer['constituency']);
    print "\n";
}
开发者ID:leowmjw,项目名称:twfy,代码行数:16,代码来源:people_peers.php

示例4: render_mlas_row

function render_mlas_row($mla, $order)
{
    global $parties;
    $con = html_entity_decode($mla['constituency']);
    if (strstr($con, ',')) {
        $con = "\"{$con}\"";
    }
    $name = member_full_name(3, $mla['title'], $mla['first_name'], $mla['last_name'], $mla['constituency']);
    if (strstr($name, ',')) {
        $name = "\"{$name}\"";
    }
    print $mla['person_id'] . ',' . ucfirst($name) . ',';
    if (array_key_exists($mla['party'], $parties)) {
        print $parties[$mla['party']];
    } else {
        print $mla['party'];
    }
    print ',' . $con . ',' . 'http://www.openaustralia.org/mla/' . make_member_url($mla['first_name'] . ' ' . $mla['last_name']);
    print "\n";
}
开发者ID:leowmjw,项目名称:twfy,代码行数:20,代码来源:people_mlas.php

示例5: render_msps_row

function render_msps_row($msp, $order)
{
    global $parties;
    $con = $msp['constituency'];
    if (strstr($con, ',')) {
        $con = "\"{$con}\"";
    }
    $name = member_full_name(4, $msp['title'], $msp['first_name'], $msp['last_name'], $msp['constituency']);
    if (strstr($name, ',')) {
        $name = "\"{$name}\"";
    }
    print $msp['person_id'] . ',' . ucfirst($name) . ',';
    if (array_key_exists($msp['party'], $parties)) {
        print $parties[$msp['party']];
    } else {
        print $msp['party'];
    }
    print ',' . $con . ',' . 'http://www.theyworkforyou.com/msp/' . make_member_url($msp['first_name'] . ' ' . $msp['last_name']);
    print "\n";
}
开发者ID:henare,项目名称:theyworkforyou,代码行数:20,代码来源:people_msps.php

示例6: render_mps_row

function render_mps_row($mp, $order)
{
    global $parties;
    $con = html_entity_decode($mp['constituency']);
    if (strstr($con, ',')) {
        $con = "\"{$con}\"";
    }
    print $mp['person_id'] . ',';
    print html_entity_decode($mp['first_name']) . ',' . html_entity_decode($mp['last_name']) . ',';
    if (array_key_exists($mp['party'], $parties)) {
        print $parties[$mp['party']];
    } else {
        print $mp['party'];
    }
    print ',' . $con . ',' . 'http://www.theyworkforyou.com/mp/' . make_member_url($mp['first_name'] . ' ' . $mp['last_name'], $mp['constituency']);
    if ($order == 'expenses') {
        print ', £' . $mp['data_value'];
    } elseif ($order == 'debates') {
        print ', ' . $mp['data_value'];
    }
    print "\n";
}
开发者ID:bruno,项目名称:openaustralia-app,代码行数:22,代码来源:people_mps.php

示例7: 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:henare,项目名称:theyworkforyou,代码行数:23,代码来源:people_msps.php

示例8: foreach

        ?>
'><?php 
        echo $name;
        ?>
</a>, and your regional MSPs were <?php 
        foreach ($mreg as $k => $n) {
            print "<a href='/msp/" . make_member_url($n, '', 4) . "'>{$n}</a>";
            if ($k < count($mreg) - 2) {
                print ', ';
            } elseif ($k == count($mreg) - 2) {
                print ' and ';
            }
        }
        echo '.</li>';
    } elseif ($country == 'N') {
        $mp_url = '/mla/' . make_member_url($name, '', 3);
        ?>
<li>You were in the <strong><?php 
        echo $current['NIE'];
        ?>
</strong> constituency; your constituency MLA was <a href='<?php 
        echo $mp_url;
        ?>
'><?php 
        echo $name;
        ?>
</a>.</li>
<?php 
    }
    echo '</ul>';
    if (count($new) && $current['SPC'] == $new['SPC']) {
开发者ID:udp12,项目名称:theyworkforyou,代码行数:31,代码来源:index.php

示例9: 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

示例10: url

 public function url($absolute = true)
 {
     $house = $this->house_disp;
     if ($house == HOUSE_TYPE_COMMONS) {
         $URL = new URL('mp');
     } elseif ($house == HOUSE_TYPE_LORDS) {
         $URL = new URL('peer');
     } elseif ($house == HOUSE_TYPE_NI) {
         $URL = new URL('mla');
     } elseif ($house == HOUSE_TYPE_SCOTLAND) {
         $URL = new URL('msp');
     } elseif ($house == HOUSE_TYPE_ROYAL) {
         $URL = new URL('royal');
     }
     $member_url = make_member_url($this->full_name(true), $this->constituency(), $house, $this->person_id());
     if ($absolute) {
         return 'http://' . DOMAIN . $URL->generate('none') . $member_url;
     } else {
         return $URL->generate('none') . $member_url;
     }
 }
开发者ID:vijo,项目名称:theyworkforyou,代码行数:21,代码来源:member.php

示例11: 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

示例12: elseif

	foreach (array('house', 'first_name', 'last_name', 'title', 'person_id') as $key) {
		unset($output[$key]);
	}
	if (isset($party_sites[$output['party']])) {
		$output['party_site'] = $party_sites[$output['party']];
	} elseif ($output['full_name'] == 'Richard Taylor') {
    		$output['party_site'] = 'http://www.healthconcern.org.uk/';
	} elseif ($output['full_name'] == 'Dai Davies') {
		$output['party_site'] = 'http://www.blaenaugwentpeoplesvoice.org/';
	} else {
		$output['party_site'] = '';
	}
	if (isset($output['image'])) $output['image'] = 'http://www.theyworkforyou.com' . $output['image'];
	$output['bbc'] = 'http://news.bbc.co.uk/1/shared/mpdb/html/' . $bbc_cons_id . '.stm';
	$output['link'] = 'http://www.theyworkforyou.com/mp/'
		. make_member_url(htmlentities($output['full_name']), $cons, 1); # XXX make_member_url needs it encoded!
	$output['email_alert'] = 'http://www.theyworkforyou.com/alert/?only=1&pid=' . $pid;
	#$output['writetothem'] = 'http://www.writetothem.com/';
	#$output['hearfromyourmp'] = 'http://www.hearfromyourmp.com/';
	# Link to WTT/HFYMP?
	api_output($output);
} else {
	error('Unknown action');
}

function error($error = 'Unknown error') {
	api_error($error);
	exit;
}

开发者ID:henare,项目名称:theyworkforyou,代码行数:29,代码来源:bbc.php

示例13: _get_data_by_group

 public function _get_data_by_group($args)
 {
     // $args can have an optional 'order' element.
     $use_extracol = isset($args['order']) && in_array($args['order'], array('debates'));
     $use_personinfo = $use_extracol;
     # Defaults
     $order = 'family_name';
     $sqlorder = 'family_name, given_name';
     $params = array();
     $query = 'SELECT distinct member.person_id, title, given_name, family_name, lordofname, constituency, party, left_reason, dept, position ';
     if ($use_extracol) {
         $query .= ', data_value ';
         $order = $args['order'];
         $sqlorder = 'data_value+0 DESC, family_name, given_name';
         unset($args['date']);
         $key_lookup = array('debates' => 'debate_sectionsspoken_inlastyear');
         $personinfo_key = $key_lookup[$order];
     }
     $query .= 'FROM member LEFT OUTER JOIN moffice ON member.person_id = moffice.person ';
     if (isset($args['date'])) {
         $query .= 'AND from_date <= :date AND :date <= to_date ';
         $params[':date'] = $args['date'];
     } else {
         $query .= 'AND to_date="9999-12-31" ';
     }
     if ($use_personinfo) {
         $query .= 'LEFT OUTER JOIN personinfo ON member.person_id = personinfo.person_id AND data_key="' . $personinfo_key . '" ';
     }
     $query .= ' JOIN person_names p ON p.person_id = member.person_id AND p.type = "name" ';
     if (isset($args['date'])) {
         $query .= 'AND start_date <= :date AND :date <= end_date ';
     } else {
         $query .= 'AND end_date="9999-12-31" ';
     }
     $query .= 'WHERE house=' . $args['house'] . ' ';
     if (isset($args['date'])) {
         $query .= 'AND entered_house <= :date AND :date <= left_house ';
     } elseif (!isset($args['all']) || $args['house'] == 1) {
         $query .= 'AND left_house = (SELECT MAX(left_house) FROM member) ';
     }
     if (isset($args['order'])) {
         $order = $args['order'];
         if ($args['order'] == 'given_name') {
             $sqlorder = 'given_name, family_name';
         } elseif ($args['order'] == 'constituency') {
             $sqlorder = 'constituency';
         } elseif ($args['order'] == 'party') {
             $sqlorder = 'party, family_name, given_name, constituency';
         }
     }
     $q = $this->db->query($query . "ORDER BY {$sqlorder}", $params);
     $data = array();
     for ($row = 0; $row < $q->rows(); $row++) {
         $p_id = $q->field($row, 'person_id');
         $dept = $q->field($row, 'dept');
         $pos = $q->field($row, 'position');
         if (isset($data[$p_id])) {
             $data[$p_id]['dept'] = array_merge((array) $data[$p_id]['dept'], (array) $dept);
             $data[$p_id]['pos'] = array_merge((array) $data[$p_id]['pos'], (array) $pos);
         } else {
             $name = member_full_name($args['house'], $q->field($row, 'title'), $q->field($row, 'given_name'), $q->field($row, 'family_name'), $q->field($row, 'lordofname'));
             $constituency = $q->field($row, 'constituency');
             $url = make_member_url($name, $constituency, $args['house'], $p_id);
             $narray = array('person_id' => $p_id, 'given_name' => $q->field($row, 'given_name'), 'family_name' => $q->field($row, 'family_name'), 'lordofname' => $q->field($row, 'lordofname'), 'name' => $name, 'url' => $url, 'constituency' => $constituency, 'party' => $q->field($row, 'party'), 'left_reason' => $q->field($row, 'left_reason'), 'dept' => $dept, 'pos' => $pos);
             if ($use_extracol) {
                 $narray['data_value'] = $q->field($row, 'data_value');
             }
             if ($narray['party'] == 'SPK') {
                 $narray['party'] = '-';
                 $narray['pos'] = 'Speaker';
                 $narray['dept'] = 'House of Commons';
             } elseif ($narray['party'] == 'CWM' || $narray['party'] == 'DCWM') {
                 $narray['party'] = '-';
                 $narray['pos'] = 'Deputy Speaker';
                 $narray['dept'] = 'House of Commons';
             }
             $data[$p_id] = $narray;
         }
     }
     if ($args['house'] == 2 && ($order == 'name' || $order == 'constituency')) {
         uasort($data, array($this, 'by_peer_name'));
     }
     $data = array('info' => array('order' => $order), 'data' => $data);
     return $data;
 }
开发者ID:vijo,项目名称:theyworkforyou,代码行数:85,代码来源:people.php

示例14: display_user


//.........这里部分代码省略.........
        // Change the page title to make it clear we're viewing THEUSER's
        // own info. Make them less worried about other people seeing some of the
        // info that shouldn't be public.
        $DATA->set_page_metadata($this_page, "title", "Your details");
    } else {
        // There's nothing to display!
    }
    // THIRD: Print out what we've got.
    $PAGE->page_start();
    if ($display != "none") {
        $PAGE->stripe_start();
        if (isset($registrationtime)) {
            // Make registration time more user-friendly.
            list($date, $time) = explode(' ', $registrationtime);
            $registrationtime = format_date($date, LONGDATEFORMAT);
        }
        if ($edited) {
            print "\t\t\t\t<p><strong>" . ucfirst($who) . " details have been updated:</strong></p>\n";
        }
        if ($this_page == 'userviewself' && !$edited) {
            $EDITURL = new URL('useredit');
            ?>
				<p><strong>This is how other people see you.</strong> <a href="<?php 
            echo $EDITURL->generate();
            ?>
">Edit your details</a>.</p>
<?php 
        }
        ?>
				<div class="row">
				<span class="label">Name</span>
				<span class="formw"><?php 
        if (substr($name, -3) == ' MP') {
            print '<a href="/mp/' . make_member_url(substr($name, 0, -3)) . '">';
        }
        echo htmlentities($name);
        if (substr($name, -3) == ' MP') {
            print '</a>';
        }
        ?>
</span>
				</div>

				<div class="row">
				<span class="label">Email</span>
				<span class="formw"><?php 
        if (isset($email)) {
            $escaped_email = str_replace('@', '&#64;', htmlentities($email));
            ?>
<a href="mailto:<?php 
            echo $escaped_email . "\">" . $escaped_email;
            ?>
</a><?php 
        } else {
            ?>
Not public<?php 
        }
        ?>
</span>
				</div>

<?php 
        if (isset($postcode)) {
            if ($postcode == '') {
                $postcode = 'none';
            }
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:67,代码来源:index.php

示例15: foreach

    foreach (array('house', 'first_name', 'last_name', 'title', 'person_id') as $key) {
        unset($output[$key]);
    }
    if (isset($party_sites[$output['party']])) {
        $output['party_site'] = $party_sites[$output['party']];
    } elseif ($output['full_name'] == 'Richard Taylor') {
        $output['party_site'] = 'http://www.healthconcern.org.uk/';
    } elseif ($output['full_name'] == 'Dai Davies') {
        $output['party_site'] = 'http://www.blaenaugwentpeoplesvoice.org/';
    } else {
        $output['party_site'] = '';
    }
    if (isset($output['image'])) {
        $output['image'] = 'http://www.theyworkforyou.com' . $output['image'];
    }
    $output['bbc'] = 'http://news.bbc.co.uk/1/shared/mpdb/html/' . $bbc_cons_id . '.stm';
    $output['link'] = 'http://www.theyworkforyou.com/mp/' . make_member_url(htmlentities($output['full_name']), $cons, 1);
    # XXX make_member_url needs it encoded!
    $output['email_alert'] = 'http://www.theyworkforyou.com/alert/?only=1&pid=' . $pid;
    #$output['writetothem'] = 'http://www.writetothem.com/';
    #$output['hearfromyourmp'] = 'http://www.hearfromyourmp.com/';
    # Link to WTT/HFYMP?
    api_output($output);
} else {
    error('Unknown action');
}
function error($error = 'Unknown error')
{
    api_error($error);
    exit;
}
开发者ID:palfrey,项目名称:twfy,代码行数:31,代码来源:bbc.php


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