本文整理汇总了PHP中twfy_debug_timestamp函数的典型用法代码示例。如果您正苦于以下问题:PHP twfy_debug_timestamp函数的具体用法?PHP twfy_debug_timestamp怎么用?PHP twfy_debug_timestamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了twfy_debug_timestamp函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: person_recent_appearances
function person_recent_appearances($member) {
global $DATA, $SEARCHENGINE, $this_page;
echo '<a name="hansard"></a>';
$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 "<h2>$title</h2>";
//$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();
global $memcache;
if (!$memcache) {
$memcache = new Memcache;
$memcache->connect('localhost', 11211);
}
$recent = $memcache->get(OPTION_TWFY_DB_NAME . ':recent_appear:' . $member['person_id']);
if (!$recent) {
$HANSARDLIST = new HANSARDLIST();
$searchstring = "speaker:$member[person_id]";
$SEARCHENGINE = new SEARCHENGINE($searchstring);
$args = array (
's' => $searchstring,
'p' => 1,
'num' => 3,
'pop' => 1,
'o' => 'd',
);
ob_start();
$HANSARDLIST->display('search_min', $args);
$recent = ob_get_clean();
$memcache->set(OPTION_TWFY_DB_NAME . ':recent_appear:' . $member['person_id'], $recent, MEMCACHE_COMPRESSED, 3600);
}
print $recent;
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();
}
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:60,代码来源:person.php
示例2: array
$commendata = array('epobject_id' => $LORDSDEBATELIST->epobject_id(), 'gid' => get_http_var('gid'), 'return_page' => $this_page);
$PAGE->comment_form($commendata);
if ($THEUSER->isloggedin()) {
$sidebar = array(array('type' => 'include', 'content' => 'comment'));
$PAGE->stripe_end($sidebar);
} else {
$PAGE->stripe_end();
}
# $TRACKBACK = new TRACKBACK;
# $TRACKBACK->display('epobject_id', $commendata);
}
} else {
// No date or debate id. Show recent years with debates on.
$this_page = "lordsdebatesfront";
$PAGE->page_start();
$PAGE->stripe_start();
?>
<h2>Busiest debates from the most recent week</h2>
<?php
$LORDSDEBATELIST = new LORDSDEBATELIST();
$LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 20));
$rssurl = $DATA->page_metadata($this_page, 'rss');
$PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => 'calendar_holdebates'), array('type' => 'include', 'content' => "holdebates"), array('type' => 'html', 'content' => '<div class="block">
<h4>RSS feed</h4>
<p><a href="' . WEBPATH . $rssurl . '"><img alt="RSS feed" border="0" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a>
<a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
</div>')));
}
$PAGE->page_end();
twfy_debug_timestamp("page end");
开发者ID:nallachaitu,项目名称:theyworkforyou,代码行数:30,代码来源:index.php
示例3: twfy_debug_timestamp
> single constituency
> multiple constituency
Error condition test cases:
> no postcode match
>
*/
include_once "../../includes/easyparliament/init.php";
include_once INCLUDESPATH . "easyparliament/member.php";
// From http://cvs.sourceforge.net/viewcvs.py/publicwhip/publicwhip/website/
include_once INCLUDESPATH . "postcode.inc";
include_once INCLUDESPATH . 'technorati.php';
include_once '../api/api_getGeometry.php';
include_once '../api/api_getConstituencies.php';
twfy_debug_timestamp("after includes");
$errors = array();
$members = array();
if (stristr($_SERVER["HTTP_ACCEPT"], "application/json")) {
header("Content-type: application/json;charset=utf-8");
} else {
header("Content-type: text/json;charset=utf-8");
}
// Some legacy URLs use 'p' rather than 'pid' for person id. So we still
// need to detect these.
$pid = get_http_var('pid') != '' ? get_http_var('pid') : get_http_var('p');
$name = strtolower(str_replace(array('_'), array(' '), get_http_var('n')));
$cconstituency = strtolower(str_replace(array('_', '.', ' and '), array(' ', '&', ' & '), get_http_var('c')));
# *** postcode functions use global $constituency!!! ***
// CHECK SUBMITTED POSTCODE - only does postcode
if (get_http_var('postcode') != '') {
开发者ID:jrobens,项目名称:openaustralia-parser,代码行数:31,代码来源:openoz_memberemail.php
示例4: twfy_debug_timestamp
$DATA->set_page_metadata($this_page, 'heading', '');
// So we can put a link in the <head> in $PAGE->page_start();
$feedurl = $DATA->page_metadata('mp_rss', 'url') . $MEMBER->person_id() . '.rdf';
// Only set the feed URL if it exists. This ensures that former MP's don't show a feed.
if (file_exists(BASEDIR . $feedurl)) {
$DATA->set_page_metadata($this_page, 'rss', $feedurl);
}
twfy_debug_timestamp("before page_start");
$PAGE->page_start_mobile();
twfy_debug_timestamp("after page_start");
twfy_debug_timestamp("before stripe start");
$PAGE->stripe_start();
twfy_debug_timestamp("after stripe start");
twfy_debug_timestamp("before display of MP");
$MEMBER->display();
twfy_debug_timestamp("after display of MP");
// SIDEBAR.
// We have to generate this HTML to pass to stripe_end().
$linkshtml = $PAGE->generate_member_links($MEMBER, $MEMBER->extra_info());
$sidebars = array(array('type' => 'include', 'content' => 'donate'), array('type' => 'include', 'content' => 'mp_speech_search'), array('type' => 'html', 'content' => $linkshtml));
/*
if ($rssurl = $DATA->page_metadata($this_page, 'rss')) {
$sidebars[] = array (
'type' => 'html',
'content' => $PAGE->member_rss_block(array('appearances' => WEBPATH . $rssurl))
);
}
*/
if ($MEMBER->house(1)) {
$previous_people = $MEMBER->previous_mps();
if ($previous_people) {
开发者ID:leowmjw,项目名称:twfy,代码行数:31,代码来源:mobile.php
示例5: define
define("STARTTIME", getmicrotime());
if (!isset($_SERVER['WINDIR'])) {
$rusage = getrusage();
define('STARTTIMES', $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec']);
define('STARTTIMEU', $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec']);
}
include_once INCLUDESPATH . "data.php";
include_once INCLUDESPATH . "mysql.php";
class ParlDB extends MySQL
{
public function ParlDB()
{
$this->init(OPTION_TWFY_DB_HOST, OPTION_TWFY_DB_USER, OPTION_TWFY_DB_PASS, OPTION_TWFY_DB_NAME);
}
}
include_once INCLUDESPATH . "url.php";
include_once INCLUDESPATH . "lib_filter.php";
include_once INCLUDESPATH . "easyparliament/user.php";
// Test to see if this is a new-style template using the renderer class.
if (!isset($new_style_template) or $new_style_template !== TRUE) {
// This is an old-style page. Use the old page classes.
include_once INCLUDESPATH . "easyparliament/page.php";
}
include_once INCLUDESPATH . "easyparliament/hansardlist.php";
include_once INCLUDESPATH . "easyparliament/commentlist.php";
include_once INCLUDESPATH . "easyparliament/comment.php";
include_once INCLUDESPATH . "easyparliament/trackback.php";
// Added in as new module by Richard Allan MP
include_once INCLUDESPATH . "easyparliament/alert.php";
twfy_debug_timestamp("at end of init.php");
开发者ID:udp12,项目名称:theyworkforyou,代码行数:30,代码来源:init.php
示例6:
twfy_debug_timestamp('Before glossarise');
$bodies = $GLOSSARY->glossarise($bodies, $data['info']['glossarise']);
twfy_debug_timestamp('After glossarise');
}
if ($SEARCHENGINE) {
// We have some search terms to highlight.
twfy_debug_timestamp('Before highlight');
$bodies = $SEARCHENGINE->highlight($bodies);
twfy_debug_timestamp('After highlight');
}
if (isset($data['info']['glossarise']) && ($data['info']['glossarise'] == 1)) {
// Now we replace the title attributes for the glossarised links
// to avoid words being highlighted within them.
twfy_debug_timestamp('Before glossarise_titletags');
$bodies = $GLOSSARY->glossarise_titletags($bodies, 1);
twfy_debug_timestamp('After glossarise_titletags');
}
$speeches = 0;
for ($i=0; $i<count($data['rows']); $i++) {
if ($data['rows'][$i]['htype'] == 12)
$data['rows'][$i]['body'] = $bodies[$i];
if ($data['rows'][$i]['htype'] == 12 || $data['rows'][$i]['htype'] == 13)
$speeches++;
}
// Stores the current time of items, so we can tell when an item appears
// at a new time.
$timetracker = 0;
开发者ID:henare,项目名称:theyworkforyou,代码行数:30,代码来源:hansard_gid.php
示例7: display_section_or_speech
protected function display_section_or_speech($args = array())
{
global $DATA, $this_page, $THEUSER;
# += as we *don't* want to override any already supplied argument
$args += array('gid' => get_http_var('id'), 's' => get_http_var('s'), 'member_id' => get_http_var('m'));
if (preg_match('/speaker:(\\d+)/', get_http_var('s'), $mmm)) {
$args['person_id'] = $mmm[1];
}
try {
$data = $this->list->display('gid', $args, 'none');
} catch (\RedirectException $e) {
$URL = new \URL($this->major_data['page_all']);
if ($this->major == 6) {
# Magically (as in I can't remember quite why), pbc_clause will
# contain the new URL without any change...
$URL->remove(array('id'));
} else {
$URL->insert(array('id' => $e->getMessage()));
}
# put the search term back in so highlighting works.
# NB: as we don't see the # part of the URL we lose this :(
if ($args['s'] !== '') {
$URL->insert(array('s' => $args['s']));
}
redirect($URL->generate('none'));
}
$data['individual_item'] = $this->list->commentspage == $this_page;
if ($data['individual_item']) {
$COMMENTLIST = new \COMMENTLIST();
$args['user_id'] = get_http_var('u');
$args['epobject_id'] = $this->list->epobject_id();
$data['comments']['object'] = $COMMENTLIST;
$data['comments']['args'] = $args;
$data['comments']['commentdata'] = array('epobject_id' => $this->list->epobject_id(), 'gid' => get_http_var('id'), 'return_page' => $this_page);
}
if (!isset($data['info'])) {
header("HTTP/1.0 404 Not Found");
exit;
# XXX
}
# Okay, let's set up highlighting and glossarisation
$SEARCHENGINE = null;
if (isset($data['info']['searchstring']) && $data['info']['searchstring'] != '') {
$SEARCHENGINE = new \SEARCHENGINE($data['info']['searchstring']);
}
// Before we print the body text we need to insert glossary links
// and highlight search string words.
$speeches = 0;
$bodies = array();
foreach ($data['rows'] as $row) {
$htype = $row['htype'];
if ($htype == 12 || $htype == 13) {
$speeches++;
}
$body = $row['body'];
$body = preg_replace('#<phrase class="honfriend" id="uk.org.publicwhip/member/(\\d+)" name="([^"]*?)">(.*?\\s*\\((.*?)\\))</phrase>#', '<a href="/mp/?m=$1" title="Our page on $2 - \'$3\'">$4</a>', $body);
$body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\\d+)-(\\d+)-(\\d+)\\.(.*?)">(.*?)</phrase>#', function ($matches) {
return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] . '">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>';
}, $body);
#$body = preg_replace('#<phrase class="offrep" id="((.*?)/(\d+)-(\d+)-(\d+)\.(.*?))">(.*?)</phrase>#e', "\"<a href='/search/?pop=1&s=date:$3$4$5+column:$6+section:$2&match=$1'>\" . str_replace('Official Report', 'Hansard', '$7') . '</a>'", $body);
$bodies[] = $body;
}
// Do all this unless the glossary is turned off in the URL
if (get_http_var('ug') != 1) {
// And glossary phrases
twfy_debug_timestamp('Before glossarise');
$args['sort'] = "regexp_replace";
$GLOSSARY = new \GLOSSARY($args);
$bodies = $GLOSSARY->glossarise($bodies, 1);
twfy_debug_timestamp('After glossarise');
}
if ($SEARCHENGINE) {
// We have some search terms to highlight.
twfy_debug_timestamp('Before highlight');
$bodies = $SEARCHENGINE->highlight($bodies);
twfy_debug_timestamp('After highlight');
}
$first_speech = null;
$data['section_title'] = '';
$subsection_title = '';
for ($i = 0; $i < count($data['rows']); $i++) {
$row = $data['rows'][$i];
$htype = $row['htype'];
// HPOS should be defined below if it's needed; otherwise default to 0
$heading_hpos = 0;
if ($htype == 10) {
$data['section_title'] = $row['body'];
$heading_hpos = $row['hpos'];
} elseif ($htype == 11) {
$subsection_title = $row['body'];
$heading_hpos = $row['hpos'];
} elseif ($htype == 12) {
# Splitting out highlighting results back into individual bits
$data['rows'][$i]['body'] = $bodies[$i];
}
if ($htype == 12 || $htype == 13) {
if (!$first_speech) {
$first_speech = $data['rows'][$i];
}
# Voting links
//.........这里部分代码省略.........
开发者ID:sarahs-synapse,项目名称:theyworkforyou,代码行数:101,代码来源:SectionView.php
示例8: display_member
//.........这里部分代码省略.........
?>
</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> <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>";
}
$this->block_end();
}
if (!in_array(1, $member['houses']) || $member['party'] != 'Sinn Fein') {
?>
<a name="hansard"></a> <?php
$title = 'Most recent appearances in parliament';
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;
}
$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
}
开发者ID:archoo,项目名称:twfy,代码行数:67,代码来源:page.php
示例9: mysociety_footer
}
$body = "<div id=\"rmi-header\">Extract from the register of members' interests</div>";
$body .= $rmi;
if ($show_more) {
$body .= "<p class=\"more\"><a
href=\"{microapp-href:http://" . DOMAIN . $resources_path . "mp/rmi/$member->guardian_aristotle_id}\">Full members'
interests</a></p>";
}
$body .= mysociety_footer();
output_component($body, 'rmi-brief');
break;
default:
output_error('Unknown action');
}
twfy_debug_timestamp();
# ---
function load_member($pid) {
$member = new MEMBER(array('guardian_aristotle_id' => $pid));
if (!$member->valid) output_error('Unknown ID');
$member->load_extra_info();
return $member;
}
function mysociety_footer(){
return '<div class="mysociety-footer"><span><a href="http://mysociety.org">Powered by
</a></span><a class="mysociety-footer-image-link" href="http://mysociety.org"><img src="http://' .
DOMAIN .
'/gadget/guardian/mysociety.gif"
开发者ID:henare,项目名称:theyworkforyou,代码行数:31,代码来源:index.php
示例10: highlightSpeeches
private function highlightSpeeches($data)
{
$SEARCHENGINE = null;
if (isset($data['info']['searchstring']) && $data['info']['searchstring'] != '') {
$SEARCHENGINE = new \SEARCHENGINE($data['info']['searchstring']);
}
// Before we print the body text we need to insert glossary links
// and highlight search string words.
$speeches = 0;
$bodies = array();
foreach ($data['rows'] as $row) {
$htype = $row['htype'];
if ($htype == 12 || $htype == 13) {
$speeches++;
}
$body = $row['body'];
$body = preg_replace('#<phrase class="honfriend" id="uk.org.publicwhip/member/(\\d+)" name="([^"]*?)">(.*?\\s*\\((.*?)\\))</phrase>#', '<a href="/mp/?m=$1" title="Our page on $2 - \'$3\'">$4</a>', $body);
$body = preg_replace('#<phrase class="honfriend" name="([^"]*?)" person_id="uk.org.publicwhip/person/(\\d+)">(.*?\\s*\\((.*?)\\))</phrase>#', '<a href="/mp/?p=$2" title="Our page on $1 - \'$3\'">$4</a>', $body);
$body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\\d+)-(\\d+)-(\\d+)\\.(.*?)">(.*?)</phrase>#', function ($matches) {
return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] . '">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>';
}, $body);
#$body = preg_replace('#<phrase class="offrep" id="((.*?)/(\d+)-(\d+)-(\d+)\.(.*?))">(.*?)</phrase>#e', "\"<a href='/search/?pop=1&s=date:$3$4$5+column:$6+section:$2&match=$1'>\" . str_replace('Official Report', 'Hansard', '$7') . '</a>'", $body);
$bodies[] = $body;
}
if ($SEARCHENGINE) {
// We have some search terms to highlight.
twfy_debug_timestamp('Before highlight');
$bodies = $SEARCHENGINE->highlight($bodies);
twfy_debug_timestamp('After highlight');
}
// Do all this unless the glossary is turned off in the URL
if (get_http_var('ug') != 1) {
// And glossary phrases
twfy_debug_timestamp('Before glossarise');
$args['sort'] = "regexp_replace";
$GLOSSARY = new \GLOSSARY($args);
$bodies = $GLOSSARY->glossarise($bodies, 1);
twfy_debug_timestamp('After glossarise');
}
return array($bodies, $speeches);
}
开发者ID:vijo,项目名称:theyworkforyou,代码行数:41,代码来源:SectionView.php
示例11: display_member
//.........这里部分代码省略.........
</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> <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>";
}
$this->block_end();
}
}
if (!in_array(1, $member['houses']) || $member['party'] != 'Sinn Fein') {
?>
<a name="hansard"></a> <?php
$title = 'Most recent appearances in parliament';
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;
}
$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
}
开发者ID:NathanaelB,项目名称:twfy,代码行数:67,代码来源:page.php
示例12: person_recent_appearances
function person_recent_appearances($member)
{
global $DATA, $SEARCHENGINE, $this_page;
$out = array();
$out['appearances'] = array();
//$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();
$person_id = $member->person_id();
$memcache = new MySociety\TheyWorkForYou\Memcache();
$recent = $memcache->get('recent_appear:' . $person_id);
if (!$recent) {
// Initialise the search engine
$searchstring = "speaker:{$person_id}";
$SEARCHENGINE = new \SEARCHENGINE($searchstring);
$hansard = new MySociety\TheyWorkForYou\Hansard();
$args = array('s' => $searchstring, 'p' => 1, 'num' => 3, 'pop' => 1, 'o' => 'd');
$results = $hansard->search($searchstring, $args);
$recent = serialize($results['rows']);
$memcache->set('recent_appear:' . $person_id, $recent);
}
$out['appearances'] = unserialize($recent);
twfy_debug_timestamp();
$MOREURL = new \URL('search');
$MOREURL->insert(array('pid' => $person_id, 'pop' => 1));
$out['more_href'] = $MOREURL->generate() . '#n4';
$out['more_text'] = 'More of ' . ucfirst($member->full_name()) . '’s recent appearances';
if ($rssurl = $DATA->page_metadata($this_page, 'rss')) {
// If we set an RSS feed for this page.
$HELPURL = new \URL('help');
$out['additional_links'] = '<a href="' . WEBPATH . $rssurl . '" title="XML version of this person’s recent appearances">RSS feed</a> (<a href="' . $HELPURL->generate() . '#rss" title="An explanation of what RSS feeds are for">?</a>)';
}
return $out;
}
开发者ID:sarahs-synapse,项目名称:theyworkforyou,代码行数:37,代码来源:index.php
示例13: display_member
//.........这里部分代码省略.........
$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
}
开发者ID:palfrey,项目名称:twfy,代码行数:67,代码来源:page.php
注:本文中的twfy_debug_timestamp函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论