Browse Source

Fix #168

pull/324/head
Timothée Jaussoin 10 years ago
parent
commit
b092c32bde
  1. 18
      app/models/postn/Postn.php
  2. 2
      app/widgets/Post/_post.tpl

18
app/models/postn/Postn.php

@ -327,14 +327,28 @@ class Postn extends Model {
if($l['rel'] == 'alternate') {
$this->openlink = $l['href'];
if(!$this->isMicroblog()) {
array_push($attachements['links'], array('href' => $l['href'], 'url' => parse_url($l['href'])));
array_push(
$attachements['links'],
array(
'href' => $l['href'],
'url' => parse_url($l['href']),
'rel' => 'alternate'
)
);
}
}
} elseif(isset($l['rel'])){
if ($l['rel'] == 'enclosure')
array_push($attachements['files'], $l);
elseif ($l['rel'] == 'related')
array_push($attachements['links'], array('href' => $l['href'], 'url' => parse_url($l['href'])));
array_push(
$attachements['links'],
array(
'href' => $l['href'],
'url' => parse_url($l['href']),
'rel' => 'related'
)
);
}
}
}

2
app/widgets/Post/_post.tpl

@ -168,6 +168,7 @@
<ul class="list middle divided spaced">
{if="isset($attachements.links)"}
{loop="$attachements.links"}
{if="$value.rel != 'alternate'"}
<li>
<span class="primary icon">
<img src="https://icons.duckduckgo.com/ip2/{$value.url.host}.ico"/>
@ -178,6 +179,7 @@
</a>
</p>
</li>
{/if}
{/loop}
{/if}
{if="isset($attachements.files)"}

Loading…
Cancel
Save