Beispiel #1
0
$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();
$last_dates[4] = $WMSLIST->most_recent_day();
$last_dates[2] = $WHALLLIST->most_recent_day();
//get html
$latest_html = major_summary($last_dates, false);
echo $latest_html;
?>
    </div>
    <div>
        <?php 
//Latest activity (column 3)
$WRANSLIST = new WRANSLIST();
$last_dates = array();
$last_dates[3] = $WRANSLIST->most_recent_day();
/*
            	foreach (array_keys($hansardmajors) as $major) {
            		if (array_key_exists($major, $data)) {
Beispiel #2
0
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 
}
$this_page = "home";
include_once '../includes/easyparliament/init.php';
include_once INCLUDESPATH . "easyparliament/member.php";
$PAGE->page_start();
$PAGE->stripe_start();
///////////////////////////////////////////////////////////////////////////
//  SEARCH AND RECENT HANSARD
// Get the dates, timestamps and links for the most recent debates and wrans.
$DEBATELIST = new DEBATELIST();
$debatesdata = $DEBATELIST->most_recent_day();
$WRANSLIST = new WRANSLIST();
$wransdata = $WRANSLIST->most_recent_day();
$WHALLLIST = new WHALLLIST();
$whalldata = $WHALLLIST->most_recent_day();
$WMSLIST = new WMSLIST();
$wmsdata = $WMSLIST->most_recent_day();
if (count($debatesdata) > 0 && count($wransdata) > 0 && count($whalldata) > 0 && count($wmsdata) > 0) {
    // Links to Debates and Wrans.
    $debatestext = '<a href="' . $debatesdata['listurl'] . '">Debates</a>';
    $wranstext = '<a href="' . $wransdata['listurl'] . '">Written Answers</a>';
    $whalltext = '<a href="' . $whalldata['listurl'] . '">Westminster Hall debates</a>';
    $wmstext = '<a href="' . $wmsdata['listurl'] . '">Written Ministerial Statements</a>';
    // Now we work out whether the debates/wrans are from yesterday or another day...
    // And create the appropriate text ($daytext) to display accordingly.
    $todaystime = gmmktime(0, 0, 0, date('m'), date('d'), date('Y'));
    if ($debatesdata['hdate'] == $wransdata['hdate'] && $debatesdata['hdate'] == $whalldata['hdate'] && $debatesdata['hdate'] == $wmsdata['hdate']) {
        // They're on the same day, which is nice, and most common.
        if ($todaystime - $debatesdata['timestamp'] == 86400) {
            $daytext = "yesterday's";
        } elseif ($todaystime - $debatesdata['timestamp'] <= 6 * 86400) {
            // Less than a week ago, so like "last Tuesday's".