Skip to content

Commit

Permalink
Change over from include/require/include_once to require_once
Browse files Browse the repository at this point in the history
Please use require_once for all future stuff
  • Loading branch information
frabcus committed Nov 1, 2005
1 parent 4236872 commit 0153919
Show file tree
Hide file tree
Showing 32 changed files with 130 additions and 131 deletions.
12 changes: 6 additions & 6 deletions website/account/addpolicy.php
@@ -1,17 +1,17 @@
<?php require_once "../common.inc";

# $Id: addpolicy.php,v 1.10 2005/10/27 01:44:09 frabcus Exp $
# $Id: addpolicy.php,v 1.11 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
include "../db.inc";
include "../cache-tools.inc";
include "../dream.inc";
require_once "../database.inc";
require_once "user.inc";
require_once "../db.inc";
require_once "../cache-tools.inc";
require_once "../dream.inc";

$just_logged_in = do_login_screen();

Expand Down
6 changes: 3 additions & 3 deletions website/account/changeemail.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: changeemail.php,v 1.10 2005/10/06 12:45:07 frabcus Exp $
# $Id: changeemail.php,v 1.11 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

$password1=mysql_escape_string($_POST["password1"]);
$new_email=mysql_escape_string($_POST["new_email"]);
Expand Down
6 changes: 3 additions & 3 deletions website/account/changepass.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: changepass.php,v 1.6 2005/10/06 12:45:07 frabcus Exp $
# $Id: changepass.php,v 1.7 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

if (user_isloggedin())
{
Expand Down
6 changes: 3 additions & 3 deletions website/account/confirm.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: confirm.php,v 1.9 2005/10/27 01:44:09 frabcus Exp $
# $Id: confirm.php,v 1.10 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

$email=mysql_escape_string($_GET["email"]);
$hash=mysql_escape_string($_GET["hash"]);
Expand Down
8 changes: 4 additions & 4 deletions website/account/editpolicy.php
Expand Up @@ -7,10 +7,10 @@
# certain conditions. However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.

include('../database.inc');
include_once('user.inc');
include "../db.inc";
include "../cache-tools.inc";
require_once "../database.inc";
require_once "user.inc";
require_once "../db.inc";
require_once "../cache-tools.inc";
require_once "../dream.inc";
require_once "../DifferenceEngine.inc";

Expand Down
6 changes: 3 additions & 3 deletions website/account/logout.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: logout.php,v 1.7 2005/10/06 12:45:07 frabcus Exp $
# $Id: logout.php,v 1.8 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

if (user_isloggedin()) {
user_logout();
Expand Down
6 changes: 3 additions & 3 deletions website/account/lostpass.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: lostpass.php,v 1.6 2005/10/06 12:45:07 frabcus Exp $
# $Id: lostpass.php,v 1.7 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

$email=mysql_escape_string($_POST["email"]);
$user_name=mysql_escape_string($_POST["user_name"]);
Expand Down
6 changes: 3 additions & 3 deletions website/account/register.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";

# $Id: register.php,v 1.22 2005/10/27 01:44:09 frabcus Exp $
# $Id: register.php,v 1.23 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

$user_name=mysql_escape_string($_POST["user_name"]);
$password1=mysql_escape_string($_POST["password1"]);
Expand Down
8 changes: 4 additions & 4 deletions website/account/settings.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";
# $Id: settings.php,v 1.19 2005/10/27 01:44:09 frabcus Exp $
# $Id: settings.php,v 1.20 2005/11/01 00:56:21 frabcus Exp $

# 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.

include('../database.inc');
include_once('user.inc');
include "../db.inc";
require_once "../database.inc";
require_once "user.inc";
require_once "../db.inc";
$db = new DB();

$just_logged_in = do_login_screen();
Expand Down
6 changes: 3 additions & 3 deletions website/account/wiki.php
@@ -1,14 +1,14 @@
<?php require_once "../common.inc";
# $Id: wiki.php,v 1.23 2005/11/01 00:42:05 frabcus Exp $
# $Id: wiki.php,v 1.24 2005/11/01 00:56:21 frabcus 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('../database.inc');
require_once('user.inc');
require_once "../database.inc";
require_once "user.inc";

require_once "../db.inc";
require_once "../cache-tools.inc";
Expand Down
8 changes: 4 additions & 4 deletions website/boths.php
@@ -1,5 +1,5 @@
<?php require_once "common.inc";
# $Id: boths.php,v 1.10 2005/10/05 14:42:39 frabcus Exp $
# $Id: boths.php,v 1.11 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to redistribute it under
Expand All @@ -8,9 +8,9 @@

$title = "Voted both aye and no";
include "header.inc";
include "db.inc";
include "render.inc";
include "parliaments.inc";
require_once "db.inc";
require_once "render.inc";
require_once "parliaments.inc";
$db = new DB();

$sort = db_scrub($_GET["sort"]);
Expand Down
6 changes: 3 additions & 3 deletions website/cache-begin.inc
@@ -1,5 +1,5 @@
<?php
# $Id: cache-begin.inc,v 1.19 2005/01/18 02:05:59 frabcus Exp $
# $Id: cache-begin.inc,v 1.20 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to redistribute it under
Expand All @@ -11,8 +11,8 @@ if (!isset($cache_params))
$cache_params = md5($_SERVER['QUERY_STRING']);
$cache_file = $cache_dir . $cache_params . ".html";

include_once $toppath . "account/user.inc";
include_once $toppath . "cache-tools.inc";
require_once $toppath . "account/user.inc";
require_once $toppath . "cache-tools.inc";

if (file_exists($cache_file) && $pw_cache_enable)
{
Expand Down
4 changes: 2 additions & 2 deletions website/cache-tools.inc
@@ -1,12 +1,12 @@
<?php
# $Id: cache-tools.inc,v 1.26 2005/10/27 01:44:09 frabcus Exp $
# $Id: cache-tools.inc,v 1.27 2005/11/01 00:56:21 frabcus Exp $

# 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.

include_once $toppath . "account/user.inc";
require_once $toppath . "account/user.inc";

function newsletter_navbar() {
$ret = "";
Expand Down
4 changes: 2 additions & 2 deletions website/common.inc
@@ -1,6 +1,6 @@
<?php

# $Id: common.inc,v 1.8 2005/10/26 21:50:24 frabcus Exp $
# $Id: common.inc,v 1.9 2005/11/01 00:56:21 frabcus Exp $

# Included from all main .php files on the first line

Expand Down Expand Up @@ -70,6 +70,6 @@ function getmicrotime()
return ((float)$usec + (float)$sec);
}

include_once $toppath . "config.php";
require_once $toppath . "config.php";

?>
6 changes: 3 additions & 3 deletions website/decodeids.inc
@@ -1,13 +1,13 @@
<?php
# $Id: decodeids.inc,v 1.28 2005/10/20 10:16:15 theyworkforyou Exp $
# $Id: decodeids.inc,v 1.29 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2005 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.

include $toppath . "parliaments.inc";
include $toppath . "postcode.inc";
require_once $toppath . "parliaments.inc";
require_once $toppath . "postcode.inc";
require_once $toppath . "wiki.inc";
require_once $toppath . "links.inc";

Expand Down
11 changes: 5 additions & 6 deletions website/divisions.php
@@ -1,17 +1,18 @@
<?php require_once "common.inc";
# $Id: divisions.php,v 1.18 2005/10/05 14:42:39 frabcus Exp $
# $Id: divisions.php,v 1.19 2005/11/01 00:56:21 frabcus Exp $

# 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.

include "db.inc";
require_once "db.inc";
$db = new DB();
$bdebug = 0;

include "decodeids.inc";
include "tablemake.inc";
require_once "decodeids.inc";
require_once "tablemake.inc";
require_once "render.inc";

# constants
$rdismodes = array();
Expand Down Expand Up @@ -103,8 +104,6 @@ function makedivlink($rdisplay, $sort)
print "<p>You can change the order of the table by selecting
the headings.</p>";

include "render.inc";

function makeheadcelldivlink($rdisplay, $sort, $hcelltitle, $hcellsort, $hcellalt)
{
$dlink = makedivlink($rdisplay, $hcellsort);
Expand Down
6 changes: 3 additions & 3 deletions website/dream.inc
@@ -1,13 +1,13 @@
<?php
# $Id: dream.inc,v 1.41 2005/10/29 17:14:51 goatchurch Exp $
# $Id: dream.inc,v 1.42 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2005 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.

include_once $toppath . "wiki.inc";
include_once $toppath . "forummagic.inc";
require_once $toppath . "wiki.inc";
require_once $toppath . "forummagic.inc";

# the equation that should be reused on the different places
function calc_dreammp_person_distance($nvotessame, $nvotessamestrong,
Expand Down
8 changes: 4 additions & 4 deletions website/dreamplot.php
@@ -1,7 +1,7 @@
<?php require_once "common.inc";
header("Content-Type: image/png");
$dreamid = intval($_GET["id"]);
# $Id: dreamplot.php,v 1.6 2005/10/05 14:42:39 frabcus Exp $
# $Id: dreamplot.php,v 1.7 2005/11/01 00:56:21 frabcus Exp $

# Draw thumbsketch histogram of how many MPs are each distance away
# from the Dream MP.
Expand All @@ -11,9 +11,9 @@
# certain conditions. However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.

include "db.inc";
include "parliaments.inc";
include "dream.inc";
require_once "db.inc";
require_once "parliaments.inc";
require_once "dream.inc";

$db = new DB();
update_dreammp_person_distance($db, $dreamid); # new method
Expand Down
8 changes: 4 additions & 4 deletions website/edits.php
Expand Up @@ -7,10 +7,10 @@
# certain conditions. However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.

include "db.inc";
include "wiki.inc";
include "pretty.inc";
include "DifferenceEngine.inc";
require_once "db.inc";
require_once "wiki.inc";
require_once "pretty.inc";
require_once "DifferenceEngine.inc";
$db = new DB();

$type = db_scrub($_GET["type"]);
Expand Down
12 changes: 6 additions & 6 deletions website/election.php
@@ -1,6 +1,6 @@
<?php require_once "common.inc";

# $Id: election.php,v 1.22 2005/07/15 16:57:29 frabcus Exp $
# $Id: election.php,v 1.23 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to redistribute it under
Expand All @@ -14,12 +14,12 @@
# Think about dream/person distance, check it works OK
# Do redirect stuff, using interstitial and cookies?
include "db.inc";
include "decodeids.inc";
include "dream.inc";
include "pretty.inc";
require_once "db.inc";
require_once "decodeids.inc";
require_once "dream.inc";
require_once "pretty.inc";
require_once "constituencies.inc";
include "account/user.inc";
require_once "account/user.inc";
$db = new DB();
$db2 = new DB();

Expand Down
6 changes: 3 additions & 3 deletions website/faq.php
@@ -1,5 +1,5 @@
<?php require_once "common.inc";
# $Id: faq.php,v 1.55 2005/10/14 12:02:39 frabcus Exp $
# $Id: faq.php,v 1.56 2005/11/01 00:56:21 frabcus Exp $

# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to redistribute it under
Expand Down Expand Up @@ -86,8 +86,8 @@
know</a> if you find any.

<?php
include "db.inc";
include "parliaments.inc";
require_once "db.inc";
require_once "parliaments.inc";
$db = new DB();

$div_count = $db->query_one_value("select count(*) from pw_division");
Expand Down

0 comments on commit 0153919

Please sign in to comment.