aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/CrossSell.pm5
-rw-r--r--perllib/Page.pm19
-rw-r--r--perllib/Problems.pm10
-rwxr-xr-xtemplates/website/faq.html10
-rwxr-xr-xweb-admin/index.cgi17
5 files changed, 40 insertions, 21 deletions
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm
index a533ecfc7..e40f2166f 100644
--- a/perllib/CrossSell.pm
+++ b/perllib/CrossSell.pm
@@ -218,9 +218,8 @@ sub display_advert ($$;$%) {
# }
#}
- # ALWAYS return democracy club advert for the mo
- $q->{scratch} = 'advert=demclub0';
- return display_democracyclub();
+ #$q->{scratch} = 'advert=demclub0';
+ #return display_democracyclub();
#unless (defined $data{done_tms} && $data{done_tms}==1) {
$q->{scratch} = 'advert=news';
diff --git a/perllib/Page.pm b/perllib/Page.pm
index fcf11f7f7..cafd9ba91 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -339,17 +339,14 @@ sub footer {
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-<!--
-piwik_action_name = '';
-piwik_idsite = 8;
-piwik_url = pkBaseURL + "piwik.php";
-piwik_log(piwik_action_name, piwik_idsite, piwik_url);
-//-->
-</script>
-<noscript><img width=1 height=1 src="http://piwik.mysociety.org/piwik.php?idsite=8" style="border:0" alt=""></noscript>
-<!-- /Piwik -->
+</script><script type="text/javascript">
+try {
+var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 8);
+piwikTracker.trackPageView();
+piwikTracker.enableLinkTracking();
+} catch( err ) {}
+</script><noscript><p><img src="http://piwik.mysociety.org/piwik.php?idsite=8" style="border:0" alt=""/></p></noscript>
+<!-- End Piwik Tag -->
EOF
}
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 69293e162..aad6c0716 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -209,7 +209,7 @@ sub fixed_nearby {
sub fetch_problem {
my $id = shift;
- dbh()->selectrow_hashref(
+ my $p = dbh()->selectrow_hashref(
"select id, easting, northing, council, category, title, detail, photo,
used_map, name, anonymous, extract(epoch from confirmed) as time,
state, extract(epoch from whensent-confirmed) as whensent,
@@ -218,7 +218,10 @@ sub fetch_problem {
from problem where id=? and state in ('confirmed','fixed', 'hidden')
$site_restriction", {}, $id
);
+ $p->{service} =~ s/_/ /g;
+ return $p;
}
+
# API functions
sub problems_matching_criteria {
@@ -301,10 +304,11 @@ sub council_problems {
push @params, $one_council;
$where_extra = "and areas like '%,'||?||',%'";
}
+ my $current_time = dbh()->selectrow_array('select ms_current_timestamp()');
my $problems = select_all(
"select id, title, detail, council, state, areas,
- extract(epoch from ms_current_timestamp()-lastupdate) as duration,
- extract(epoch from ms_current_timestamp()-confirmed) as age
+ extract(epoch from '$current_time'-lastupdate) as duration,
+ extract(epoch from '$current_time'-confirmed) as age
from problem
where state in ('confirmed', 'fixed')
$where_extra
diff --git a/templates/website/faq.html b/templates/website/faq.html
index 62cb72def..c9a59dea6 100755
--- a/templates/website/faq.html
+++ b/templates/website/faq.html
@@ -56,9 +56,11 @@ by a registered charity, though, so if you want to make a contribution, <a
href="https://secure.mysociety.org/donate/">please do</a>.</dd>
<dt>Can I use FixMyStreet on my mobile?</dt>
- <dd>There is an iPhone app for FixMyStreet, written by us and
- <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=297456545&#038;mt=8">available for download on the App Store</a>
- (link opens the App Store in iTunes).
+ <dd>There are two iPhone apps for FixMyStreet, one written by us in 2008 and
+ another much more recently by a volunteer, Martin Stephenson. Both are available for
+ download on the App Store:
+ <a href="http://itunes.apple.com/gb/app/fixmystreet/id297456545">FixMyStreet</a>,
+ <a href="http://itunes.apple.com/gb/app/streetreport/id371891859">StreetReport</a>.
There is an Android app written by a volunteer, Anna Powell-Smith,
available from the Android Market.
</dd>
@@ -163,7 +165,7 @@ Neighbourhood Fix-It was a bit of a mouthful, hard to spell, and hard to publici
<dd>Yes, we can use help in all sorts of ways, technical or
non-technical. Please see our <a
href="http://www.mysociety.org/helpus/">Get Involved page</a>.</dd>
- <dt>I&rsquo;d like a site this for my own location/ where&rsquo;s the "source code" to this site?</dt>
+ <dt>I&rsquo;d like a site like this for my own location/ where&rsquo;s the "source code" to this site?</dt>
<dd>
<p>The software behind this site is open source, and available
to you mainly under the GNU Affero GPL software license. You can <a
diff --git a/web-admin/index.cgi b/web-admin/index.cgi
index 936054fe5..8ac3eb132 100755
--- a/web-admin/index.cgi
+++ b/web-admin/index.cgi
@@ -865,6 +865,23 @@ sub not_found {
sub main {
my $q = shift;
+
+ my $logout = $q->param('logout');
+ my $timeout = $q->param('timeout');
+ if ($logout) {
+ if (!$timeout) {
+ print $q->redirect(-location => '?logout=1;timeout=' . (time() + 7));
+ return;
+ }
+ if (time() < $timeout) {
+ print $q->header(
+ -status => '401 Unauthorized',
+ -www_authenticate => 'Basic realm="www.fixmystreet.com admin pages"'
+ );
+ return;
+ }
+ }
+
my $page = $q->param('page');
$page = "summary" if !$page;