protected function getEditorialContent() { $debatelist = new \SPLIST(); $item = $debatelist->display('recent_debates', array('days' => 7, 'num' => 1), 'none'); $item = $item['data'][0]; $more_url = new \URL('spdebatesfront'); $item['more_url'] = $more_url->generate(); $item['desc'] = 'Scottish Parliament debate'; $item['related'] = array(); $item['featured'] = false; return $item; }
<?php include_once "../../includes/easyparliament/init.php"; $number_of_debates_to_show = 6; $number_of_wrans_to_show = 5; $this_page = 'spoverview'; $PAGE->page_start(); // Page title will appear here. $PAGE->stripe_start(); ?> <h3>Busiest Scottish Parliament debates from the most recent week</h3> <?php $DEBATELIST = new SPLIST(); $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => $number_of_debates_to_show)); $MOREURL = new URL('spdebatesfront'); $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' => "spdebates"), array('type' => 'include', 'content' => "calendar_spdebates"))); $PAGE->stripe_start(); ?> <h3>Some recent written answers</h3> <?php $WRANSLIST = new SPWRANSLIST();
<?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 == 'spdebatesday') { $date = get_http_var('d'); list($year, $month, $day) = explode('-', $date); $args = array('year' => $year, 'month' => $month, 'onday' => $date); $title = 'Debates this month'; } else { $args = array('months' => 1); $title = 'Recent debates'; } $PAGE->block_start(array('title' => $title)); $LIST = new SPLIST(); $LIST->display('calendar', $args); $PAGE->block_end();
if ($LIST->htype() == '12' || $LIST->htype() == '13') { $PAGE->stripe_start('side', 'comments'); $COMMENTLIST = new COMMENTLIST(); $args['user_id'] = get_http_var('u'); $args['epobject_id'] = $LIST->epobject_id(); $COMMENTLIST->display('ep', $args); $PAGE->stripe_end(); $PAGE->stripe_start('side', 'addcomment'); $commendata = array('epobject_id' => $LIST->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(); } } } else { $this_page = "spdebatesfront"; $PAGE->page_start(); $PAGE->stripe_start(); ?> <h2>Busiest debates from the most recent week</h2> <?php $LIST = new SPLIST(); $LIST->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' => "spdebates"), array('type' => 'include', 'content' => 'calendar_spdebates'), array('type' => 'html', 'content' => '<div class="block"><h4><a href="/' . $rssurl . '">RSS feed of most recent debates</a></h4></div>'))); } $PAGE->page_end(); twfy_debug_timestamp("page end");
?> <p align="right"><strong><a href="<?php echo $MOREURL->generate(); ?> ">See more written answers</a></strong></p> </div> <div class="welcome_col2"> <?php $PAGE->include_sidebar_template('spdebates'); ?> <h2>Recent Scottish Parliament debates</h2> <?php $DEBATELIST = new SPLIST(); $DEBATELIST->display('recent_debates', array('days' => 7, 'num' => 10)); $MOREURL = new URL('spdebatesfront'); ?> <p align="right"><strong><a href="<?php echo $MOREURL->generate(); ?> ">See more debates</a></strong></p> </div> <?php $PAGE->stripe_end(); $PAGE->page_end();