Commits

Anonymous committed 2d10d48

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

  • Participants
  • Parent commits 6a9129c

Comments (0)

Files changed (6)

custom/cluster/Makefile

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

loader/PublicWhip/DivsXML.pm

     );
 
     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;

loader/calc_caches.php

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

website/index.php

 <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>
 </form>
 </div>
 <div class="homesponsor">
 <div class="clear"></div>
 </div>
 <?php pw_footer(); ?>
-<?php //cache_end(); ?>
+<?php //cache_end(); ?>

website/parliaments.inc

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

website/search.php

 
 <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">
 </form>
 
 <p class="search"><i>Example: "OX1 3DR", "<?=$random_mp?>"<?=$random_constituency?> or "<?=$random_topic?>"</i>