Пример #1
0
 protected function display_front()
 {
     global $PAGE, $DATA, $this_page;
     // No date or debate id. Show some recent debates
     $this_page = "alldebatesfront";
     $DEBATELIST = new \DEBATELIST();
     $debates = array();
     $debates['data'] = $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $debates['calendar'] = $DEBATELIST->display('calendar', $args, 'none');
     $debates['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $this_page = "whallfront";
     $whall = array();
     $WHALLLIST = new \WHALLLIST();
     $whall['data'] = $WHALLLIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $whall['calendar'] = $WHALLLIST->display('calendar', $args, 'none');
     $whall['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $this_page = "lordsdebatesfront";
     $lords = array();
     $LORDSDEBATELIST = new \LORDSDEBATELIST();
     $lords['data'] = $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $lords['calendar'] = $LORDSDEBATELIST->display('calendar', $args, 'none');
     $lords['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $data = array('debates' => $debates, 'lords' => $lords, 'whall' => $whall);
     $data['template'] = 'section/index';
     $this_page = "alldebatesfront";
     return $data;
 }
Пример #2
0
function day_speeches($search, $type, $date)
{
    $search = "{$search} date:{$date} section:{$type} groupby:speech";
    global $SEARCHENGINE, $want;
    $SEARCHENGINE = new SEARCHENGINE($search);
    $db = new ParlDB();
    $q = $db->query("select hpos from hansard where gid = :gid", array(':gid' => 'uk.org.publicwhip/' . $want['gid']));
    $want['hpos'] = $q->field(0, 'hpos');
    $LIST = new DEBATELIST();
    $args = array('s' => $search, 'p' => 1, 'num' => 200, 'pop' => 1, 'o' => 'd');
    $LIST->display('search_video', $args, 'html');
}
Пример #3
0
 public function getFeaturedDebate($gid, $title, $context, $related)
 {
     if (strpos($gid, 'lords') !== false) {
         $debatelist = new \LORDSDEBATELIST();
     } else {
         $debatelist = new \DEBATELIST();
     }
     $item = $debatelist->display('featured_gid', array('gid' => $gid), 'none');
     $item = $item['data'];
     $item['headline'] = $title;
     $item['context'] = $context;
     $item['featured'] = true;
     $related_debates = array();
     foreach ($related as $related_gid) {
         if ($related_gid) {
             $related_item = $debatelist->display('featured_gid', array('gid' => $related_gid), 'none');
             $related_debates[] = $related_item['data'];
         }
     }
     $item['related'] = $related_debates;
     return $item;
 }
Пример #4
0
function day_speeches($search, $type, $date) {
	$search = "$search date:$date section:$type groupby:speech";

	global $SEARCHENGINE, $want;
	$SEARCHENGINE = new SEARCHENGINE($search);

	$db = new ParlDB;
	$q_gid = mysql_real_escape_string('uk.org.publicwhip/' . $want['gid']);
	$q = $db->query("select hpos from hansard where gid='$q_gid'");
	$want['hpos'] = $q->field(0, 'hpos');

	$LIST = new DEBATELIST;
    	$args = array (
    		's' => $search,
    		'p' => 1,
    		'num' => 200,
		'pop' => 1,
		'o' => 'd',
    	);
	$LIST->display('search_video', $args, 'html');
}
Пример #5
0
<?php

include_once '../../includes/easyparliament/init.php';
$LIST = new DEBATELIST();
# Guess it should really use a View of none, but this way I get all
# the display stuff done for me...
ob_start();
$LIST->display('calendar', array('months' => 1));
$cal = ob_get_clean();
$cal = preg_replace('#<a href="' . WEBPATH . '/debates/\\?d=(.*?)"#', '<a onclick="return loadDay(\'$1\');" target="_blank" href="http://www.openaustralia.org/debates/?d=$1"', $cal);
print $cal;
Пример #6
0
<?php

include_once '../../includes/easyparliament/init.php';
include_once INCLUDESPATH . "easyparliament/glossary.php";
$this_page = "debate";
$this_page = "debates";
$dates = file('alldates');
shuffle($dates);
$date = trim($dates[0]);
$db = new ParlDB();
$q = $db->query("select gid from hansard where htype in (10,11) and major=1 and hdate='{$date}' order by rand() limit 1");
$gid = $q->field(0, 'gid');
$args = array('gid' => fix_gid_from_db($gid), 'sort' => 'regexp_replace');
$GLOSSARY = new GLOSSARY($args);
$LIST = new DEBATELIST();
$result = $LIST->display('gid', $args);
$PAGE->page_end();
Пример #7
0
    		array (
    			'type' => 'include',
    			'content' => "hocdebates"
    		)
    	));
    */
} else {
    // No date or debate id. Show recent years with debates on.
    $this_page = "debatesfront";
    $PAGE->page_start_mobile();
    $PAGE->stripe_start();
    ?>
				<h4>Busiest debates from the most recent week</h4>
<?php 
    $DEBATELIST = new DEBATELIST();
    $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 20, 'mobile' => 1));
    $rssurl = $DATA->page_metadata($this_page, 'rss');
    /*
    	$PAGE->stripe_end(array(
    		array (
    			'type' => 'nextprev'
    		),
    		array (
    			'type' => 'include',
    			'content' => 'calendar_hocdebates'
    		),
    		array (
    			'type' => 'include',
    			'content' => "hocdebates"
    		),
    		array (
Пример #8
0
    $PAGE->page_end();
    exit;
}
$this_page = 'hansard';
$PAGE->page_start();
// Page title will appear here.
$PAGE->stripe_start('head-1');
$message = $PAGE->recess_message();
if ($message != '') {
    print "<p><strong>{$message}</strong></p>\n";
}
$PAGE->stripe_end();
$PAGE->stripe_start();
?>
				<h3>Busiest House of Representatives debates from the most recent week</h3>
<?php 
$DEBATELIST = new DEBATELIST();
$DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => $number_of_debates_to_show));
$MOREURL = new URL('debatesfront');
$anchor = $number_of_debates_to_show + 1;
?>
				<p><strong><a href="<?php 
echo $MOREURL->generate();
?>
#d<?php 
echo $anchor;
?>
">See more debates</a></strong></p>
<?php 
$PAGE->stripe_end(array(array('type' => 'include', 'content' => "hocdebates_short"), array('type' => 'include', 'content' => "calendar_hocdebates")));
$PAGE->page_end();
Пример #9
0
    $PAGE->page_start();
    $PAGE->stripe_start();
    $args = array('year' => get_http_var('y'));
    $LIST = new DEBATELIST();
    $LIST->display('calendar', $args);
    $PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => "hocdebates")));
} else {
    // No date or debate id. Show some recent debates
    $this_page = "alldebatesfront";
    $PAGE->page_start();
    $PAGE->stripe_start();
    ?>
	<h4>Recent House of Commons debates</h4>
<?php 
    $DEBATELIST = new DEBATELIST();
    $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
    $rssurl = $DATA->page_metadata($this_page, 'rss');
    $PAGE->stripe_end(array(array('type' => 'html', 'content' => '
<div class="block">
<h4>Search debates</h4>
<div class="blockbody">
<form action="/search/" method="get">
<p><input type="text" name="s" value="" size="40"> <input type="submit" value="Go">
<br><input type="checkbox" name="section[]" value="debates" checked id="section_commons">
<label for="section_commons">Commons</label>
<input type="checkbox" name="section[]" value="whall" checked id="section_whall">
<label for="section_whall">Westminster Hall</label>
<input type="checkbox" name="section[]" value="lords" checked id="section_lords">
<label for="section_lords">Lords</label>
</p>
</form>
Пример #10
0
<?php

global $PAGE;
// The calendar that appears in sidebars linking to debates.
// There is a separate one for wrans (so we can have both on the same page).
// Contents varies depending on the page we're on...
if ($this_page == 'debatesday') {
    $date = get_http_var('d');
    if (preg_match('#^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$#', $date, $m)) {
        $year = $m[1];
        $month = $m[2];
        $day = $m[3];
        $args = array('year' => $year, 'month' => $month, 'onday' => $date);
        $title = 'Debates this month';
    } else {
        $args = array('months' => 1);
        $title = 'Recent debates';
    }
} else {
    $args = array('months' => 1);
    $title = 'Recent debates';
}
$PAGE->block_start(array('title' => $title, 'id' => 'calendar'));
$LIST = new DEBATELIST();
$LIST->display('calendar', $args);
$PAGE->block_end();
Пример #11
0
<dt><a href="<?php 
echo $last_dates[1]['listurl'];
?>
">Commons debates</a>
<small><?php 
echo format_date($last_dates[1]['hdate'], LONGERDATEFORMAT);
?>
</small>
</dt>
<dd>The main chamber of the House of Commons is where debates are held
on a variety of topics, oral questions are answered, and new legislation is
debated.

<h3 class="alt">Random recent Commons debate</h3>
<?php 
$DEBATELIST->display('recent_debates', array('days' => 7, 'num' => 1));
$MOREURL = new URL('debatesfront');
?>
        <p align="right"><strong><a href="<?php 
echo $MOREURL->generate();
?>
">See more Commons debates</a></strong></p>

<dt><a href="<?php 
echo $last_dates[2]['listurl'];
?>
">Westminster Hall</a>
<small><?php 
echo format_date($last_dates[2]['hdate'], LONGERDATEFORMAT);
?>
</small>
Пример #12
0
<?php

include_once '../../includes/easyparliament/init.php';
$LIST = new DEBATELIST();
# Guess it should really use a View of none, but this way I get all
# the display stuff done for me...
ob_start();
$LIST->display('date', array('date' => get_http_var('d')));
$cal = ob_get_clean();
$cal = preg_replace('#^.*?(<ul id="hansard-day">)#s', '$1', $cal);
$cal = preg_replace('#<!-- end hansard-day -->.*$#s', '', $cal);
$cal = str_replace('<a href="', '<a target="_blank" href="http://www.theyworkforyou.com', $cal);
print $cal;
Пример #13
0
<?php

include_once "../../includes/easyparliament/init.php";
include_once INCLUDESPATH . "easyparliament/glossary.php";
$this_page = "debate";
// For displaying a SINGLE speech from a debate, with comments and
// an 'Add comment' form.
if (get_http_var('id') != '') {
    // We have the id of the gid of a Hansard item to display, so show it.
    $args = array('gid' => get_http_var('id'), 'glossarise' => 1, 'sort' => 'regexp_replace');
    $DEBATELIST = new DEBATELIST();
    $GLOSSARY = new GLOSSARY($args);
    $result = $DEBATELIST->display('gid', $args);
    // If it is a redirect, change URL
    if (is_string($result)) {
        $URL = new URL('debate');
        $URL->insert(array('id' => $result));
        header('Location: http://' . DOMAIN . $URL->generate('none'), true, 301);
        exit;
    }
    // 12 is speech
    // 13 is procedural - see http://parl.stand.org.uk/cgi-bin/moin.cgi/DataSchema
    if ($DEBATELIST->htype() == '12' || $DEBATELIST->htype() == '13') {
        $PAGE->stripe_start('side', 'comments');
        // Display all comments for this ep object.
        $COMMENTLIST = new COMMENTLIST();
        $args['user_id'] = get_http_var('u');
        // For highlighting their comments.
        $args['epobject_id'] = $DEBATELIST->epobject_id();
        $COMMENTLIST->display('ep', $args);
        $PAGE->stripe_end();
Пример #14
0
 protected function display_front()
 {
     global $PAGE, $DATA, $this_page;
     // No date or debate id. Show some recent debates
     $this_page = "alldebatesfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent House of Commons debates</h2>
 <?php 
     $DEBATELIST = new \DEBATELIST();
     $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'html', 'content' => '
 <div class="block">
 <h4>Search debates</h4>
 <div class="blockbody">
 <form action="/search/" method="get">
 <p><input type="text" name="q" id="search_input" value="" size="40"> <input type="submit" value="Go">
 <br><input type="checkbox" name="section[]" value="debates" checked id="section_commons">
 <label for="section_commons">Commons</label>
 <input type="checkbox" name="section[]" value="whall" checked id="section_whall">
 <label for="section_whall">Westminster Hall</label>
 <input type="checkbox" name="section[]" value="lords" checked id="section_lords">
 <label for="section_lords">Lords</label>
 </p>
 </form>
 </div>
 </div>
 '), array('type' => 'include', 'content' => 'calendar_hocdebates'), array('type' => 'include', 'content' => "hocdebates"), array('type' => 'html', 'content' => '<div class="block">
 <h4>RSS feed</h4>
 <p><a href="' . WEBPATH . $rssurl . '"><img align="middle" src="http://www.theyworkforyou.com/images/rss.gif" border="0" alt="RSS feed"></a>
 <a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
 </div>')));
     $this_page = "whallfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent Westminster Hall debates</h2>
 <?php 
     $WHALLLIST = new \WHALLLIST();
     $WHALLLIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'include', 'content' => 'calendar_whalldebates'), array('type' => 'include', 'content' => "whalldebates"), 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>')));
     $this_page = "lordsdebatesfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent House of Lords debates</h2>
 <?php 
     $LORDSDEBATELIST = new \LORDSDEBATELIST();
     $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => 'minisurvey'), 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>')));
 }