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; }
$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");
<?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();
">See more Westminster Hall debates</a></strong></p> <dt><a href="<?php echo $last_dates[101]['listurl']; ?> ">Lords debates</a> <small><?php echo format_date($last_dates[101]['hdate'], LONGERDATEFORMAT); ?> </small> </dt> <dd>Peers from all parties (and crossbench and bishops) scrutinise government legislation and debate a variety of issues in the House of Lords main chamber. <h3 class="alt">Random recent Lords debates</h3> <?php $LORDSDEBATELIST->display('recent_debates', array('days' => 7, 'num' => 1)); $MOREURL = new URL('lordsdebatesfront'); ?> <p align="right"><strong><a href="<?php echo $MOREURL->generate(); ?> ">See more Lords debates</a></strong></p> </dl> </div> <?php $PAGE->stripe_end(); $PAGE->page_end();
$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();
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>'))); }