[InstagramBridge] Add link on image and video indication in title (#966)
In item content, the image is now a clickable link to the post; In item title a ▶ is prepended if the post contains a video; it's impossible to tell from the content image.
This commit is contained in:
parent
dc83962483
commit
6c1d861529
1 changed files with 4 additions and 3 deletions
|
@ -88,7 +88,7 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
$textContent = basename($media->display_url);
|
$textContent = basename($media->display_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['title'] = trim($textContent);
|
$item['title'] = ($media->is_video ? '▶ ' : '') . trim($textContent);
|
||||||
$titleLinePos = strpos(wordwrap($item['title'], 120), "\n");
|
$titleLinePos = strpos(wordwrap($item['title'], 120), "\n");
|
||||||
if ($titleLinePos != false) {
|
if ($titleLinePos != false) {
|
||||||
$item['title'] = substr($item['title'], 0, $titleLinePos) . '...';
|
$item['title'] = substr($item['title'], 0, $titleLinePos) . '...';
|
||||||
|
@ -99,8 +99,9 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
$item['content'] = $data[0];
|
$item['content'] = $data[0];
|
||||||
$item['enclosures'] = $data[1];
|
$item['enclosures'] = $data[1];
|
||||||
} else {
|
} else {
|
||||||
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" alt="' . $item['title'] . '" />';
|
$item['content'] = '<a href="' . htmlentities($item['uri']) . '" target="_blank">';
|
||||||
$item['content'] .= '<br><br>' . nl2br(htmlentities($textContent));
|
$item['content'] .= '<img src="' . htmlentities($media->display_url) . '" alt="' . $item['title'] . '" />';
|
||||||
|
$item['content'] .= '</a><br><br>' . nl2br(htmlentities($textContent));
|
||||||
$item['enclosures'] = array($media->display_url);
|
$item['enclosures'] = array($media->display_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue