diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-01-18 14:06:24 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-01-18 14:06:24 +0000 |
commit | f9b2ff83e731364f9780d42bf59bb1e4c71018f0 (patch) | |
tree | 31509711f28b74945435e6d0a57a1b8c44ddb7b8 /perllib/FixMyStreet/App/Controller/Rss.pm | |
parent | aa1ada8de28f8af2c4ef1ea5a8f4e633d3995741 (diff) | |
parent | 4394236a96f797d31033f6760607548266b0d354 (diff) |
Merge branch 'issues/commercial/988-c6-email-address-link'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 7cf4783c0..e1da4445d 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -282,14 +282,15 @@ sub add_row : Private { $item{pubDate} = $pubDate if $pubDate; $item{category} = encode_entities($row->{category}) if $row->{category}; - if ($c->cobrand->allow_photo_display($row) && $row->{photo}) { + if ((my $photo_to_show = $c->cobrand->allow_photo_display($row)) && $row->{photo}) { # Bit yucky as we don't have full objects here my $photoset = FixMyStreet::App::Model::PhotoSet->new({ db_data => $row->{photo} }); - my $first_fn = $photoset->get_id(0); + my $idx = $photo_to_show - 1; + my $first_fn = $photoset->get_id($idx); my ($hash, $format) = split /\./, $first_fn; my $cachebust = substr($hash, 0, 8); my $key = $alert_type->item_table eq 'comment' ? 'c/' : ''; - $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.0.$format?$cachebust\">"); + $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.$idx.$format?$cachebust\">"); } if ( $row->{used_map} ) { |