aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rwxr-xr-xperllib/CronFns.pm51
-rw-r--r--perllib/Page.pm7
2 files changed, 55 insertions, 3 deletions
diff --git a/perllib/CronFns.pm b/perllib/CronFns.pm
new file mode 100755
index 000000000..f494ed022
--- /dev/null
+++ b/perllib/CronFns.pm
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+
+# CronFns.pm:
+# Shared functions for cron-run scripts
+#
+# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
+#
+# $Id: CronFns.pm,v 1.1 2009-07-10 15:17:29 matthew Exp $
+
+package CronFns;
+
+use strict;
+require 5.8.0;
+
+# Horrible boilerplate to set up appropriate library paths.
+use FindBin;
+use lib "$FindBin::Bin/../perllib";
+use lib "$FindBin::Bin/../../perllib";
+
+use mySociety::Locale;
+
+sub options {
+ die "Either no arguments, --nomail or --verbose" if (@ARGV>1);
+ my $nomail = 0;
+ my $verbose = 0;
+ $nomail = 1 if (@ARGV==1 && $ARGV[0] eq '--nomail');
+ $verbose = 1 if (@ARGV==1 && $ARGV[0] eq '--verbose');
+ $verbose = 1 if $nomail;
+ return ($verbose, $nomail);
+}
+
+sub site {
+ my $base_url = shift;
+ my $site = 'fixmystreet';
+ $site = 'emptyhomes' if $base_url =~ 'emptyhomes';
+ return $site;
+}
+
+sub language {
+ my $site = shift;
+ if ($site eq 'emptyhomes') {
+ mySociety::Locale::negotiate_language('en-gb,English,en_GB|cy,Cymraeg,cy_GB');
+ mySociety::Locale::gettext_domain('FixMyStreet-EmptyHomes', 1);
+ } else {
+ mySociety::Locale::negotiate_language('en-gb,English,en_GB|nb,Norwegian,nb_NO'); # XXX Testing
+ mySociety::Locale::gettext_domain('FixMyStreet', 1);
+ }
+}
+
+1;
diff --git a/perllib/Page.pm b/perllib/Page.pm
index b31d7762a..e2fc687ce 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.146 2009-07-10 12:37:52 matthew Exp $
+# $Id: Page.pm,v 1.147 2009-07-10 15:17:29 matthew Exp $
#
package Page;
@@ -18,7 +18,7 @@ use Error qw(:try);
use File::Slurp;
use HTTP::Date;
use Image::Magick;
-use Image::Size;
+#use Image::Size;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use POSIX qw(strftime);
@@ -660,7 +660,8 @@ sub display_problem_text {
}
if ($problem->{photo}) {
- my $dims = Image::Size::html_imgsize(\$problem->{photo});
+ #my $dims = Image::Size::html_imgsize(\$problem->{photo});
+ my $dims = '';
$out .= "<p align='center'><img alt='' $dims src='/photo?id=$problem->{id}'></p>";
}