# $Id: division-forum.php,v 1.4 2008/01/09 17:16:02 publicwhip Exp $ # vim:sw=4:ts=4:et:nowrap # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd # This is free software, and you are welcome to redistribute it under # certain conditions. However, it comes with ABSOLUTELY NO WARRANTY. # For details see the file LICENSE.html in the top level of the source. require_once "db.inc"; require_once "decodeids.inc"; require_once "account/user.inc"; require_once "database.inc"; require_once "divisionvote.inc"; require_once "forummagic.inc"; require_once "pretty.inc"; $db = new DB(); # decode the attributes $divattr = get_division_attr_decode($db, ""); if ($divattr == "none") { trigger_error('Division not found', E_USER_ERROR); } $motion_data = get_wiki_current_value($db, "motion", array($divattr["division_date"], $divattr["division_number"], $divattr['house'])); $name = extract_title_from_wiki_text($motion_data['text_body']); $description = extract_motion_text_from_wiki_text($motion_data['text_body']); $just_logged_in = do_login_screen(); if ($just_logged_in) { header("Location: " . $_SERVER['REQUEST_URI'] . "\n"); } # Find discuss URL $discuss_url = divisionvote_post_forum_link($db, $divattr['division_date'], $divattr['division_number'], $divattr['house']); if (!$discuss_url) { if (user_isloggedin()) { // First time someone logged in comes along, add division to the forum
require_once "parliaments.inc"; function no_division_found($plural) { $title = "Division{$plural} not found"; pw_header(); print "<p>Public Whip does not have this/these divisions. Perhaps it\n \t\t doesn't exist, or it hasn't been added to The Public Whip yet.\n\t\t New divisions are added one or two working days after they happen.</p>\n\t\t <p><a href=\"divisions.php\">Browse for a division</a> </p>"; pw_footer(); exit; } # decode the attributes $divattr = get_division_attr_decode(""); if ($divattr == "none") { no_division_found(""); } # second division (which we can compare against) $divattr2 = get_division_attr_decode("2"); $singlemotionpage = $divattr2 == "none"; $div_id = $divattr["division_id"]; # current motion text from the database $motion_data = get_wiki_current_value("motion", array($divattr["division_date"], $divattr["division_number"], $divattr['house'])); $name = extract_title_from_wiki_text($motion_data['text_body']); $source = $divattr["source_url"]; $rebellions = $divattr["rebellions"]; $turnout = $divattr["turnout"]; $original_motion = $divattr["original_motion"]; $debate_url = $divattr["debate_url"]; $source_gid = $divattr["source_gid"]; $debate_gid = $divattr["debate_gid"]; $div_no = html_scrub($divattr["division_number"]); $this_anchor = $divattr["divhref"]; $house = $divattr["house"];
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <?php require_once "common.inc"; # $Id: twfydivinsert.php,v 1.3 2005/12/22 18:22:28 publicwhip Exp $ # vim:sw=4:ts=4:et:nowrap # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd # This is free software, and you are welcome to redistribute it under # certain conditions. However, it comes with ABSOLUTELY NO WARRANTY. # For details see the file LICENSE.html in the top level of the source. require_once "db.inc"; $db = new DB(); require_once "decodeids.inc"; require_once "tablepeop.inc"; require_once "tablemake.inc"; require_once "tableoth.inc"; require_once "pretty.inc"; # decode the attributes $divattr = get_division_attr_decode(""); $div_id = $divattr["division_id"]; print_party_summary_division($div_id, "www.publicwhip.org.uk/", $divattr["house"]); ?> </html>