Update soshot config
This commit is contained in:
parent
2c1f0981d9
commit
be6a3e28ca
4 changed files with 42 additions and 20 deletions
|
@ -62,22 +62,18 @@ function hook_myShaarli_render_linklist($data, $conf) {
|
|||
}
|
||||
|
||||
foreach ($data['links'] as &$value) {
|
||||
//$thumb = computeThumbnail($conf, $value['url']);
|
||||
if (empty($thumb)) {
|
||||
if (!empty($key)) {
|
||||
$hmac = '&hm=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
} else {
|
||||
$hmac = null;
|
||||
}
|
||||
|
||||
$value['thumbnail'] = $thumUrl . $hmac . urlencode($value['url']);
|
||||
if (!empty($key)) {
|
||||
$hmac = 'type=thumb&hmac=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
} else {
|
||||
$value['thumbnail'] = $thumb['src'];
|
||||
$hmac = null;
|
||||
}
|
||||
|
||||
$value['thumbnail'] = $thumUrl . $hmac . urlencode($value['url']);
|
||||
|
||||
|
||||
if (empty($value['favicon'])) {
|
||||
if (!empty($key)) {
|
||||
$hmac = '&t=fav&hm=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
$hmac = 'type=fav&hmac=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
} else {
|
||||
$hmac = null;
|
||||
}
|
||||
|
@ -90,6 +86,28 @@ function hook_myShaarli_render_linklist($data, $conf) {
|
|||
return $data;
|
||||
}
|
||||
|
||||
function hook_myShaarli_render_picwall($data, $conf) {
|
||||
|
||||
$thumUrl = $conf->get('plugins.ExternalThumbshot_URL');
|
||||
if (!empty($conf->get('plugins.ExternalThumbshot_KEY'))) {
|
||||
$key = $conf->get('plugins.ExternalThumbshot_KEY');
|
||||
}
|
||||
if (!isset($thumUrl)) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
foreach ($data['linksToDisplay'] as &$value) {
|
||||
if (!empty($key)) {
|
||||
$hmac = 'type=thumb&hmac=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
} else {
|
||||
$hmac = null;
|
||||
}
|
||||
|
||||
$value['thumbnail'] = $thumUrl . $hmac . urlencode($value['url']);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add externalThumbshot icon to link_plugin when rendering linklist.
|
||||
*
|
||||
|
@ -111,7 +129,7 @@ function hook_myShaarli_render_daily($data, $conf) {
|
|||
//$thumb = computeThumbnail($conf, $value['url']);
|
||||
if (empty($thumb)) {
|
||||
if (!empty($key)) {
|
||||
$hmac = '&hm=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
$hmac = 'type=thumb&hmac=' . hash_hmac('sha1', $value['url'], $key) . '&url=';
|
||||
} else {
|
||||
$hmac = null;
|
||||
}
|
||||
|
@ -152,7 +170,6 @@ function hook_myShaarli_render_editlink($data) {
|
|||
}
|
||||
|
||||
/**
|
||||
|
||||
Améliore la sortie print
|
||||
@author Tatane http://www.tatane.info/index.php/print_rn
|
||||
@author http://www.blog.cactuscrew.com/77-print_rn.html
|
||||
|
|
|
@ -1235,6 +1235,9 @@ form[name="linkform"].page-form {
|
|||
display: inline-flex;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
width: auto;
|
||||
height: auto;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.b-lazy {
|
||||
|
|
|
@ -140,8 +140,7 @@
|
|||
<div
|
||||
class="linklist-item-thumbnail {if="$value.thumbnail === null"}hidden{/if}"
|
||||
style="width:{$thumbnails_width}px;height:{$thumbnails_height}px;"
|
||||
{if="$value.thumbnail === null"}data-async-thumbnail="1"{/if}
|
||||
>
|
||||
{if="$value.thumbnail === null"}data-async-thumbnail="1"{/if}>
|
||||
<div class="thumbnail">
|
||||
{ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
|
||||
<a href="{$value.real_url}" aria-hidden="true" tabindex="-1">
|
||||
|
@ -174,8 +173,12 @@
|
|||
{else}
|
||||
<i class="fa fa-sticky-note" aria-hidden="true"></i>
|
||||
{/if}
|
||||
|
||||
<span class="linklist-link">{$value.title_html}</span>
|
||||
<img alt="favicon"
|
||||
src="{$value.favicon}"
|
||||
loading="lazy"
|
||||
height="16" width="16" loading>
|
||||
<span class="linklist-link">
|
||||
{$value.title_html}</span>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
<div id="picwall-container" class="picwall-container" role="list">
|
||||
{loop="$linksToDisplay"}
|
||||
<div class="picwall-pictureframe" role="listitem">
|
||||
<div class="picwall-pictureframe" role="listitem" style="width:{$thumbnails_width}px; height:{$thumbnails_height}px ;">
|
||||
{ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
|
||||
<img data-src="{$root_path}/{$value.thumbnail}#" class="b-lazy"
|
||||
<img data-src="{$value.thumbnail}#" class="b-lazy"
|
||||
src=""
|
||||
alt="" width="{$thumbnails_width}" height="{$thumbnails_height}" />
|
||||
<a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
|
||||
|
@ -56,4 +56,3 @@
|
|||
<script src="{$asset_path}/js/thumbnails.min.js?v={$version_hash}#"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in a new issue