Skip to content

Commit

Permalink
make author portrait not apear as article banner for nordbayern
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Nov 6, 2021
1 parent 0c2a2ed commit 2d0733c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bridges/NordbayernBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,16 @@ private function handleArticle($link) {
$pictures = $article->find('picture');
$images = self::getValidImages($pictures);
if(!empty($images)) {
$bannerUrl = $images[0];
// If there is an author info block
// the first immage will be the portrait of the author
// and not the article banner. The banner in this
// case will be the second image.
if ($article->find('div[class=authorinfo]', 0) == null) {
$bannerUrl = $images[0];
} else {
$bannerUrl = $images[1];
}

$item['content'] .= '<img src="' . $bannerUrl . '">';
}

Expand All @@ -107,7 +116,7 @@ private function handleArticle($link) {
$item['content'] .= self::getUseFullContent($content);
}

for($i = 1; $i < count($images); $i++) {
for($i = 0; $i < count($images); $i++) {
$item['content'] .= '<img src="' . $images[$i] . '">';
}

Expand Down

0 comments on commit 2d0733c

Please sign in to comment.