Anonymous committed 2d10d48

Sort divisions before ordering (DivsXML)
Fix search box (index.php and search.php)
Fix logo link to homepage (index.php)
Fix when no parlimentary session details passed

Comments (0)

Files changed (6)


 # to octave itself.  It also writes the raw distance metric
 # to the database for use.
+	perl
 .PHONY: mpcoords
 # Make Java applet


     opendir DIR, $debatepath or die "Cannot open $debatepath: $!\n";
-    while ( my $file = readdir(DIR) ) {
+    my @files;
+    while (my $file = readdir(DIR)) {
+	push(@files,$file);
+    }
+    @files=sort { $a cmp $b} @files;
+    foreach my $file (@files) {
         if ( $file =~ m/^$fileprefix(\d\d\d\d-\d\d-\d\d)([a-z]*).xml$/ ) {
             $curdate = $1;
             $cursuffix = $2;


 					   division_date, division_number, as house";
 	$qfrom =  " FROM pw_division";
-	$qjoin .= " LEFT JOIN pw_mp ON
+	$qjoin = " LEFT JOIN pw_mp ON
      = AND
             		pw_mp.entered_house <= pw_division.division_date AND
             		pw_division.division_date < pw_mp.left_house";


 <div class="homesearch">
 <h2>Search the Whip</h2>
 <p>Enter your <strong>postcode</strong>, an <strong>MP</strong> or <strong>Lord’s name</strong>, or a particular <strong>topic</strong> of interest</p>
-<form class="searchtitlebarform" action="/search.php" name="pw">
-<input maxLength=256 size=12 id="query" onblur="fadeout(this)" onfocus="fadein(this)"> <button type="submit" value="Submit">Submit</button>
+<form class="searchtitlebarform" action="/search.php" name="pw" method="get">
+<input maxLength=256 size=12 name="query" id="query" onblur="fadeout(this)" onfocus="fadein(this)"> <button type="submit" value="Submit" name="button">Submit</button>
 <div class="homesponsor">
 <div class="clear"></div>
 <?php pw_footer(); ?>
-<?php //cache_end(); ?>
+<?php //cache_end(); ?>


 $parlsessions = array(
 	'2002' => array('from' => '2002-11-13', 'to' => '2003-11-20', 'name' => '2002/2003'),
-$parlsession = db_scrub($_GET["session"]);
+if (isset($_GET['session'])) {
+	$session=$_GET['session'];
+$parlsession = db_scrub($session);
 function parliament_count()


 <p class="search">Enter your postcode, MP name, constituency or debate topic:</p>
 <form class="search" action="search.php" name=pw>
-<input maxLength=256 size=25 name=query id=query value=""> <input type="submit" value="Search" name="button">
+<input maxLength=256 size=25 name="query" id="query" value=""> <input type="submit" value="Search" name="button">
 <p class="search"><i>Example: "OX1 3DR", "<?=$random_mp?>"<?=$random_constituency?> or "<?=$random_topic?>"</i>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.