示例#1
0
# 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
        global $domain_name;
        divisionvote_post_forum_action($db, $divattr['division_date'], $divattr['division_number'], $divattr['house'], "Division introduced to forum.\n\n[b]Title:[/b] [url=http://{$domain_name}/division.php?date=" . $divattr['division_date'] . "&number=" . $divattr['division_number'] . "&house=" . $divattr['house'] . "]" . $name . "[/url]\n[b]Description:[/b] " . trim($description));
        $discuss_url = divisionvote_post_forum_link($db, $divattr['division_date'], $divattr['division_number'], $divattr['house']);
    } else {
示例#2
0
        // print "<b><a href=\"$edit_link\" title=\"Edit and improve this description\">Edit</a></b>";
        //print " (<a href=\"faq.php#motionedit\">learn more</a>)";
        // if ($discuss_url)
        //     print ' | <b><a href="'.htmlspecialchars($discuss_url).'" title="Forum page for this vote, including record of changes">Discussion</a></b>';
        #if ($history_link)  # commented out, as confusing and deprecated
        #    print '<a href="'.htmlspecialchars($history_link).'">History</a>';
        //if ($motion_data['user_id'] != 0)
        //    print " (last edited ".  relative_time($motion_data["edit_date"]) .  " by " . pretty_user_name($db2, $last_editor).") ";
        print "</div>\n";
    } else {
        print "<p>(<a href=\"{$thispageswap}\">Swap the two divisions around</a>).</p>";
        $motion_data_a = get_wiki_current_value("motion", array($divattr["division_date"], $divattr["division_number"], $divattr['house']));
        $titlea = "<a href=\"" . $divattr["divhref"] . "\">" . extract_title_from_wiki_text($motion_data_a["text_body"]) . " - " . $divattr["prettydate"] . " at {$clock_time} - Division No. " . $divattr["division_number"] . "</a>";
        print "<h2><a name=\"motion\">Vote (a) " . ($motion_data_a['user_id'] == 0 ? " (unedited)" : "") . "</a>: {$titlea}</h2>";
        print "<div class=\"motion\">" . extract_motion_text_from_wiki_text($motion_data_a['text_body']) . "</div>\n";
        $motion_data_b = get_wiki_current_value("motion", array($divattr2["division_date"], $divattr2["division_number"], $divattr2['house']));
        $titleb = "<a href=\"" . $divattr2["divhref"] . "\">" . extract_title_from_wiki_text($motion_data_b["text_body"]) . " - " . $divattr2["prettydate"] . " at {$clock_time2} - Division No. " . $divattr2["division_number"] . "</a>";
        print "<h2>Vote (b) " . ($motion_data_b['user_id'] == 0 ? " (unedited)" : "") . ": {$titleb}</h2>";
        print "<div class=\"motion\">" . extract_motion_text_from_wiki_text($motion_data_b['text_body']) . "</div>\n";
    }
}
if (true === function_exists('advertisement')) {
    advertisement('division');
}
# Work out proportions for party voting (todo: cache)
if ($dismode["partysummary"]) {
    print_party_summary_division($div_id, "", $divattr['house']);
}
# Division votes table
if ($dismode["showwhich"]) {
    if ($singlemotionpage) {
示例#3
0
                $description_diff = html_entity_decode(html_entity_decode($description_diff, ENT_QUOTES), ENT_QUOTES);
                $name_diff = html_entity_decode(html_entity_decode($name_diff, ENT_QUOTES), ENT_QUOTES);
                global $domain_name;
                divisionvote_post_forum_action($db, $params[0], $params[1], $params[2], "Changed title and/or description of division.\n\n[b]Title:[/b] " . "[url=http://{$domain_name}/division.php?date=" . $division_details['division_date'] . "&number=" . $division_details['division_number'] . "&house=" . $division_details['house'] . "]" . $name_diff . "[/url]\n[b]Description:[/b] " . $description_diff);
            }
            $db->query_errcheck("insert into pw_dyn_wiki_motion\n                (division_date, division_number, house, text_body, user_id, edit_date) values\n                ('{$params['0']}', '{$params['1']}', '{$params['2']}', '" . mysql_real_escape_string($newtext) . "', '" . user_getid() . "', now())");
            audit_log("Edited {$type} wiki text {$params['0']} {$params['1']} {$params['2']}");
            if ($type == 'motion') {
                notify_motion_updated($db, $params[0], $params[1], $params[2]);
            }
        }
        header("Location: " . $rr);
        exit;
    } else {
        pw_header();
        $values = get_wiki_current_value($db, $type, $params);
        if ($type == 'motion') {
            ?>
        <p>Describe the <i>result</i> of this division.  This will require you
        to check through the debate leading up to the vote.
        The raw, and frequently
        wrong, motion text is there by default.  Feel free to remove it when
        you've replaced it with something better. </p>

        <p>Please, keep it accurate, authorative, and as jargon-free as
        possible so that new readers who don't know Parliamentary procedure can
        gain enlightenment. You are urged to include hyperlinks to the
        legislation, command papers, reports, and committee
        proceedings that are referred to so that readers who want to follow the
        story further will know where to look.</p>