From 6b3f1d4bb5c909413f31d7df5bab0e8a4084e29e Mon Sep 17 00:00:00 2001
From: Christian Weiske
Date: Wed, 23 Apr 2014 23:12:55 +0200
Subject: Add support for phancap website thumbnailer.
Drop support for artviper, since their service is gone.
---
data/config.default.php | 34 +++++++++-------------
.../default/bookmarks-thumbnail.inc.tpl.php | 18 ++++++------
data/templates/default/bottom.inc.php | 5 ----
3 files changed, 22 insertions(+), 35 deletions(-)
(limited to 'data')
diff --git a/data/config.default.php b/data/config.default.php
index 2f32df7..5e560a7 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -542,35 +542,27 @@ $defaults['privacy'] = 0;
*/
/**
- * Enable bookmark website thumbnails.
+ * Which thumbnail service type to use.
*
- * According to artviper.net license, buy a license if you
- * gain profit with your pages.
+ * Currently supported:
+ * - null (no screenshots)
+ * - 'phancap', see http://cweiske.de/phancap.htm
*
- * @var boolean
- * @link http://www.websitethumbnail.de/
+ * @var string
*/
-$enableWebsiteThumbnails = false;
+$thumbnailsType = null;
/**
- * User ID from websitethumbnail.de
- *
- * You need to register on
- * http://www.artviper.net/registerapi.php
- * in order to use thumbnails on your domain
+ * Configuration for thumbnail service.
*
- * @var string
- * @link http://www.artviper.net/registerapi.php
- */
-$thumbnailsUserId = null;
-
-/**
- * API key.
- * Sent to you by artviper.net after registration.
+ * Phancap requires an array with the following keys:
+ * - url: URL to phancap's get.php file
+ * - token: user name (if access protected)
+ * - secret: password for the user (if access protected)
*
- * @var string
+ * @var array
*/
-$thumbnailsKey = null;
+$thumbnailsConfig = array();
diff --git a/data/templates/default/bookmarks-thumbnail.inc.tpl.php b/data/templates/default/bookmarks-thumbnail.inc.tpl.php
index 77cc67f..b8770dc 100644
--- a/data/templates/default/bookmarks-thumbnail.inc.tpl.php
+++ b/data/templates/default/bookmarks-thumbnail.inc.tpl.php
@@ -5,14 +5,14 @@
*
* Expects a $row variable with bookmark data.
*/
-if (!$GLOBALS['enableWebsiteThumbnails']) {
- return;
-}
-
-$thumbnailHash = md5(
- $address . $GLOBALS['thumbnailsUserId'] . $GLOBALS['thumbnailsKey']
-);
-//echo '';
-echo '';
+$thumbnailer = SemanticScuttle_Service_Factory::get('Thumbnails')->getThumbnailer();
+$imgUrl = $thumbnailer->getThumbnailUrl($address, 120, 90);
+if ($imgUrl !== false) {
+ echo ''
+ . ''
+ . '';
+}
?>
\ No newline at end of file
diff --git a/data/templates/default/bottom.inc.php b/data/templates/default/bottom.inc.php
index e48f593..9e4014c 100644
--- a/data/templates/default/bottom.inc.php
+++ b/data/templates/default/bottom.inc.php
@@ -6,11 +6,6 @@ echo ''.T_('About').'';
echo ' - ';
echo T_("Propulsed by ");
echo " SemanticScuttle";
-
-if($GLOBALS['enableWebsiteThumbnails']) {
- // Licence to the thumbnails provider (OBLIGATORY IF YOU USE ARTVIPER SERVICE)
- echo ' (Thumbnails by webdesign)';
-}
?>
--
cgit v1.2.3-54-g00ecf