Use web-thumbnailer to retrieve thumbnails

* requires PHP 5.6
  * use blazy on linklist since a lot more thumbs are retrieved
  * thumbnails can be disabled
  * thumbs size is now 120x120
  * thumbs are now cropped to fit the expected size

Fixes      
This commit is contained in:
ArthurHoaro 2016-11-09 18:57:02 +01:00
parent edb4a4d9c9
commit 1b93137e16
12 changed files with 222 additions and 427 deletions

View file

@ -128,6 +128,18 @@
<input type="text" name="apiSecret" id="apiSecret" size="50" value="{$api_secret}" />
</td>
</tr>
<tr>
<td valign="top"><b>Enable thumbnails</b></td>
<td>
<input type="checkbox" name="enableThumbnails" id="enableThumbnails"
{if="$thumbnails_enabled"}checked{/if}/>
<label for="enableThumbnails">
&nbsp;<strong>Warning:</strong>
If you have a large database, the first retrieval may take a few minutes.
It's recommended to visit the picture wall after enabling this feature
</label>
</td>
</tr>
<tr>
<td></td>

View file

@ -80,7 +80,16 @@
{loop="$links"}
<li{if="$value.class"} class="{$value.class}"{/if}>
<a id="{$value.shorturl}"></a>
<div class="thumbnail">{$value.url|thumbnail}</div>
{if="$thumbnails_enabled && !empty($value.thumbnail)"}
<div class="thumbnail">
<a href="{$value.real_url}">
{ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
<img data-src="{$value.thumbnail}#" class="b-lazy"
src="#"
alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
</a>
</div>
{/if}
<div class="linkcontainer">
{if="$is_logged_in"}
<div class="linkeditbuttons">

View file

@ -15,7 +15,11 @@
<div id="picwall_container">
{loop="$linksToDisplay"}
<div class="picwall_pictureframe">
{$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
{ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
<img data-src="{$value.thumbnail}#" class="b-lazy"
src="#"
alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
<a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
{loop="$value.picwall_plugin"}
{$value}
{/loop}