Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions data/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,4 +778,27 @@
*/
$allowUnittestMode = false;

/***************************************************
* Caching support
*
* Use the following configuration if you want to provide a link
* to a cached copy of your bookmarks.
*
* Please note that these feature just provide the link if a cached
* copy exists.
*
* You should download SemanticScuttle bookmarks using a tool like
* https://git.sarava.org/?p=httruta.git
*/

/**
* Set to the filesystem folder where your bookmark cache resides.
*/
$cacheFolder = null;

/**
* Set to the base public URL of you cache folder.
*/
$cacheUrl = null;

?>
15 changes: 15 additions & 0 deletions data/templates/default/bookmarks.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,20 @@
}
}

// 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'])
Expand Down Expand Up @@ -425,6 +439,7 @@
. $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"
Expand Down
3 changes: 2 additions & 1 deletion doc/themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Existing themes
===============

* `Flat`__ by Roman Lehnhof. See the `introduction blog post`__
* `sscuttlizr`__

__ https://github.com/rlehnhof/flat
__ http://lehnhof.net/2013/08/semantic-scuttle-new-flat-interface-theme-template/

__ https://github.com/jonrandoem/sscuttlizr