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; }
</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(); ?> <h4>Recent Westminster Hall debates</h4> <?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' => '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(); ?> <h4>Recent House of Lords debates</h4> <?php $LORDSDEBATELIST = new LORDSDEBATELIST(); $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10)); $rssurl = $DATA->page_metadata($this_page, 'rss');
<?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 == 'whallday') { $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 = 'Westminster Hall debates this month'; } else { $args = array('months' => 1); $title = 'Recent Westminster Hall debates'; } } else { $args = array('months' => 1); $title = 'Recent Westminster Hall debates'; } $PAGE->block_start(array('title' => $title)); $LIST = new WHALLLIST(); $LIST->display('calendar', $args); $PAGE->block_end();
<dt><a href="<?php echo $last_dates[2]['listurl']; ?> ">Westminster Hall</a> <small><?php echo format_date($last_dates[2]['hdate'], LONGERDATEFORMAT); ?> </small> </dt> <dd>Westminster Hall is a secondary MP debating chamber, in a horseshoe arrangement aimed at fostering a more constructive debate. <h3>Random recent Westminster Hall debate</h3> <?php $WHALLLIST->display('recent_debates', array('days' => 7, 'num' => 1)); $MOREURL = new URL('whallfront'); ?> <p align="right"><strong><a href="<?php echo $MOREURL->generate(); ?> ">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>
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>'))); }