aboutsummaryrefslogtreecommitdiff
path: root/data/templates/default/bookmarks.tpl.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-08-12 10:50:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-08-12 10:50:03 -0300
commitfe2e4cb55f12fb15a5b9b4638305fedf47271c01 (patch)
tree56579add177689a750ed560945389979a2b02d0b /data/templates/default/bookmarks.tpl.php
parentf6e7addccb09d548e9d2e5ce7d4df5b950ad7a64 (diff)
parent9a0f688b376bd8c95356f4226a960a0fbc466422 (diff)
downloadsemanticscuttle-fe2e4cb55f12fb15a5b9b4638305fedf47271c01.tar.gz
semanticscuttle-fe2e4cb55f12fb15a5b9b4638305fedf47271c01.tar.bz2
Merge branch 'feature/cache' into production
Diffstat (limited to 'data/templates/default/bookmarks.tpl.php')
-rw-r--r--data/templates/default/bookmarks.tpl.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php
index 2a3d169..35bbcdb 100644
--- a/data/templates/default/bookmarks.tpl.php
+++ b/data/templates/default/bookmarks.tpl.php
@@ -337,6 +337,20 @@ if ($currenttag!= '') {
}
}
+ // Local cache
+ $cacheLink = null;
+ if ($GLOBALS['cacheFolder'] != null && $GLOBALS['cacheUrl'] != null) {
+ // Hashing discussion at http://linuxprocess.free.fr/MHonArc/Oct-2005/msg00016.html
+ $assetHash = sha1($row['bAddress'] . "\n");
+ $assetHash = substr($assetHash, 0, 2) . '/' . substr($assetHash, 2, 2) . '/' . $assetHash;
+ $assetFile = $GLOBALS['cacheFolder'] . '/' . $assetHash;
+
+ if (file_exists($assetFile)) {
+ $assetLink = $GLOBALS['cacheUrl'] . '/' . $assetHash;
+ $cacheLink = "| <a href=\"$assetLink\">Cache</a>";
+ }
+ }
+
// Copy link
if ($userservice->isLoggedOn()
&& ($currentUser->getId() != $row['uId'])
@@ -425,6 +439,7 @@ if ($currenttag!= '') {
. $copy . "\n"
. $edit . "\n"
. $update . "\n"
+ . $cacheLink ."\n"
. " </div>\n";
echo $privateNoteField != ''
? ' <div class="privateNote" title="'. T_('Private Note on this bookmark') .'">'.$privateNoteField."</div>\n"