示例#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
        $PAGE->stripe_start('side', 'addcomment');
        $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");
示例#3
0
文件: index.php 项目: leowmjw/twfy
function comment_on_recent_bullet_point()
{
    global $hansardmajors;
    ?>
	<li><p><strong>Read and comment on:</strong></p>

<?php 
    $DEBATELIST = new DEBATELIST();
    $data[1] = $DEBATELIST->most_recent_day();
    $WRANSLIST = new WRANSLIST();
    $data[3] = $WRANSLIST->most_recent_day();
    $WHALLLIST = new WHALLLIST();
    $data[2] = $WHALLLIST->most_recent_day();
    $WMSLIST = new WMSLIST();
    $data[4] = $WMSLIST->most_recent_day();
    $LORDSDEBATELIST = new LORDSDEBATELIST();
    $data[101] = $LORDSDEBATELIST->most_recent_day();
    $NILIST = new NILIST();
    $data[5] = $NILIST->most_recent_day();
    foreach (array_keys($hansardmajors) as $major) {
        if (array_key_exists($major, $data)) {
            unset($data[$major]['listurl']);
            if (count($data[$major]) == 0) {
                unset($data[$major]);
            }
        }
    }
    major_summary($data);
    ?>
 </li> <?php 
}
示例#4
0
文件: index.php 项目: palfrey/twfy
<!-- Campaign -->
<div class="campaign">
    <p>
        TheyWorkForYou needs your help <span class="chev"><span class="hide">-</span></span> <a href="http://www.pledgebank.com/twfypatrons">Become a patron, donate &pound;5 a month ...</a>
    </p>
</div>

<!-- Latest in parliament -->
<div class="latest col3">
    <h3>Recently in the UK Parliament</h3>
    <div>
        <?php 
//Latest activity (column 1)
$DEBATELIST = new DEBATELIST();
$LORDSDEBATELIST = new LORDSDEBATELIST();
$last_dates = array();
// holds the most recent data there is data for, indexed by type
$last_dates[1] = $DEBATELIST->most_recent_day();
$last_dates[101] = $LORDSDEBATELIST->most_recent_day();
//get html
$latest_html = major_summary($last_dates, false);
echo $latest_html;
?>
    </div>
    <div>
        <?php 
//Latest activity (column 2)
$WHALLLIST = new WHALLLIST();
$WMSLIST = new WMSLIST();
$last_dates = array();
<?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...
$args = array();
if ($this_page == 'lordsdebatesday') {
    $date = get_http_var('d');
    $datebits = explode('-', $date);
    if (count($datebits) > 2) {
        $args = array('year' => $datebits[0], 'month' => $datebits[1], 'onday' => $date);
        $title = 'Debates this month';
    }
}
if (!$args) {
    $args = array('months' => 1);
    $title = 'Recent debates';
}
$PAGE->block_start(array('title' => $title, 'id' => 'calendar'));
$LIST = new LORDSDEBATELIST();
$LIST->display('calendar', $args);
$PAGE->block_end();
示例#6
0
<?php

include_once "../includes/easyparliament/init.php";
//set page name (selects relevant bottom menu item)
$this_page = 'overview';
$PAGE->page_start();
$PAGE->supress_heading = true;
$PAGE->stripe_start("full");
$last_dates = array();
// holds the most recent data there is data for, indexed by type
$DEBATELIST = new DEBATELIST();
$LORDSDEBATELIST = new LORDSDEBATELIST();
$WHALLLIST = new WHALLLIST();
$WMSLIST = new WMSLIST();
$WRANSLIST = new WRANSLIST();
$COMMITTEE = new StandingCommittee();
$last_dates[1] = $DEBATELIST->most_recent_day();
$last_dates[101] = $LORDSDEBATELIST->most_recent_day();
$last_dates[4] = $WMSLIST->most_recent_day();
$last_dates[2] = $WHALLLIST->most_recent_day();
$last_dates[3] = $WRANSLIST->most_recent_day();
$last_dates[6] = $COMMITTEE->most_recent_day();
?>

<div class="welcome_col1">

<!-- Actions -->
<div id="welcome_uk" class="welcome_actions">

    <div>
        <h2>Your representative</h2>
示例#7
0
文件: index.php 项目: leowmjw/twfy
$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->stripe_start();
?>
				<h3>Busiest Senate debates from the most recent week</h3>
<?php 
$DEBATELIST = new LORDSDEBATELIST();
$DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => $number_of_debates_to_show));
$MOREURL = new URL('lordsdebatesfront');
$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' => "holdebates_short"), array('type' => 'include', 'content' => "calendar_holdebates")));
$PAGE->page_end();
示例#8
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>')));
 }