aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Page.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Page.pm')
-rw-r--r--perllib/Page.pm31
1 files changed, 6 insertions, 25 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index fbeb1afe4..aea037ae7 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.101 2008-05-15 16:09:51 matthew Exp $
+# $Id: Page.pm,v 1.102 2008-05-20 14:39:01 matthew Exp $
#
package Page;
@@ -21,6 +21,7 @@ use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use POSIX qw(strftime);
use URI::Escape;
+use Problems;
use mySociety::Config;
use mySociety::DBHandle qw/dbh select_all/;
use mySociety::EvEl;
@@ -84,6 +85,10 @@ sub microsite {
} else {
mySociety::Locale::gettext_domain('FixMyStreet');
}
+
+ if ($q->{site} eq 'scambs') {
+ Problems::set_site_restriction('scambs');
+ }
}
=item header Q [PARAM VALUE ...]
@@ -670,30 +675,6 @@ sub short_name {
return $name;
}
-sub recent_photos {
- my ($num, $e, $n, $dist) = @_;
- my $probs;
- if ($e) {
- $probs = select_all("select id, title
- from problem_find_nearby(?, ?, ?) as nearby, problem
- where nearby.problem_id = problem.id
- and state in ('confirmed', 'fixed') and photo is not null
- order by confirmed desc limit $num", $e, $n, $dist);
- } else {
- $probs = select_all("select id, title from problem
- where state in ('confirmed', 'fixed') and photo is not null
- order by confirmed desc limit $num");
- }
- my $out = '';
- foreach (@$probs) {
- my $title = ent($_->{title});
- $out .= '<a href="/?id=' . $_->{id} .
- '"><img border="0" src="/photo?tn=1;id=' . $_->{id} .
- '" alt="' . $title . '" title="' . $title . '"></a>';
- }
- return $out;
-}
-
sub check_photo {
my ($q, $fh) = @_;
my $ct = $q->uploadInfo($fh)->{'Content-Type'};