本文整理汇总了PHP中_htmlentities函数的典型用法代码示例。如果您正苦于以下问题:PHP _htmlentities函数的具体用法?PHP _htmlentities怎么用?PHP _htmlentities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_htmlentities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLoggedInLinks
private function addLoggedInLinks()
{
// The 'Edit details' link.
$menudata = $this->pagedata->page_metadata('userviewself', 'menu');
$edittext = $menudata['text'];
$edittitle = $menudata['title'];
$EDITURL = new \URL('userviewself');
if ($this->page == 'userviewself' || $this->page == 'useredit') {
$editclass = 'on';
} else {
$editclass = '';
}
// The 'Log out' link.
$menudata = $this->pagedata->page_metadata('userlogout', 'menu');
$logouttext = $menudata['text'];
$logouttitle = $menudata['title'];
$LOGOUTURL = new \URL('userlogout');
if ($this->page != 'userlogout') {
$LOGOUTURL->insert(array("ret" => $this->returl));
$logoutclass = '';
} else {
$logoutclass = 'on';
}
$username = $this->user->firstname() . ' ' . $this->user->lastname();
$this->data['user_nav_links'][] = array('href' => $LOGOUTURL->generate(), 'title' => $logouttitle, 'classes' => $logoutclass, 'text' => $logouttext);
$this->data['user_nav_links'][] = array('href' => $EDITURL->generate(), 'title' => $edittitle, 'classes' => $editclass, 'text' => $edittext);
$this->data['user_nav_links'][] = array('href' => $EDITURL->generate(), 'title' => $edittitle, 'classes' => $editclass, 'text' => _htmlentities($username));
}
示例2: display_page
function display_page($errors = array())
{
global $this_page, $PAGE;
if (isset($errors["sending"])) {
$PAGE->error_message($errors["sending"]);
} else {
print "<p>If you can't remember your password we can send you a new one.</p>\n<p>If you would like a new password, enter your address below.</p>\n";
}
?>
<form method="get" action="<?php
$URL = new URL($this_page);
echo $URL->generate();
?>
">
<?php
if (isset($errors["email"])) {
$PAGE->error_message($errors["email"]);
}
if (isset($errors["passwordchange"])) {
$PAGE->error_message($errors["passwordchange"]);
}
?>
<div class="row">
<div class="left">Email address:</div>
<div class="right"><input type="text" name="email" value="<?php
echo _htmlentities(get_http_var("email"));
?>
" maxlength="100" size="30" class="form"></div>
</div>
<div class="row">
<div class="left"> </div>
<div class="right"><input type="submit" value="Send me a new password"></div>
</div>
<input type="hidden" name="submitted" value="true">
</form>
<?php
}
示例3: _htmlspecialchars
(<?php
echo _htmlspecialchars($pid_member->constituency());
?>
)">
<?php
} elseif ($keyword) {
?>
<input type="text" class="form-control" name="alertsearch" id="alertsearch" disabled="disabled" value="<?php
echo _htmlspecialchars($display_keyword);
?>
">
<?php
} else {
?>
<input type="text" class="form-control" placeholder="Search term, postcode, or MP name" name="alertsearch" id="alertsearch" value="<?php
echo _htmlentities($search_text);
?>
">
<?php
}
?>
<input type="submit" class="button" value="<?php
echo $pid || $keyword ? 'Subscribe' : 'Search';
?>
">
</p>
<input type="hidden" name="t" value="<?php
echo _htmlspecialchars($token);
?>
">
示例4: person_numerology
function person_numerology($member, $has_email_alerts)
{
$extra_info = $member->extra_info();
$out = array();
$since_text = 'in the last year';
$year_ago = date('Y-m-d', strtotime('now -1 year'));
# Find latest entered house
$entered_house = null;
foreach ($member->entered_house() as $h => $eh) {
if (!$entered_house || $eh['date'] > $entered_house) {
$entered_house = $eh['date'];
}
}
if ($entered_house > $year_ago) {
$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() != 'SF') {
if (display_stats_line('debate_sectionsspoken_inlastyear', 'Has spoken in <a href="' . $MOREURL->generate() . '">', 'debate', '</a> ' . $since_text, '', $extra_info)) {
$out[] = 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() == 'SPK' || $member->party() == 'CWM' || $member->party() == 'DCWM') {
$minister = 2;
}
if (display_stats_line('wrans_asked_inlastyear', 'Has received answers to <a href="' . $MOREURL->generate() . '">', 'written question', '</a> ' . $since_text, '', $extra_info, $minister, $Lminister)) {
$out[] = display_stats_line('wrans_asked_inlastyear', 'Has received answers to <a href="' . $MOREURL->generate() . '">', 'written question', '</a> ' . $since_text, '', $extra_info, $minister, $Lminister);
}
}
$wtt_displayed = display_writetothem_numbers(2008, $extra_info);
if ($wtt_displayed) {
$out[] = $wtt_displayed;
}
if (!$wtt_displayed) {
$wtt_displayed = display_writetothem_numbers(2007, $extra_info);
if ($wtt_displayed) {
$out[] = $wtt_displayed;
}
if (!$wtt_displayed) {
$wtt_displayed = display_writetothem_numbers(2006, $extra_info);
if ($wtt_displayed) {
$out[] = $wtt_displayed;
}
if (!$wtt_displayed) {
$wtt_displayed = display_writetothem_numbers(2005, $extra_info);
if ($wtt_displayed) {
$out[] = $wtt_displayed;
}
}
}
}
$after_stuff = ' <small>(From Public Whip)</small>';
if ($member->party() == 'SNP') {
$after_stuff .= '<br><em>Note SNP MPs do not vote on legislation not affecting Scotland.</em>';
} elseif ($member->party() == 'SPK' || $member->party() == 'CWM' || $member->party() == 'DCWM') {
$after_stuff .= '<br><em>Speakers and deputy speakers cannot vote except to break a tie.</em>';
}
if ($member->party() != 'SF') {
$when = 'in this Parliament with this affiliation';
# Lords have one record per affiliation until they leave (ignoring name changes, sigh)
if ($member->house_disp == HOUSE_TYPE_LORDS) {
$when = 'in this House with this affiliation';
}
if (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> ' . $when, $after_stuff, $extra_info)) {
$out[] = 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> ' . $when, $after_stuff, $extra_info);
}
/*
if ($member->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>';
}
*/
if (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)) {
$out[] = 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);
}
if (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)) {
$out[] = 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']) && ($extra_info['number_of_alerts'] > 0 || $has_email_alerts)) {
$line = '<strong>' . _htmlentities($extra_info['number_of_alerts']) . '</strong> ' . ($extra_info['number_of_alerts'] == 1 ? 'person is' : 'people are') . ' tracking ';
if ($member->house_disp == HOUSE_TYPE_COMMONS) {
$line .= 'this MP';
} elseif ($member->house_disp == HOUSE_TYPE_LORDS) {
$line .= 'this peer';
} elseif ($member->house_disp == HOUSE_TYPE_NI) {
$line .= 'this MLA';
} elseif ($member->house_disp == HOUSE_TYPE_SCOTLAND) {
$line .= 'this MSP';
} elseif ($member->house_disp == HOUSE_TYPE_ROYAL) {
//.........这里部分代码省略.........
示例5: elseif
$row['speaker']['image'] = IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpeg';
} elseif (is_file(BASEDIR . IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpg')) {
$row['speaker']['image'] = IMAGEPATH . 'mps/' . $speaker['person_id'] . '.jpg';
}
$desc = '';
if (isset($speaker['office'])) {
$desc = array();
foreach ($speaker['office'] as $off) {
$desc[] = $off['pretty'];
}
$desc = join(', ', $desc) . '; ';
}
if ($speaker['house'] == 1 && $speaker['party'] != 'Speaker' && $speaker['party'] != 'Deputy Speaker' && $speaker['constituency']) {
$desc .= $speaker['constituency'] . ', ';
}
$desc .= _htmlentities($speaker['party']);
if ($desc) {
$row['speaker']['desc'] = $desc;
}
}
}
$out[] = $row;
}
if (isset($data['subrows'])) {
foreach ($data['subrows'] as $row) {
if (isset($row['contentcount']) && $row['contentcount'] > 0) {
$has_content = true;
} elseif ($row['htype'] == '11' && $hansardmajors[$row['major']]['type'] == 'other') {
$has_content = true;
} else {
$has_content = false;
示例6: elseif
$th_party = '<a href="' . $URL->generate() . '">Party</a>';
$URL->insert(array('o' => 'c'));
$th_constituency = '<a href="' . $URL->generate() . '">Constituency</a>';
if ($order == 'party') {
$th_party = 'Party';
} elseif ($order == 'constituency') {
$th_constituency = 'Constituency';
}
global $THEUSER;
?>
<form action="/postcode/" method="get">
<p><strong>Looking for your <acronym title="Members of the (Northern Irish) Legislative Assembly">MLA</acronym>, <acronym title="Member of Parliament">MP</acronym> or
<acronym title="Members of the Scottish Parliament">MSP</acronym>?</strong><br>
<label for="pc">Enter your UK postcode here:</label> <input type="text" name="pc" id="pc" size="8" maxlength="10" value="<?php
echo _htmlentities($THEUSER->postcode());
?>
" class="text"> <input type="submit" value=" Go " class="submit"></p>
</form>
<div class="sort">
Sort by:
<ul>
<li><?php
echo $th_family_name;
?>
|</li>
<li><?php
echo $th_given_name;
?>
|</li>
示例7: _htmlentities
<div class="search-result search-result--glossary">
<h3 class="search-result__title"><a href="<?php
echo $item['url'];
?>
">“<?php
echo _htmlentities($item['term']);
?>
”</a></h3>
<p class="search-result__description"><?php
echo $item['body'];
?>
</p>
</div>
示例8: glossarise
public function glossarise($body, $tokenize = 0, $urlize = 0)
{
// Turn a body of text into a link-up wonderland of glossary joy
global $this_page;
$findwords = array();
$replacewords = array();
$URL = new URL("glossary");
$URL->insert(array("gl" => ""));
// External links shown within their own definition
// should be the complete and linked url.
// NB. This should only match when $body is a definition beginning with "http:"
if (is_string($body) && preg_match("/^(http:*[^\\s])\$/i", $body)) {
$body = "<a href=\"" . $body . "\" title=\"External link to " . $body . "\">" . $body . "</a>";
return $body;
}
// otherwise, just replace everything.
// generate links from URL when wanted
// NB WRANS is already doing this
if ($urlize == 1) {
$body = preg_replace("~(http(s)?:\\/\\/[^\\s\n]*)\\b(\\/)?~i", "<a href=\"\\0\">\\0</a>", $body);
}
// check for any glossary terms to replace
foreach ($this->replace_order as $glossary_id => $count) {
if ($glossary_id == $this->glossary_id) {
continue;
}
$term_body = $this->terms[$glossary_id]['body'];
$term_title = $this->terms[$glossary_id]['title'];
$URL->update(array("gl" => $glossary_id));
# The regex here ensures that the phrase is only matched if it's not already within <a> tags, preventing double-linking. Kudos to http://stackoverflow.com/questions/7798829/php-regular-expression-to-match-keyword-outside-html-tag-a
$findwords[$glossary_id] = "/\\b(" . $term_title . ")\\b(?!(?>[^<]*(?:<(?!\\/?a\\b)[^<]*)*)<\\/a>)/i";
// catch glossary terms within their own definitions
if ($glossary_id == $this->glossary_id) {
$replacewords[] = "<strong>\\1</strong>";
} else {
if ($this_page == "admin_glossary") {
$link_url = "#gl" . $glossary_id;
} else {
$link_url = $URL->generate('url');
}
$title = _htmlentities(trim_characters($term_body, 0, 80));
$replacewords[] = "<a href=\"{$link_url}\" title=\"{$title}\" class=\"glossary\">\\1</a>";
}
}
// Highlight all occurrences of another glossary term in the definition.
$body = preg_replace($findwords, $replacewords, $body, 1);
if (isset($this->glossary_id)) {
$body = preg_replace("/(?<![>\\.\\'\\/])\\b(" . $this->terms[$this->glossary_id]['title'] . ")\\b(?![<\\'])/i", '<strong>\\1</strong>', $body, 1);
}
// Replace any phrases in wikipedia
// TODO: Merge this code into above, so our gloss and wikipedia
// don't clash (e.g. URLs getting doubly munged etc.)
$body = wikipedize($body);
return $body;
}
示例9: cover
echo $search_section == 'spwrans' ? ' selected' : '';
?>
>Written answers</option>
</optgroup>
</select>
</div>
<div class="search-option__hint">
<p>Restrict results to a particular parliament or assembly that we cover (e.g. the Scottish Parliament), or a particular type of data within an institution, such as Commons Written Answers.</p>
</div>
</div>
<h4>Column</h4>
<div class="search-option">
<div class="search-option__control">
<input name="column" type="text" value="<?php
echo _htmlentities($search_column);
?>
" class="form-control">
</div>
<div class="search-option__hint">
<p>If you know the actual Hansard column number of the information you are interested in (perhaps you’re looking up a paper reference), you can restrict results to that.</p>
</div>
</div>
<p><input type="submit" class="button" value="Search"></p>
</div>
</div>
</form>
<script type="text/javascript">
$(function(){
示例10: gmdate
$MPURL->insert(array('pid' => $person_id));
$mpurl = $MPURL->generate();
$date = gmdate('Y-m-d');
$time = gmdate('H:i:s');
$datenow = $date . 'T' . $time . '+00:00';
// Prepare the meat of the RSS file.
$items = '';
$entries = '';
if (isset($speeches['rows']) && count($speeches['rows']) > 0) {
foreach ($speeches['rows'] as $n => $row) {
// While we're linking to individual speeches,
// the text is the body of the parent, ie (sub)section.
$title = _htmlentities(str_replace('—', '-', $row['parent']['body']));
$link = isset($row['listurl']) ? $row['listurl'] : '';
$link = 'http://' . DOMAIN . $link;
$description = _htmlentities(trim_characters($row['body'], 0, 200));
$contentencoded = $row['body'];
$hdate = format_date($row['hdate'], 'Y-m-d');
if ($row['htime'] != NULL) {
$htime = format_time($row['htime'], 'H:i:s');
} else {
$htime = '00:00:00';
}
$date = $hdate . 'T' . $htime . '+00:00';
$items .= '<rdf:li rdf:resource="' . $link . '" />' . "\n";
$entries .= "<item rdf:about=\"{$link}\">\n\t<title>{$title}</title>\n\t<link>{$link}</link>\n\t<description>{$description}</description>\n\t<content:encoded><![CDATA[{$contentencoded}]]></content:encoded>\n\t<dc:date>{$date}</dc:date>\n</item>\n";
}
}
// Prepare the whole text of the RSS file.
$rsstext = '<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF
示例11: _htmlentities
">
<?php
} else {
?>
<input type="text" name="postcode" id="id_postcode">
<?php
}
?>
</p>
<p>
<label for="id_email">Your email address</label>
<?php
if (isset($data['email'])) {
?>
<input type="text" name="email" id="id_email" value="<?php
echo _htmlentities($data['email']);
?>
">
<?php
} else {
?>
<input type="text" name="email" id="id_email">
<?php
}
?>
</p>
<p>
<button type="submit" class="button radius">Set up alerts</button>
</p>
</form>
示例12: output
/**
* Output Page
*
* Assembles a completed page from template and sends it to output.
*
* @param string $template The name of the template file to load.
* @param array $data An associative array of data to be made available to the template.
*/
public static function output($template, $data = array())
{
// Include includes.
// TODO: Wrap these in a class somewhere autoloadable.
include_once INCLUDESPATH . 'postcode.inc';
////////////////////////////////////////////////////////////
// Find the user's country. Used by header, so a safe bit to do regardless.
if (preg_match('#^[A-Z]{2}$#i', get_http_var('country'))) {
$data['country'] = strtoupper(get_http_var('country'));
} else {
$data['country'] = Gaze::get_country_by_ip($_SERVER["REMOTE_ADDR"]);
}
////////////////////////////////////////////////////////////
// Get the page data
global $DATA, $this_page, $THEUSER;
////////////////////////////////////////////////////////////
// Assemble the page title
$data['page_title'] = '';
$sitetitle = $DATA->page_metadata($this_page, "sitetitle");
$keywords_title = '';
if ($this_page == 'overview') {
$data['page_title'] = $sitetitle . ': ' . $DATA->page_metadata($this_page, "title");
} else {
if ($page_title = $DATA->page_metadata($this_page, "title")) {
$data['page_title'] = $page_title;
}
// We'll put this in the meta keywords tag.
$keywords_title = $data['page_title'];
$parent_page = $DATA->page_metadata($this_page, 'parent');
if ($parent_title = $DATA->page_metadata($parent_page, 'title')) {
if ($data['page_title']) {
$data['page_title'] .= ': ';
}
$data['page_title'] .= $parent_title;
}
if ($data['page_title'] == '') {
$data['page_title'] = $sitetitle;
} else {
$data['page_title'] .= ' - ' . $sitetitle;
}
}
////////////////////////////////////////////////////////////
// Meta keywords
if (!($data['meta_keywords'] = $DATA->page_metadata($this_page, "meta_keywords"))) {
$data['meta_keywords'] = $keywords_title;
if ($data['meta_keywords']) {
$data['meta_keywords'] .= ', ';
}
$data['meta_keywords'] .= 'Hansard, Official Report, Parliament, government, House of Commons, House of Lords, MP, Peer, Member of Parliament, MPs, Peers, Lords, Commons, Scottish Parliament, Northern Ireland Assembly, MSP, MLA, MSPs, MLAs';
}
$data['meta_description'] = '';
if ($DATA->page_metadata($this_page, "meta_description")) {
$data['meta_description'] = $DATA->page_metadata($this_page, "meta_description");
}
////////////////////////////////////////////////////////////
// Header <link>s
$data['header_links'] = array();
if ($this_page != 'overview') {
$URL = new \URL('overview');
$data['header_links'][] = array('rel' => 'start', 'title' => 'Home', 'href' => $URL->generate());
}
////////////////////////////////////////////////////////////
// Create the next/prev/up links for navigation.
// Their data is put in the metadata in hansardlist.php
$nextprev = $DATA->page_metadata($this_page, "nextprev");
if ($nextprev) {
// Four different kinds of back/forth links we might build.
$links = array("first", "prev", "up", "next", "last");
foreach ($links as $type) {
if (isset($nextprev[$type]) && isset($nextprev[$type]['url'])) {
if (isset($nextprev[$type]['body'])) {
$linktitle = _htmlentities(trim_characters($nextprev[$type]['body'], 0, 40));
if (isset($nextprev[$type]['speaker']) && count($nextprev[$type]['speaker']) > 0) {
$linktitle = $nextprev[$type]['speaker']['name'] . ': ' . $linktitle;
}
} elseif (isset($nextprev[$type]['hdate'])) {
$linktitle = format_date($nextprev[$type]['hdate'], SHORTDATEFORMAT);
}
$data['header_links'][] = array('rel' => $type, 'title' => $linktitle, 'href' => $nextprev[$type]['url']);
}
}
}
////////////////////////////////////////////////////////////
// Page RSS URL
if ($DATA->page_metadata($this_page, 'rss')) {
// If this page has an RSS feed set.
$data['page_rss_url'] = 'http://' . DOMAIN . WEBPATH . $DATA->page_metadata($this_page, 'rss');
}
////////////////////////////////////////////////////////////
// Site Navigation Links
$data['assembly_nav_links'] = array();
$data['section_nav_links'] = array();
//.........这里部分代码省略.........
示例13: generate_next_prev_link
private function generate_next_prev_link($nextprev, $linktype)
{
$link = null;
if (isset($nextprev[$linktype]) && isset($nextprev[$linktype]['url'])) {
if (isset($nextprev[$linktype]['body'])) {
$linktitle = _htmlentities(trim_characters($nextprev[$linktype]['body'], 0, 40));
if (isset($nextprev[$linktype]['speaker']) && count($nextprev[$linktype]['speaker']) > 0) {
$linktitle = $nextprev[$linktype]['speaker']['name'] . ': ' . $linktitle;
}
} elseif (isset($nextprev[$linktype]['hdate'])) {
$linktitle = format_date($nextprev[$linktype]['hdate'], SHORTDATEFORMAT);
}
$link = array('rel' => $linktype, 'title' => $linktitle, 'href' => $nextprev[$linktype]['url']);
}
return $link;
}
示例14: _get_item
public function _get_item($args)
{
global $PAGE;
if (!isset($args['gid']) && $args['gid'] == '') {
$PAGE->error_message("Sorry, we don't have an item gid.");
return false;
}
// Get all the data just for this epobject_id.
$input = array('amount' => array('body' => true, 'speaker' => true, 'comment' => true, 'votes' => true), 'where' => array('gid=' => $this->gidprefix . $args['gid']));
twfy_debug(get_class($this), "looking for redirected gid");
$gid = $this->gidprefix . $args['gid'];
$q = $this->db->query("SELECT gid_to FROM gidredirect WHERE gid_from = :gid", array(':gid' => $gid));
if ($q->rows() == 0) {
$itemdata = $this->_get_hansard_data($input);
} else {
do {
$gid = $q->field(0, 'gid_to');
$q = $this->db->query("SELECT gid_to FROM gidredirect WHERE gid_from = :gid", array(':gid' => $gid));
} while ($q->rows() > 0);
twfy_debug(get_class($this), "found redirected gid {$gid}");
$input['where'] = array('gid=' => $gid);
$itemdata = $this->_get_hansard_data($input);
if (count($itemdata) > 0) {
throw new RedirectException(fix_gid_from_db($gid));
}
}
if (count($itemdata) > 0) {
$itemdata = $itemdata[0];
}
if (count($itemdata) == 0) {
/* Deal with old links to some Lords pages. Somewhere. I can't remember where */
$this->check_gid_change($args['gid'], 'a', '');
if (substr($args['gid'], -1) == 'L') {
$letts = array('a', 'b', 'c', 'd', 'e');
for ($i = 0; $i < 4; $i++) {
$this->check_gid_change($args['gid'], $letts[$i], $letts[$i + 1]);
}
}
/* A lot of written answers were moved from 10th to 11th May and 11th May to 12th May.
Deal with the bots who have stored links to those now non-existant written answers. */
/* 2007-05-31: And then they were moved BACK in the volume edition, ARGH */
$this->check_gid_change($args['gid'], '2006-05-10a', '2006-05-10c');
$this->check_gid_change($args['gid'], '2006-05-10a', '2006-05-11d');
$this->check_gid_change($args['gid'], '2006-05-11b', '2006-05-11d');
$this->check_gid_change($args['gid'], '2006-05-11b', '2006-05-12c');
$this->check_gid_change($args['gid'], '2006-05-11c', '2006-05-10c');
$this->check_gid_change($args['gid'], '2006-05-12b', '2006-05-11d');
$this->check_gid_change($args['gid'], '2007-01-08', '2007-01-05');
$this->check_gid_change($args['gid'], '2007-02-19', '2007-02-16');
/* More movearounds... */
$this->check_gid_change($args['gid'], '2005-10-10d', '2005-09-12a');
$this->check_gid_change($args['gid'], '2005-10-14a', '2005-10-13b');
$this->check_gid_change($args['gid'], '2005-10-18b', '2005-10-10e');
$this->check_gid_change($args['gid'], '2005-11-17b', '2005-11-15c');
$this->check_gid_change($args['gid'], '2007-01-08a', '2007-01-08e');
/* Right back when Lords began, we sent out email alerts when they weren't on the site. So this was to work that. */
#$lord_gid_like = 'uk.org.publicwhip/lords/' . $args['gid'] . '%';
#$q = $this->db->query('SELECT source_url FROM hansard WHERE gid LIKE :lord_gid_like', array(':lord_gid_like' => $lord_gid_like));
#$u = '';
#if ($q->rows()) {
# $u = $q->field(0, 'source_url');
# $u = '<br><a href="'. $u . '">' . $u . '</a>';
#}
$PAGE->error_message("Sorry, there is no Hansard object with a gid of '" . _htmlentities($args['gid']) . "'.");
return false;
}
return $itemdata;
}
示例15: format_date
$date = format_date($date, SHORTDATEFORMAT);
$time = format_time($time, TIMEFORMAT);
?>
<dt><a href="<?php
echo _htmlentities($trackback['url']);
?>
"><?php
echo _htmlentities($trackback['title']);
?>
</a></dt>
<dd><?php
echo _htmlentities($trackback['excerpt']);
?>
<br>
<small>At <?php
echo _htmlentities($trackback['blog_name']);
?>
on <?php
echo $date . ' ' . $time;
?>
</small>
</dd>
<?php
}
// End cycling through trackbacks.
?>
</dl>
</div> <!-- end trackbacks -->
<?php
if ($stripe_must_be_ended) {
$PAGE->stripe_end();