2 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
3 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge">
7 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0">
10 <link rel=
"shortcut icon" href=
"../img/favicon.ico">
11 <title>Various hacks - Shaarli Documentation
</title>
12 <link href='https://fonts.googleapis.com/css?family=Lato:
400,
700|Roboto+Slab:
400,
700|Inconsolata:
400,
700' rel='stylesheet' type='text/css'
>
14 <link rel=
"stylesheet" href=
"../css/theme.css" type=
"text/css" />
15 <link rel=
"stylesheet" href=
"../css/theme_extra.css" type=
"text/css" />
16 <link rel=
"stylesheet" href=
"../css/highlight.css">
17 <link href=
"../github-markdown.css" rel=
"stylesheet">
21 var mkdocs_page_name = "Various hacks";
22 var mkdocs_page_input_path = "Various-hacks.md";
23 var mkdocs_page_url = "/Various-hacks/";
26 <script src=
"../js/jquery-2.1.1.min.js"></script>
27 <script src=
"../js/modernizr-2.8.3.min.js"></script>
28 <script type=
"text/javascript" src=
"../js/highlight.pack.js"></script>
32 <body class=
"wy-body-for-nav" role=
"document">
34 <div class=
"wy-grid-for-nav">
37 <nav data-toggle=
"wy-nav-shift" class=
"wy-nav-side stickynav">
38 <div class=
"wy-side-nav-search">
39 <a href=
".." class=
"icon icon-home"> Shaarli Documentation
</a>
41 <form id =
"rtd-search-form" class=
"wy-form" action=
"../search.html" method=
"get">
42 <input type=
"text" name=
"q" placeholder=
"Search docs" />
47 <div class=
"wy-menu wy-menu-vertical" data-spy=
"affix" role=
"navigation" aria-label=
"main navigation">
51 <li class=
"toctree-l1">
53 <a class=
"" href=
"..">Home
</a>
56 <li class=
"toctree-l1">
58 <span class=
"caption-text">Setup
</span>
62 <a class=
"" href=
"../Download-and-Installation/">Download and Installation
</a>
66 <a class=
"" href=
"../Upgrade-and-migration/">Upgrade and migration
</a>
70 <a class=
"" href=
"../Server-requirements/">Server requirements
</a>
74 <a class=
"" href=
"../Server-configuration/">Server configuration
</a>
78 <a class=
"" href=
"../Server-security/">Server security
</a>
82 <a class=
"" href=
"../Shaarli-configuration/">Shaarli configuration
</a>
86 <a class=
"" href=
"../Plugins/">Plugins
</a>
91 <li class=
"toctree-l1">
93 <span class=
"caption-text">Docker
</span>
97 <a class=
"" href=
"../Docker-101/">Docker
101</a>
101 <a class=
"" href=
"../Shaarli-images/">Shaarli images
</a>
105 <a class=
"" href=
"../Reverse-proxy-configuration/">Reverse proxy configuration
</a>
109 <a class=
"" href=
"../Docker-resources/">Docker resources
</a>
114 <li class=
"toctree-l1">
116 <span class=
"caption-text">Usage
</span>
120 <a class=
"" href=
"../Features/">Features
</a>
124 <a class=
"" href=
"../Bookmarklet/">Bookmarklet
</a>
128 <a class=
"" href=
"../Browsing-and-searching/">Browsing and searching
</a>
132 <a class=
"" href=
"../Firefox-share/">Firefox share
</a>
136 <a class=
"" href=
"../RSS-feeds/">RSS feeds
</a>
140 <a class=
"" href=
"../REST-API/">REST API
</a>
145 <li class=
"toctree-l1">
147 <span class=
"caption-text">How To
</span>
151 <a class=
"" href=
"../Backup,-restore,-import-and-export/">Backup, restore, import and export
</a>
153 <li class=
" current">
155 <a class=
"current" href=
"./">Various hacks
</a>
158 <li class=
"toctree-l3"><a href=
"#decode-datastore-content">Decode datastore content
</a></li>
161 <li class=
"toctree-l3"><a href=
"#changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare
</a></li>
164 <li class=
"toctree-l3"><a href=
"#see-also">See also
</a></li>
172 <li class=
"toctree-l1">
174 <a class=
"" href=
"../Troubleshooting/">Troubleshooting
</a>
177 <li class=
"toctree-l1">
179 <span class=
"caption-text">Development
</span>
183 <a class=
"" href=
"../Development-guidelines/">Development guidelines
</a>
187 <a class=
"" href=
"../Continuous-integration-tools/">Continuous integration tools
</a>
191 <a class=
"" href=
"../GnuPG-signature/">GnuPG signature
</a>
195 <a class=
"" href=
"../Coding-guidelines/">Coding guidelines
</a>
199 <a class=
"" href=
"../Directory-structure/">Directory structure
</a>
203 <a class=
"" href=
"../3rd-party-libraries/">3rd party libraries
</a>
207 <a class=
"" href=
"../Plugin-System/">Plugin System
</a>
211 <a class=
"" href=
"../Release-Shaarli/">Release Shaarli
</a>
215 <a class=
"" href=
"../Versioning-and-Branches/">Versioning and Branches
</a>
219 <a class=
"" href=
"../Security/">Security
</a>
223 <a class=
"" href=
"../Static-analysis/">Static analysis
</a>
227 <a class=
"" href=
"../Theming/">Theming
</a>
231 <a class=
"" href=
"../Unit-tests/">Unit tests
</a>
236 <li class=
"toctree-l1">
238 <span class=
"caption-text">About
</span>
242 <a class=
"" href=
"../FAQ/">FAQ
</a>
246 <a class=
"" href=
"../Community-&-Related-software/">Community & Related software
</a>
256 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
259 <nav class=
"wy-nav-top" role=
"navigation" aria-label=
"top navigation">
260 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
261 <a href=
"..">Shaarli Documentation
</a>
265 <div class=
"wy-nav-content">
266 <div class=
"rst-content">
267 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
268 <ul class=
"wy-breadcrumbs">
269 <li><a href=
"..">Docs
</a> »</li>
273 <li>How To
»</li>
277 <li>Various hacks
</li>
278 <li class=
"wy-breadcrumbs-aside">
280 <a href=
"https://github.com/shaarli/Shaarli/edit/master/docs/Various-hacks.md"
281 class=
"icon icon-github"> Edit on GitHub
</a>
288 <div class=
"section">
290 <h3 id=
"decode-datastore-content">Decode datastore content
</h3>
291 <p>To display the array representing the data saved in
<code>data/datastore.php
</code>, use the following snippet:
</p>
292 <pre><code class=
"php">$data =
"tZNdb9MwFIb...
<Commented content inside datastore.php
>";
293 $out = unserialize(gzinflate(base64_decode($data)));
294 echo
"<pre
>"; // Pretty printing is love, pretty printing is life
296 echo
"</pre
>";
300 <p>This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation).
</p>
301 <p>Alternatively, you can transform to JSON format (and pretty-print if you have
<code>jq
</code> installed):
</p>
302 <pre><code>php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(
"!.*/\* (.+) \*/.*!
",
"$
1", file_get_contents(
"data/datastore.php
")))))));' | jq .
305 <h3 id=
"changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare
</h3>
307 <li>Look for
<code><input
type="hidden"
name="lf_linkdate"
value="{$link.linkdate}"
></code> in
<code>tpl/editlink.tpl
</code> (line
14)
</li>
308 <li>Replace
<code>type="hidden"
</code> with
<code>type="text"
</code> from this line
</li>
309 <li>A new date/time field becomes available in the edit/new link dialog.
</li>
310 <li>You can set the timestamp manually by entering it in the format
<code>YYYMMDD_HHMMS
</code>.
</li>
312 <h3 id=
"see-also">See also
</h3>
314 <li><a href=
"https://gist.github.com/nodiscc/8b0194921f059d7b9ad89a581ecd482c">Add a new custom field to shaares (example patch)
</a></li>
315 <li><a href=
"https://gist.github.com/nodiscc/dede231c92cab22c3ad2cc24d5035012">Download CSS styles for shaarlis listed in an opml file
</a></li>
316 <li><a href=
"https://gist.github.com/nodiscc/ed161c66e5b028b5299b0a3733d01c77">Copy an existing Shaarli installation over SSH, and serve it locally
</a></li>
317 <li><a href=
"https://gist.github.com/nodiscc/52e711cda3bc47717c16065231cf6b20">Create multiple Shaarli instances, generate an HTML index of them
</a></li>
324 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
326 <a href=
"../Troubleshooting/" class=
"btn btn-neutral float-right" title=
"Troubleshooting">Next
<span class=
"icon icon-circle-arrow-right"></span></a>
329 <a href=
"../Backup,-restore,-import-and-export/" class=
"btn btn-neutral" title=
"Backup, restore, import and export"><span class=
"icon icon-circle-arrow-left"></span> Previous
</a>
336 <div role=
"contentinfo">
337 <!-- Copyright etc -->
341 Built with
<a href=
"http://www.mkdocs.org">MkDocs
</a> using a
<a href=
"https://github.com/snide/sphinx_rtd_theme">theme
</a> provided by
<a href=
"https://readthedocs.org">Read the Docs
</a>.
351 <div class=
"rst-versions" role=
"note" style=
"cursor: pointer">
352 <span class=
"rst-current-version" data-toggle=
"rst-current-version">
354 <a href=
"https://github.com/shaarli/Shaarli" class=
"fa fa-github" style=
"float: left; color: #fcfcfc"> GitHub
</a>
357 <span><a href=
"../Backup,-restore,-import-and-export/" style=
"color: #fcfcfc;">« Previous
</a></span>
360 <span style=
"margin-left: 15px"><a href=
"../Troubleshooting/" style=
"color: #fcfcfc">Next
»</a></span>
364 <script src=
"../js/theme.js"></script>