diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/default/bookmarks.tpl.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php index 19ab6a8..4f22e91 100644 --- a/data/templates/default/bookmarks.tpl.php +++ b/data/templates/default/bookmarks.tpl.php @@ -345,6 +345,7 @@ if ($currenttag!= '') { $assetHash = substr($assetHash, 0, 2) . '/' . substr($assetHash, 2, 2) . '/' . $assetHash; $assetLink = $GLOBALS['cacheUrl'] . '/' . $assetHash; $assetPdf = $assetLink .'/screenshot.pdf'; + $assetPng = $assetLink .'/screenshot.png'; // Check if the link exists if ($fp = curl_init($assetLink)) { @@ -369,6 +370,20 @@ if ($currenttag!= '') { curl_close($fp); } + + // Check if PNG is available + if ($fp = curl_init($assetPng)) { + curl_setopt($fp, CURLOPT_NOBODY, true); + curl_exec($fp); + + $retcode = curl_getinfo($fp, CURLINFO_HTTP_CODE); + + if ($retcode != 404) { + $cacheLink .= " | <a href=\"$assetPng\">PNG</a>"; + } + + curl_close($fp); + } } curl_close($fp); |