diff --git a/index.php b/index.php index 55d02c1..b310f99 100644 --- a/index.php +++ b/index.php @@ -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'] = 'Thumbnail'; + $thumb = computeThumbnail($conf, $link['url']); + if(empty($thumb)){ + if(!empty($key)){ + $hmac = '&hm='.hash_hmac('sha1', $link['url'], $key).'&url='; + } else { + $hmac = null; + } + $link['thumbnail'] = 'Thumbnail'; + } else { + $link['thumbnail'] = 'Thumbnail'; + } + } $linksToDisplay[]=$link; // Add to array. }