Fix picwall

This commit is contained in:
Knah Tsaeb 2018-03-12 16:57:33 +01:00
parent c111704f8c
commit cdc426d560

View file

@ -800,9 +800,24 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager)
{
$link['thumbnail']=$thumb; // Thumbnail HTML code.
}
$thumUrl = $conf->get('plugins.ExternalThumbshot_URL');
if(!empty($conf->get('plugins.ExternalThumbshot_KEY'))){
$key = $conf->get('plugins.ExternalThumbshot_KEY');
}
if(empty($link['thumbnail'])){
$link['thumbnail'] = '<img class="b-lazy" src="#" data-src="'.$thumUrl.urlencode($link['url']).'" alt="Thumbnail" width="120" height="90">';
$thumb = computeThumbnail($conf, $link['url']);
if(empty($thumb)){
if(!empty($key)){
$hmac = '&amp;hm='.hash_hmac('sha1', $link['url'], $key).'&amp;url=';
} else {
$hmac = null;
}
$link['thumbnail'] = '<img class="b-lazy" src="#" data-src="'.$thumUrl.$hmac.urlencode($link['url']).'" alt="Thumbnail" width="120" height="90">';
} else {
$link['thumbnail'] = '<img class="b-lazy" src="#" data-src="'.$thumb['src'].'" alt="Thumbnail" width="120" height="90">';
}
}
$linksToDisplay[]=$link; // Add to array.
}