Merge branch 'pandoc' into next

This commit is contained in:
nodiscc 2015-04-10 20:28:51 +02:00
commit c5db827aee
11 changed files with 1267 additions and 245 deletions

View file

@ -1,7 +1,6 @@
# Shaarli, the personal, minimalist, super-fast, no-database delicious clone. # Shaarli, the personal, minimalist, super-fast, no-database delicious clone.
#
# Makefile for PHP code analysis & testing # Makefile for PHP code analysis & testing
#
# Prerequisites: # Prerequisites:
# - install Composer, either: # - install Composer, either:
# - from your distro's package manager; # - from your distro's package manager;
@ -9,6 +8,7 @@
# - install/update test dependencies: # - install/update test dependencies:
# $ composer install # 1st setup # $ composer install # 1st setup
# $ composer update # $ composer update
BIN = vendor/bin BIN = vendor/bin
PHP_SOURCE = index.php PHP_SOURCE = index.php
MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode
@ -17,41 +17,39 @@ all: static_analysis_summary
## ##
# Concise status of the project # Concise status of the project
#
# These targets are non-blocking: || exit 0 # These targets are non-blocking: || exit 0
## ##
static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
## ##
# PHP_CodeSniffer # PHP_CodeSniffer
#
# Detects PHP syntax errors # Detects PHP syntax errors
#
# Documentation (usage, output formatting): # Documentation (usage, output formatting):
# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php # - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php # - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
## ##
code_sniffer: code_sniffer_full code_sniffer: code_sniffer_full
# - errors by Git author ### - errors by Git author
code_sniffer_blame: code_sniffer_blame:
@$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame @$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame
# - all errors/warnings ### - all errors/warnings
code_sniffer_full: code_sniffer_full:
@$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200
# - errors grouped by kind ### - errors grouped by kind
code_sniffer_source: code_sniffer_source:
@$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0 @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
## ##
# PHP Copy/Paste Detector # PHP Copy/Paste Detector
#
# Detects code redundancy # Detects code redundancy
#
# Documentation: https://github.com/sebastianbergmann/phpcpd # Documentation: https://github.com/sebastianbergmann/phpcpd
## ##
copy_paste: copy_paste:
@echo "-----------------------" @echo "-----------------------"
@echo "PHP COPY/PASTE DETECTOR" @echo "PHP COPY/PASTE DETECTOR"
@ -61,32 +59,30 @@ copy_paste:
## ##
# PHP Mess Detector # PHP Mess Detector
#
# Detects PHP syntax errors, sorted by category # Detects PHP syntax errors, sorted by category
#
# Rules documentation: http://phpmd.org/rules/index.html # Rules documentation: http://phpmd.org/rules/index.html
# ##
mess_title: mess_title:
@echo "-----------------" @echo "-----------------"
@echo "PHP MESS DETECTOR" @echo "PHP MESS DETECTOR"
@echo "-----------------" @echo "-----------------"
# - all warnings ### - all warnings
mess_detector: mess_title mess_detector: mess_title
@$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__' @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__'
# - all warnings ### - all warnings + HTML output contains links to PHPMD's documentation
# the generated HTML contains links to PHPMD's documentation
mess_detector_html: mess_detector_html:
@$(BIN)/phpmd $(PHP_SOURCE) html $(MESS_DETECTOR_RULES) \ @$(BIN)/phpmd $(PHP_SOURCE) html $(MESS_DETECTOR_RULES) \
--reportfile phpmd.html || exit 0 --reportfile phpmd.html || exit 0
# - warnings grouped by message, sorted by descending frequency order ### - warnings grouped by message, sorted by descending frequency order
mess_detector_grouped: mess_title mess_detector_grouped: mess_title
@$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \ @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \
| cut -f 2 | sort | uniq -c | sort -nr | cut -f 2 | sort | uniq -c | sort -nr
# - summary: number of warnings by rule set ### - summary: number of warnings by rule set
mess_detector_summary: mess_title mess_detector_summary: mess_title
@for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \ @for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \
warnings=$$($(BIN)/phpmd $(PHP_SOURCE) text $$rule | wc -l); \ warnings=$$($(BIN)/phpmd $(PHP_SOURCE) text $$rule | wc -l); \
@ -95,13 +91,20 @@ mess_detector_summary: mess_title
## ##
# Targets for repository and documentation maintenance # Targets for repository and documentation maintenance
# ##
# remove all unversioned files
### remove all unversioned files
clean: clean:
@git clean -df @git clean -df
# update the local copy of the documentation ### update the local copy of the documentation
doc: clean doc: clean
@rm -rf doc @rm -rf doc
@git clone https://github.com/shaarli/Shaarli.wiki.git doc @git clone https://github.com/shaarli/Shaarli.wiki.git doc
@rm -rf doc/.git @rm -rf doc/.git
### Convert local markdown documentation to HTML
htmldoc:
for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
pandoc -f markdown_github -t html5 -s -c "github-markdown.css" -o doc/`basename $$file .md`.html "$$file"; \
done;

View file

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<p>Example bash script:</p>
<pre><code>#!/bin/bash
#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
#Will NOT download linked pages. It&#39;s just a directly usable backup/copy/mirror of your Shaarli
#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed
#Usage: ./local-shaarli.sh
#Author: nodiscc (nodiscc@gmail.com)
#License: MIT (http://opensource.org/licenses/MIT)
set -o errexit
set -o nounset
##### CONFIG #################
#The port used by php&#39;s local server
php_local_port=7431
#Name of the SSH server and path where Shaarli is installed
#TODO: pass these as command-line arguments
remotehost=&quot;my.ssh.server&quot;
remote_shaarli_dir=&quot;/var/www/shaarli&quot;
###### FUNCTIONS #############
_main() {
_CBSyncShaarli
_CBServeShaarli
}
_CBSyncShaarli() {
remote_temp_dir=$(ssh $remotehost mktemp -d)
remote_ssh_user=$(ssh $remotehost whoami)
ssh -t &quot;$remotehost&quot; sudo cp -r &quot;$remote_shaarli_dir&quot; &quot;$remote_temp_dir&quot;
ssh -t &quot;$remotehost&quot; sudo chown -R &quot;$remote_ssh_user&quot;:&quot;$remote_ssh_user&quot; &quot;$remote_temp_dir&quot;
scp -rq &quot;$remotehost&quot;:&quot;$remote_temp_dir&quot; local-shaarli
ssh &quot;$remotehost&quot; rm -r &quot;$remote_temp_dir&quot;
}
_CBServeShaarli() {
#TODO: allow serving a previously downloaded Shaarli
#TODO: ask before overwriting local copy, if it exists
cd local-shaarli/
php -S localhost:${php_local_port}
echo &quot;Please go to http://localhost:${php_local_port}&quot;
}
##### MAIN #################
_main</code></pre>
<p>This outputs:</p>
<pre><code>$ ./local-shaarli.sh
PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
Listening on http://localhost:7431
Document root is /home/user/local-shaarli/shaarli
Press Ctrl-C to quit.
[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /
[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html
[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...</code></pre>
</body>
</html>

View file

@ -0,0 +1,167 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<h3 id="download-css-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</h3>
<p>Example php script:</p>
<pre><code>&lt;!---- ?php --&gt;
&lt;!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) --&gt;
&lt;!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) --&gt;
/**
* Source: https://github.com/Riduidel
* Download css styles for shaarlis listed in an opml file
*/
define(&quot;SHAARLI_RSS_OPML&quot;, &quot;https://www.ecirtam.net/shaarlirss/custom/people.opml&quot;);
define(&quot;THEMES_TEMP_FOLDER&quot;, &quot;new_themes&quot;);
if(!file_exists(THEMES_TEMP_FOLDER)) {
mkdir(THEMES_TEMP_FOLDER);
}
function siteUrl($pathInSite) {
$indexPos = strpos($pathInSite, &quot;index.php&quot;);
if(!$indexPos) {
return $pathInSite;
} else {
return substr($pathInSite, 0, $indexPos);
}
}
function createShaarliHashFromOPMLL($opmlFile) {
$result = array();
$opml = file_get_contents($opmlFile);
$opmlXml = simplexml_load_string($opml);
$outlineElements = $opmlXml-&gt;xpath(&quot;body/outline&quot;);
foreach($outlineElements as $site) {
$siteUrl = siteUrl((string) $site[&#39;htmlUrl&#39;]);
$result[$siteUrl]=((string) $site[&#39;text&#39;]);
}
return $result;
}
function getSiteFolder($url) {
$domain = parse_url($url, PHP_URL_HOST);
return THEMES_TEMP_FOLDER.&quot;/&quot;.str_replace(&quot;.&quot;, &quot;_&quot;, $domain);
}
function get_http_response_code($theURL) {
$headers = get_headers($theURL);
return substr($headers[0], 9, 3);
}
/**
* This makes the code PHP-5 only (particularly the call to &quot;get_headers&quot;)
*/
function copyUserStyleFrom($url, $name, $knownStyles) {
$userStyle = $url.&quot;inc/user.css&quot;;
if(in_array($url, $knownStyles)) {
// TODO add log message
} else {
$statusCode = get_http_response_code($userStyle);
if(intval($statusCode)&lt;300) {
$styleSheet = file_get_contents($userStyle);
$siteFolder = getSiteFolder($url);
if(!file_exists($siteFolder)) {
mkdir($siteFolder);
}
if(!file_exists($siteFolder.&#39;/user.css&#39;)) {
// Copy stylesheet
file_put_contents($siteFolder.&#39;/user.css&#39;, $styleSheet);
}
if(!file_exists($siteFolder.&#39;/README.md&#39;)) {
// Then write a readme.md file
file_put_contents($siteFolder.&#39;/README.md&#39;,
&quot;User style from &quot;.$name.&quot;\n&quot;
.&quot;=============================&quot;
.&quot;\n\n&quot;
.&quot;This stylesheet was downloaded from &quot;.$userStyle.&quot; on &quot;.date(DATE_RFC822)
);
}
if(!file_exists($siteFolder.&#39;/config.ini&#39;)) {
// Write a config file containing useful informations
file_put_contents($siteFolder.&#39;/config.ini&#39;,
&quot;site_url=&quot;.$url.&quot;\n&quot;
.&quot;site_name=&quot;.$name.&quot;\n&quot;
);
}
if(!file_exists($siteFolder.&#39;/home.png&#39;)) {
// And finally copy generated thumbnail
$homeThumb = $siteFolder.&#39;/home.png&#39;;
file_put_contents($siteFolder.&#39;/home.png&#39;, file_get_contents(getThumbnailUrl($url)));
}
echo &#39;Theme have been downloaded from &lt;a href=&quot;&#39;.$url.&#39;&quot;&gt;&#39;.$url.&#39;&lt;/a&gt; into &#39;.$siteFolder
.&#39;. It looks like &lt;img src=&quot;&#39;.$homeThumb.&#39;&quot;&gt;&lt;br/&gt;&#39;;
}
}
}
function getThumbnailUrl($url) {
return &#39;http://api.webthumbnail.org/?url=&#39;.$url;
}
function copyUserStylesFrom($urlToNames, $knownStyles) {
foreach($urlToNames as $url =&gt; $name) {
copyUserStyleFrom($url, $name, $knownStyles);
}
}
/**
* Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/
* @param directory the directory we want to list files of
* @return a simple array containing the list of absolute file paths. Notice that current file (&quot;.&quot;) and parent one(&quot;..&quot;)
* are not listed here
*/
function getDirectoryList ($directory) {
$realPath = realpath($directory);
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = opendir($directory);
// open directory and walk through the filenames
while ($file = readdir($handler)) {
// if file isn&#39;t this directory or its parent, add it to the results
if ($file != &quot;.&quot; &amp;&amp; $file != &quot;..&quot;) {
$results[] = realpath($realPath . &quot;/&quot; . $file);
}
}
// tidy up: close the handler
closedir($handler);
// done!
return $results;
}
/**
* Start in themes folder and look in all subfolders for config.ini files.
* These config.ini files allow us not to download styles again and again
*/
function findKnownStyles() {
$result = array();
$subFolders = getDirectoryList(&quot;themes&quot;);
foreach($subFolders as $folder) {
$configFile = $folder.&quot;/config.ini&quot;;
if(file_exists($configFile)) {
$iniParameters = parse_ini_file($configFile);
array_push($result, $iniParameters[&#39;site_url&#39;]);
}
}
return $result;
}
$knownStyles = findKnownStyles();
copyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);
&lt;!--- ? ----&gt;</code></pre>
</body>
</html>

View file

@ -0,0 +1,201 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<p>Example patch to add a new field (&quot;via&quot;) for links, an input field to set the &quot;via&quot; property from the &quot;edit link&quot; dialog, and display the &quot;via&quot; field in the link list display. <strong>Untested, use at your own risk</strong></p>
<p>Thanks to @Knah-Tsaeb in <a href="https://github.com/sebsauvage/Shaarli/pull/158">https://github.com/sebsauvage/Shaarli/pull/158</a></p>
<pre><code>From e0f363c18e8fe67990ed2bb1a08652e24e70bbcb Mon Sep 17 00:00:00 2001
From: Knah Tsaeb &lt;knah-tsaeb@knah-tsaeb.org&gt;
Date: Fri, 11 Oct 2013 15:18:37 +0200
Subject: [PATCH] Add a &quot;via&quot;/origin property for links, add new input in &quot;edit link&quot; dialog
Thanks to:
* https://github.com/Knah-Tsaeb/Shaarli/commit/040eb18ec8cdabd5ea855e108f81f97fbf0478c4
* https://github.com/Knah-Tsaeb/Shaarli/commit/4123658eae44d7564d1128ce52ddd5689efee813
* https://github.com/Knah-Tsaeb/Shaarli/commit/f1a8ca9cc8fe49b119d51b2d8382cc1a34542f96
---
index.php | 43 ++++++++++++++++++++++++++++++++-----------
tpl/editlink.html | 1 +
tpl/linklist.html | 1 +
3 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/index.php b/index.php
index 6fae2f8..53f798e 100644
--- a/index.php
+++ b/index.php
@@ -436,6 +436,12 @@ if (isset($_POST[&#39;login&#39;]))
// ------------------------------------------------------------------------------------------
// Misc utility functions:
+// Try to get just domain for @via
+function getJustDomain($url){
+ $parts = parse_url($url);
+ return trim($parts[&#39;host&#39;]);
+ }
+
// Returns the server URL (including port and http/https), without path.
// e.g. &quot;http://myserver.com:8080&quot;
// You can append $_SERVER[&#39;SCRIPT_NAME&#39;] to get the current script URL.
@@ -799,7 +805,8 @@ class linkdb implements Iterator, Countable, ArrayAccess
$found= (strpos(strtolower($l[&#39;title&#39;]),$s)!==false)
|| (strpos(strtolower($l[&#39;description&#39;]),$s)!==false)
|| (strpos(strtolower($l[&#39;url&#39;]),$s)!==false)
- || (strpos(strtolower($l[&#39;tags&#39;]),$s)!==false);
+ || (strpos(strtolower($l[&#39;tags&#39;]),$s)!==false)
+ || (!empty($l[&#39;via&#39;]) &amp;&amp; (strpos(strtolower($l[&#39;via&#39;]),$s)!==false));
if ($found) $filtered[$l[&#39;linkdate&#39;]] = $l;
}
krsort($filtered);
@@ -814,7 +821,7 @@ class linkdb implements Iterator, Countable, ArrayAccess
$t = str_replace(&#39;,&#39;,&#39; &#39;,($casesensitive?$tags:strtolower($tags)));
$searchtags=explode(&#39; &#39;,$t);
$filtered=array();
- foreach($this-&gt;links as $l)
+ foreach($this-&gt; links as $l)
{
$linktags = explode(&#39; &#39;,($casesensitive?$l[&#39;tags&#39;]:strtolower($l[&#39;tags&#39;])));
if (count(array_intersect($linktags,$searchtags)) == count($searchtags))
@@ -905,7 +912,7 @@ function showRSS()
else $linksToDisplay = $LINKSDB;
$nblinksToDisplay = 50; // Number of links to display.
if (!empty($_GET[&#39;nb&#39;])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.
- {
+ {
$nblinksToDisplay = $_GET[&#39;nb&#39;]==&#39;all&#39; ? count($linksToDisplay) : max($_GET[&#39;nb&#39;]+0,1) ;
}
@@ -944,7 +951,12 @@ function showRSS()
// If user wants permalinks first, put the final link in description
if ($usepermalinks===true) $descriptionlink = &#39;(&lt;a href=&quot;&#39;.$absurl.&#39;&quot;&gt;Link&lt;/a&gt;)&#39;;
if (strlen($link[&#39;description&#39;])&gt;0) $descriptionlink = &#39;&lt;br&gt;&#39;.$descriptionlink;
- echo &#39;&lt;description&gt;&lt;![CDATA[&#39;.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link[&#39;description&#39;])))).$descriptionlink.&#39;]]&gt;&lt;/description&gt;&#39;.&quot;\n&lt;/item&gt;\n&quot;;
+ if(!empty($link[&#39;via&#39;])){
+ $via = &#39;&lt;br&gt;Origine =&gt; &lt;a href=&quot;&#39;.htmlspecialchars($link[&#39;via&#39;]).&#39;&quot;&gt;&#39;.htmlspecialchars(getJustDomain($link[&#39;via&#39;])).&#39;&lt;/a&gt;&#39;;
+ } else {
+ $via = &#39;&#39;;
+ }
+ echo &#39;&lt;description&gt;&lt;![CDATA[&#39;.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link[&#39;description&#39;])))).$via.$descriptionlink.&#39;]]&gt;&lt;/description&gt;&#39;.&quot;\n&lt;/item&gt;\n&quot;;
$i++;
}
echo &#39;&lt;/channel&gt;&lt;/rss&gt;&lt;!-- Cached version of &#39;.htmlspecialchars(pageUrl()).&#39; --&gt;&#39;;
@@ -980,7 +992,7 @@ function showATOM()
else $linksToDisplay = $LINKSDB;
$nblinksToDisplay = 50; // Number of links to display.
if (!empty($_GET[&#39;nb&#39;])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.
- {
+ {
$nblinksToDisplay = $_GET[&#39;nb&#39;]==&#39;all&#39; ? count($linksToDisplay) : max($_GET[&#39;nb&#39;]+0,1) ;
}
@@ -1006,11 +1018,16 @@ function showATOM()
// Add permalink in description
$descriptionlink = htmlspecialchars(&#39;(&lt;a href=&quot;&#39;.$guid.&#39;&quot;&gt;Permalink&lt;/a&gt;)&#39;);
+ if(isset($link[&#39;via&#39;]) &amp;&amp; !empty($link[&#39;via&#39;])){
+ $via = htmlspecialchars(&#39;&lt;/br&gt; Origine =&gt; &lt;a href=&quot;&#39;.$link[&#39;via&#39;].&#39;&quot;&gt;&#39;.getJustDomain($link[&#39;via&#39;]).&#39;&lt;/a&gt;&#39;);
+ } else {
+ $via = &#39;&#39;;
+ }
// If user wants permalinks first, put the final link in description
if ($usepermalinks===true) $descriptionlink = htmlspecialchars(&#39;(&lt;a href=&quot;&#39;.$absurl.&#39;&quot;&gt;Link&lt;/a&gt;)&#39;);
if (strlen($link[&#39;description&#39;])&gt;0) $descriptionlink = &#39;&amp;lt;br&amp;gt;&#39;.$descriptionlink;
- $entries.=&#39;&lt;content type=&quot;html&quot;&gt;&#39;.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link[&#39;description&#39;]))))).$descriptionlink.&quot;&lt;/content&gt;\n&quot;;
+ $entries.=&#39;&lt;content type=&quot;html&quot;&gt;&#39;.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link[&#39;description&#39;]))))).$descriptionlink.$via.&quot;&lt;/content&gt;\n&quot;;
if ($link[&#39;tags&#39;]!=&#39;&#39;) // Adding tags to each ATOM entry (as mentioned in ATOM specification)
{
foreach(explode(&#39; &#39;,$link[&#39;tags&#39;]) as $tag)
@@ -1478,7 +1495,7 @@ function renderPage()
if (!startsWith($url,&#39;http:&#39;) &amp;&amp; !startsWith($url,&#39;https:&#39;) &amp;&amp; !startsWith($url,&#39;ftp:&#39;) &amp;&amp; !startsWith($url,&#39;magnet:&#39;) &amp;&amp; !startsWith($url,&#39;?&#39;))
$url = &#39;http://&#39;.$url;
$link = array(&#39;title&#39;=&gt;trim($_POST[&#39;lf_title&#39;]),&#39;url&#39;=&gt;$url,&#39;description&#39;=&gt;trim($_POST[&#39;lf_description&#39;]),&#39;private&#39;=&gt;(isset($_POST[&#39;lf_private&#39;]) ? 1 : 0),
- &#39;linkdate&#39;=&gt;$linkdate,&#39;tags&#39;=&gt;str_replace(&#39;,&#39;,&#39; &#39;,$tags));
+ &#39;linkdate&#39;=&gt;$linkdate,&#39;tags&#39;=&gt;str_replace(&#39;,&#39;,&#39; &#39;,$tags), &#39;via&#39;=&gt;trim($_POST[&#39;lf_via&#39;]));
if ($link[&#39;title&#39;]==&#39;&#39;) $link[&#39;title&#39;]=$link[&#39;url&#39;]; // If title is empty, use the URL as title.
$LINKSDB[$linkdate] = $link;
$LINKSDB-&gt;savedb(); // Save to disk.
@@ -1556,7 +1573,8 @@ function renderPage()
$title = (empty($_GET[&#39;title&#39;]) ? &#39;&#39; : $_GET[&#39;title&#39;] ); // Get title if it was provided in URL (by the bookmarklet).
$description = (empty($_GET[&#39;description&#39;]) ? &#39;&#39; : $_GET[&#39;description&#39;]); // Get description if it was provided in URL (by the bookmarklet). [Bronco added that]
$tags = (empty($_GET[&#39;tags&#39;]) ? &#39;&#39; : $_GET[&#39;tags&#39;] ); // Get tags if it was provided in URL
- $private = (!empty($_GET[&#39;private&#39;]) &amp;&amp; $_GET[&#39;private&#39;] === &quot;1&quot; ? 1 : 0); // Get private if it was provided in URL
+ $via = (empty($_GET[&#39;via&#39;]) ? &#39;&#39; : $_GET[&#39;via&#39;] );
+ $private = (!empty($_GET[&#39;private&#39;]) &amp;&amp; $_GET[&#39;private&#39;] === &quot;1&quot; ? 1 : 0); // Get private if it was provided in URL
if (($url!=&#39;&#39;) &amp;&amp; parse_url($url,PHP_URL_SCHEME)==&#39;&#39;) $url = &#39;http://&#39;.$url;
// If this is an HTTP link, we try go get the page to extract the title (otherwise we will to straight to the edit form.)
if (empty($title) &amp;&amp; parse_url($url,PHP_URL_SCHEME)==&#39;http&#39;)
@@ -1567,7 +1585,7 @@ function renderPage()
{
// Look for charset in html header.
preg_match(&#39;#&lt;meta .*charset=.*&gt;#Usi&#39;, $data, $meta);
-
+
// If found, extract encoding.
if (!empty($meta[0]))
{
@@ -1577,7 +1595,7 @@ function renderPage()
$html_charset = (!empty($enc[1])) ? strtolower($enc[1]) : &#39;utf-8&#39;;
}
else { $html_charset = &#39;utf-8&#39;; }
-
+
// Extract title
$title = html_extract_title($data);
if (!empty($title))
@@ -1592,7 +1610,7 @@ function renderPage()
$url=&#39;?&#39;.smallHash($linkdate);
$title=&#39;Note: &#39;;
}
- $link = array(&#39;linkdate&#39;=&gt;$linkdate,&#39;title&#39;=&gt;$title,&#39;url&#39;=&gt;$url,&#39;description&#39;=&gt;$description,&#39;tags&#39;=&gt;$tags,&#39;private&#39;=&gt;$private);
+ $link = array(&#39;linkdate&#39;=&gt;$linkdate,&#39;title&#39;=&gt;$title,&#39;url&#39;=&gt;$url,&#39;description&#39;=&gt;$description,&#39;tags&#39;=&gt;$tags,&#39;via&#39; =&gt; $via,&#39;private&#39;=&gt;$private);
}
$PAGE = new pageBuilder;
@@ -1842,6 +1860,9 @@ function buildLinkList($PAGE,$LINKSDB)
$taglist = explode(&#39; &#39;,$link[&#39;tags&#39;]);
uasort($taglist, &#39;strcasecmp&#39;);
$link[&#39;taglist&#39;]=$taglist;
+ if(!empty($link[&#39;via&#39;])){
+ $link[&#39;via&#39;]=htmlspecialchars($link[&#39;via&#39;]);
+ }
$linkDisp[$keys[$i]] = $link;
$i++;
}
diff --git a/tpl/editlink.html b/tpl/editlink.html
index 4a2c30c..14d4f9c 100644
--- a/tpl/editlink.html
+++ b/tpl/editlink.html
@@ -16,6 +16,7 @@
&lt;i&gt;Title&lt;/i&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;lf_title&quot; value=&quot;{$link.title|htmlspecialchars}&quot; style=&quot;width:100%&quot;&gt;&lt;br&gt;
&lt;i&gt;Description&lt;/i&gt;&lt;br&gt;&lt;textarea name=&quot;lf_description&quot; rows=&quot;4&quot; cols=&quot;25&quot; style=&quot;width:100%&quot;&gt;{$link.description|htmlspecialchars}&lt;/textarea&gt;&lt;br&gt;
&lt;i&gt;Tags&lt;/i&gt;&lt;br&gt;&lt;input type=&quot;text&quot; id=&quot;lf_tags&quot; name=&quot;lf_tags&quot; value=&quot;{$link.tags|htmlspecialchars}&quot; style=&quot;width:100%&quot;&gt;&lt;br&gt;
+ &lt;i&gt;Origine&lt;/i&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;lf_via&quot; value=&quot;{$link.via|htmlspecialchars}&quot; style=&quot;width:100%&quot;&gt;&lt;br&gt;
{if condition=&quot;($link_is_new &amp;&amp; $GLOBALS[&#39;privateLinkByDefault&#39;]==true) || $link.private == true&quot;}
&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; name=&quot;lf_private&quot; id=&quot;lf_private&quot;&gt;
&amp;nbsp;&lt;label for=&quot;lf_private&quot;&gt;&lt;i&gt;Private&lt;/i&gt;&lt;/label&gt;&lt;br&gt;
diff --git a/tpl/linklist.html b/tpl/linklist.html
index ddc38cb..0a8475f 100644
--- a/tpl/linklist.html
+++ b/tpl/linklist.html
@@ -43,6 +43,7 @@
&lt;span class=&quot;linktitle&quot;&gt;&lt;a href=&quot;{$redirector}{$value.url|htmlspecialchars}&quot;&gt;{$value.title|htmlspecialchars}&lt;/a&gt;&lt;/span&gt;
&lt;br&gt;
{if=&quot;$value.description&quot;}&lt;div class=&quot;linkdescription&quot;{if condition=&quot;$search_type==&#39;permalink&#39;&quot;} style=&quot;max-height:none !important;&quot;{/if}&gt;{$value.description}&lt;/div&gt;{/if}
+ {if condition=&quot;isset($value.via) &amp;&amp; !empty($value.via)&quot;}&lt;div&gt;&lt;a href=&quot;{$value.via}&quot;&gt;Origine =&gt; {$value.via|getJustDomain}&lt;/a&gt;&lt;/div&gt;{/if}
{if=&quot;!$GLOBALS[&#39;config&#39;][&#39;HIDE_TIMESTAMPS&#39;] || isLoggedIn()&quot;}
&lt;span class=&quot;linkdate&quot; title=&quot;Permalink&quot;&gt;&lt;a href=&quot;?{$value.linkdate|smallHash}&quot;&gt;{$value.localdate|htmlspecialchars} - permalink&lt;/a&gt; - &lt;/span&gt;
{else}
--
2.1.1</code></pre>
</body>
</html>

368
doc/Home.html Normal file
View file

@ -0,0 +1,368 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<h1 id="shaarli-wiki">Shaarli wiki</h1>
<p>Welcome to the <a href="https://github.com/shaarli/Shaarli/">Shaarli</a> wiki! Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli. For general info, read the <a href="https://github.com/shaarli/Shaarli/blob/master/README.md">README</a>.</p>
<p>If you have any questions or ideas, please join the <a href="https://gitter.im/shaarli/Shaarli">chat</a> (also reachable via <a href="https://irc.gitter.im/">IRC</a>), post them in our <a href="https://github.com/shaarli/Shaarli/issues/44">general discussion</a> or read the current <a href="https://github.com/shaarli/Shaarli/issues">issues</a>. If you've found a bug, please create a <a href="https://github.com/shaarli/Shaarli/issues/new">new issue</a>.</p>
<p>If you'd like a feature added, see if it fits in the list of <a href="Ideas-for-plugins">Ideas for Plugins</a> and update the corresponding bug report.</p>
<p><em>Note: This documentation is available online at <a href="https://github.com/shaarli/Shaarli/wiki">https://github.com/shaarli/Shaarli/wiki</a>, and locally in the <code>doc/</code> directory of your Shaarli installation.</em></p>
<hr />
<!-- MarkdownTOC depth=3 -->
<ul>
<li><p><a href="#basic-usage">Basic Usage</a></p>
<ul>
<li><a href="#add-the-sharing-button-_bookmarklet_-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</a><br /></li>
<li><a href="#share-links-using-the-_bookmarklet_">Share links using the <em>bookmarklet</em></a><br /></li>
</ul></li>
<li><p><a href="#other-usage-examples">Other usage examples</a></p>
<ul>
<li><a href="#using-shaarli-as-a-blog-notepad-pastebin">Using Shaarli as a blog, notepad, pastebin...</a><br /></li>
<li><a href="#rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</a><br /></li>
</ul></li>
<li><p><a href="#configuration">Configuration</a></p>
<ul>
<li><a href="#main-dataoptionsphp-file">Main data/options.php file</a><br /></li>
<li><a href="#changing-theme">Changing theme</a><br /></li>
<li><a href="#changing-template">Changing template</a><br /></li>
</ul></li>
<li><a href="#backup">Backup</a><br /></li>
<li><p><a href="#troubleshooting">Troubleshooting</a></p>
<ul>
<li><a href="#i-forgot-my-password-">I forgot my password !</a><br /></li>
<li><a href="#im-locked-out---login-bruteforce-protection">I'm locked out - Login bruteforce protection</a><br /></li>
<li><a href="#list-of-all-login-attempts">List of all login attempts</a><br /></li>
<li><a href="#exporting-from-diigo">Exporting from Diigo</a><br /></li>
<li><a href="#importing-from-semanticscuttle">Importing from SemanticScuttle</a><br /></li>
<li><a href="#importing-from-mister-wong">Importing from Mister Wong</a><br /></li>
<li><a href="#hosting-problems">Hosting problems</a><br /></li>
<li><a href="#dates-are-not-properly-formatted">Dates are not properly formatted</a><br /></li>
<li><a href="#problems-on-centos-servers">Problems on CentOS servers</a><br /></li>
<li><a href="#my-session-expires--i-cant-stay-logged-in">My session expires ! I can't stay logged in</a><br /></li>
<li><a href="#sessions-do-not-seem-to-work-correctly-on-your-server"><code>Sessions do not seem to work correctly on your server</code></a><br /></li>
<li><a href="#pubsubhubbub-support">pubsubhubbub support</a><br /></li>
</ul></li>
<li><p><a href="#notes">Notes</a></p>
<ul>
<li><a href="#various-hacks">Various hacks</a><br /></li>
<li><a href="#changing-timestamp-for-a-link">Changing timestamp for a link</a><br /></li>
</ul></li>
<li><a href="#related-software">Related software</a><br /></li>
<li><a href="#other-links">Other links</a><br /></li>
<li><p><a href="#faq">FAQ</a></p>
<ul>
<li><a href="#why-did-you-create-shaarli-">Why did you create Shaarli ?</a><br /></li>
<li><a href="#why-use-shaarli-and-not-deliciousdiigo-">Why use Shaarli and not Delicious/Diigo ?</a><br /></li>
<li><a href="#what-does-shaarli-mean-">What does Shaarli mean ?</a><br /></li>
</ul></li>
<li><p><a href="#technical-details">Technical details</a></p>
<ul>
<li><a href="#directory-structure">Directory structure</a><br /></li>
<li><a href="#why-not-use-a-real-database--files-are-slow-">Why not use a real database ? Files are slow !</a><br /></li>
</ul></li>
<li><p><a href="#wiki---todo">Wiki - TODO</a></p></li>
</ul>
<!-- /MarkdownTOC -->
<hr />
<h1 id="basic-usage">Basic Usage</h1>
<h3 id="add-the-sharing-button-bookmarklet-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</h3>
<ul>
<li>Open your Shaarli and <code>Login</code><br /></li>
<li>Click the <code>Tools</code> button in the top bar<br /></li>
<li>Drag the <strong><code>✚Shaare link</code> button</strong>, and drop it to your browser's bookmarks bar.</li>
</ul>
<p><em>This bookmarklet button in compatible with Firefox, Opera, Chrome and Safari. Under Opera, you can't drag'n drop the button: You have to right-click on it and add a bookmark to your personal toolbar.</em></p>
<p><img src="images/bookmarklet.png" /></p>
<h3 id="share-links-using-the-bookmarklet">Share links using the <em>bookmarklet</em></h3>
<ul>
<li>When you are visiting a webpage you would like to share with Shaarli, click the <em>bookmarklet</em> you just added.<br /></li>
<li>A window opens.<br /></li>
<li>You can freely edit title, description, tags... to find it later using the text search or tag filtering.<br /></li>
<li>You will be able to edit this link later using the <img src="https://raw.githubusercontent.com/shaarli/Shaarli/master/images/edit_icon.png" /> edit button.<br /></li>
<li>You can also check the “Private” box so that the link is saved but only visible to you.<br /></li>
<li>Click <code>Save</code>.<strong>Voila! Your link is now shared.</strong></li>
</ul>
<h1 id="other-usage-examples">Other usage examples</h1>
<p>Shaarli can be used:</p>
<ul>
<li>to share, comment and save interesting links and news<br /></li>
<li>to bookmark useful/frequent personal links (as private links) and share them between computers<br /></li>
<li>as a minimal blog/microblog/writing platform (no character limit)<br /></li>
<li>as a read-it-later list (for example items tagged <code>readlater</code>)<br /></li>
<li>to draft and save articles/ideas<br /></li>
<li>to keep code snippets<br /></li>
<li>to keep notes and documentation<br /></li>
<li>as a shared clipboard between machines<br /></li>
<li>as a todo list<br /></li>
<li>to store playlists (e.g. with the <code>music</code> or <code>video</code> tags)<br /></li>
<li>to keep extracts/comments from webpages that may disappear<br /></li>
<li>to keep track of ongoing discussions (for example items tagged <code>discussion</code>)<br /></li>
<li><a href="http://shaarli.chassegnouf.net/?9Efeiw">to feed RSS aggregators</a> (planets) with specific tags<br /></li>
<li>to feed other social networks, blogs... using RSS feeds and external services (dlvr.it, ifttt.com ...)</li>
</ul>
<h3 id="using-shaarli-as-a-blog-notepad-pastebin...">Using Shaarli as a blog, notepad, pastebin...</h3>
<ul>
<li>Go to your Shaarli setup and log in<br /></li>
<li>Click the <code>Add Link</code> button<br /></li>
<li>To share text only, do not enter any URL in the corresponding input field and click <code>Add Link</code><br /></li>
<li>Pick a title and enter your article, or note, in the description field; add a few tags; optionally check <code>Private</code> then click <code>Save</code><br /></li>
<li>Voilà! Your article is now published (privately if you selected that option) and accessible using its permalink.</li>
</ul>
<h3 id="rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</h3>
<p>It is possible to filter RSS/ATOM feeds and Picture Wall on a Shaarli to <strong>only display results of a specific search, or for a specific tag</strong>. For example, if you want to subscribe only to links tagged <code>photography</code>:</p>
<ul>
<li>Go to the desired Shaarli instance.<br /></li>
<li>Search for the <code>photography</code> tag in the <em>Filter by tag</em> box. Links tagged <code>photography</code> are displayed.<br /></li>
<li>Click on the <code>RSS Feed</code> button.<br /></li>
<li>You are presented with an RSS feed showing only these links. Subscribe to it to receive only updates with this tag.<br /></li>
<li>The same method <strong>also works for a full-text search</strong> (<em>Search</em> box) <strong>and for the Picture Wall</strong> (want to only see pictures about <code>nature</code>?)<br /></li>
<li>You can also build the URL manually: <code>https://my.shaarli.domain/?do=rss&amp;searchtags=nature</code>, <code>https://my.shaarli.domain/links/?do=picwall&amp;searchterm=poney</code></li>
</ul>
<p><img src="rss-filter-1.png" /> <img src="rss-filter-2.png" /></p>
<h1 id="configuration">Configuration</h1>
<h3 id="main-dataoptions.php-file">Main data/options.php file</h3>
<p>To change the configuration, create the file <code>data/options.php</code>, example:</p>
<pre><code> &lt;?php
$GLOBALS[&#39;config&#39;][&#39;LINKS_PER_PAGE&#39;] = 30;
$GLOBALS[&#39;config&#39;][&#39;HIDE_TIMESTAMPS&#39;] = true;
$GLOBALS[&#39;config&#39;][&#39;ENABLE_THUMBNAILS&#39;] = false;
?&gt;</code></pre>
<p><strong>Do not edit config options in index.php! Your changes would be lost when you upgrade.</strong> The following parameters are available (parameters (default value)):</p>
<ul>
<li><code>DATADIR ('data')</code> : This is the name of the subdirectory where Shaarli stores is data file. You can change it for better security.<br /></li>
<li><code>CONFIG_FILE ($GLOBALS['config']['DATADIR'].'/config.php')</code> : Name of file which is used to store login/password.<br /></li>
<li><code>DATASTORE ($GLOBALS['config']['DATADIR'].'/datastore.php')</code> : Name of file which contains the link database.<br /></li>
<li><code>LINKS_PER_PAGE (20)</code> : Default number of links per page displayed.<br /></li>
<li><code>IPBANS_FILENAME ($GLOBALS['config']['DATADIR'].'/ipbans.php')</code> : Name of file which records login attempts and IP bans.<br /></li>
<li><code>BAN_AFTER (4)</code> : An IP address will be banned after this many failed login attempts.<br /></li>
<li><code>BAN_DURATION (1800)</code> : Duration of ban (in seconds). (1800 seconds = 30 minutes)<br /></li>
<li><code>OPEN_SHAARLI (false)</code> : If you set this option to true, anyone will be able to add/modify/delete/import/exports links without having to login.<br /></li>
<li><code>HIDE_TIMESTAMPS (false)</code> : If you set this option to true, the date/time of each link will not be displayed (including in RSS Feed).<br /></li>
<li><code>ENABLE_THUMBNAILS (true)</code> : Enable/disable thumbnails.<br /></li>
<li><code>RAINTPL_TMP (tmp/)</code> : Raintpl cache directory (keep the trailing slash!)<br /></li>
<li>`RAINTPL_TPL (tpl/) : Raintpl template directory (keep the trailing slash!). Edit this option if you want to change the rendering template (page structure) used by Shaarli. See <a href="#changing-template">Changing template</a><br /></li>
<li><code>CACHEDIR ('cache')</code> : Directory where the thumbnails are stored.<br /></li>
<li><code>ENABLE_LOCALCACHE (true)</code> : If you have a limited quota on your webspace, you can set this option to false: Shaarli will not generate thumbnails which need to be cached locally (vimeo, flickr, etc.). Thumbnails will still be visible for the services which do not use the local cache (youtube.com, imgur.com, dailymotion.com, imageshack.us)<br /></li>
<li><code>UPDATECHECK_FILENAME ($GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt')</code> : name of the file used to store available shaarli version.<br /></li>
<li><code>UPDATECHECK_INTERVAL (86400)</code> : Delay between new Shaarli version check. 86400 seconds = 24 hours. Note that if you do not login for a week, Shaarli will not check for new version for a week.<br /></li>
<li><code>ENABLE_UPDATECHECK</code>: Determines whether Shaarli check for new releases at <a href="https://github.com/shaarli/Shaarli">https://github.com/shaarli/Shaarli</a><br /></li>
<li><code>SHOW_ATOM (false)</code> : Show an <code>ATOM Feed</code> button next to the <code>Subscribe</code> (RSS) button. ATOM feeds are available at the address <code>?do=atom</code> regardless of this option.<br /></li>
<li><code>ARCHIVE_ORG (false)</code> : For each link, display a link to an archived version on archive.org<br /></li>
<li><code>ENABLE_RSS_PERMALINKS (true)</code>: choose whether the RSS item title link points directly to the link, or to the entry on Shaarli (permalink). <code>true</code> is the original Shaarli bahevior (point directly to the link)</li>
</ul>
<h3 id="changing-theme">Changing theme</h3>
<ul>
<li>Shaarli's apparence can be modified by editing CSS rules in <code>inc/user.css</code>. This file allows to override rules defined in the main <code>inc/shaarli.css</code> (only add changed rules), or define a whole new theme.<br /></li>
<li>Do not edit <code>inc/shaarli.css</code>! Your changes would be overriden when updating Shaarli.<br /></li>
<li>Some themes are available at <a href="https://github.com/shaarli/shaarli-themes">https://github.com/shaarli/shaarli-themes</a>.</li>
</ul>
<p>See also:</p>
<ul>
<li><a href="https://github.com/shaarli/Shaarli/wiki/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</a></li>
</ul>
<h3 id="changing-template">Changing template</h3>
<p>| 💥 | This feature is currently being worked on and will be improved in the next releases. Experimental. |<br />|---------|---------|</p>
<ul>
<li>Find the template you'd like to install. See the list of available templates (TODO). Find it's git clone URL or download the zip archive for the template.<br /></li>
<li>In your Shaarli <code>tpl/</code> directory, run <code>git clone https://url/of/my-template/</code> or unpack the zip archive. There should now be a <code>my-template/</code> directory under the <code>tpl/</code> dir, containing directly all the template files.<br /></li>
<li>Edit <code>data/options.php</code> to have Shaarli use this template. Eg.</li>
</ul>
<p><code>$GLOBALS['config']['RAINTPL_TPL'] = 'tpl/my-template/' ;</code></p>
<p>You can find a list of compatible templates in <a href="#Related-software">Related Software</a></p>
<h1 id="backup">Backup</h1>
<p>You have two ways of backing up your database:</p>
<ul>
<li><strong>Backup the file <code>data/datastore.php</code></strong> (by FTP or SSH). Restore by putting the file back in place.<br /></li>
<li>Example command: <code>rsync -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-$(date +%Y-%m-%d_%H%M).php</code><br /></li>
<li><strong>Export your links as HTML</strong> (Menu <code>Tools</code> &gt; <code>Export</code>). Restore by using the <code>Import</code> feature.<br /></li>
<li>This can be done using the <a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> tool. Example command: <code>./export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all</code></li>
</ul>
<h1 id="troubleshooting">Troubleshooting</h1>
<h3 id="i-forgot-my-password">I forgot my password !</h3>
<p>Delete the file data/config.php and display the page again. You will be asked for a new login/password.</p>
<h3 id="im-locked-out---login-bruteforce-protection">I'm locked out - Login bruteforce protection</h3>
<p>Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.</p>
<p>To remove the current IP bans, delete the file <code>data/ipbans.php</code></p>
<h3 id="list-of-all-login-attempts">List of all login attempts</h3>
<p>The file <code>data/log.txt</code> shows all logins (successful or failed) and bans/lifted bans.<br />Search for <code>failed</code> in this file to look for unauthorized login attempts.</p>
<h3 id="exporting-from-diigo">Exporting from Diigo</h3>
<p>If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)</p>
<h3 id="importing-from-semanticscuttle">Importing from SemanticScuttle</h3>
<p>To correctly import the tags from a <a href="http://semanticscuttle.sourceforge.net/">SemanticScuttle</a> HTML export, edit the HTML file before importing and replace all occurences of <code>tags=</code> (lowercase) to <code>TAGS=</code> (uppercase).</p>
<h3 id="importing-from-mister-wong">Importing from Mister Wong</h3>
<p>See <a href="https://github.com/sebsauvage/Shaarli/issues/146">this issue</a> for import tweaks.</p>
<h3 id="hosting-problems">Hosting problems</h3>
<ul>
<li>On <strong>free.fr</strong> : Please note that free uses php 5.1 and thus you will not have autocomplete in tag editing. Don't forget to create a <code>sessions</code> directory at the root of your webspace. Change the file extension to <code>.php5</code> or create a <code>.htaccess</code> file in the directory where Shaarli is located containing:</li>
</ul>
<pre><code>php 1
SetEnv PHP_VER 5</code></pre>
<ul>
<li>If you have an error such as: <code>Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx</code>, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to <code>.php5</code><br /></li>
<li>On <strong>1and1</strong> : If you add the link from the page (and not from the bookmarklet), Shaarli will no be able to get the title of the page. You will have to enter it manually. (Because they have disabled the ability to download a file through HTTP).<br /></li>
<li>If you have the error <code>Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx</code>, it means that your host has disabled the ability to fetch a file by HTTP in the php config (Typically in 1and1 hosting). Bad host. Change host. Or comment the following lines:</li>
</ul>
<pre><code>//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) &lt;head&gt; in html
//if (strpos($status,&#39;200 OK&#39;)) $title=html_extract_title($data);</code></pre>
<ul>
<li>On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.<br /></li>
<li>On <strong>lost-oasis</strong>, RSS doesn't work correctly, because of this message at the begining of the RSS/ATOM feed : <code>&lt;? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?&gt;</code>. To fix this, remove this message from <code>php-include/prepend.php</code></li>
</ul>
<h3 id="dates-are-not-properly-formatted">Dates are not properly formatted</h3>
<p>Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )</p>
<h3 id="problems-on-centos-servers">Problems on CentOS servers</h3>
<p>On <strong>CentOS</strong>/RedHat derivatives, you may need to install the <code>php-mbstring</code> package.</p>
<h3 id="my-session-expires-i-cant-stay-logged-in">My session expires ! I can't stay logged in</h3>
<p>This can be caused by several things:</p>
<ul>
<li>Your php installation may not have a proper directory setup for session files. (eg. on Free.fr you need to create a <code>session</code> directory on the root of your website.) You may need to create the session directory of set it up.<br /></li>
<li>Most hosts regularly clean the temporary and session directories. Your host may be cleaning those directories too aggressively (eg.OVH hosts), forcing an expire of the session. You may want to set the session directory in your web root. (eg. Create the <code>sessions</code> subdirectory and add <code>ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');</code>. Make sure this directory is not browsable !)<br /></li>
<li>If your IP address changes during surfing, Shaarli will force expire your session for security reasons (to prevent session cookie hijacking). This can happen when surfing from WiFi or 3G (you may have switched WiFi/3G access point), or in some corporate/university proxies which use load balancing (and may have proxies with several external IP addresses).<br /></li>
<li>Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.<br /></li>
<li>You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.<br /></li>
<li>If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.</li>
</ul>
<h3 id="sessions-do-not-seem-to-work-correctly-on-your-server"><code>Sessions do not seem to work correctly on your server</code></h3>
<p>Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have <strong>no dots</strong> in the hostname (e.g. <code>localhost</code> or <code>http://my-webserver/shaarli/</code>), some browsers will not store cookies at all (this respects the <a href="http://curl.haxx.se/rfc/cookie_spec.html">HTTP cookie specification</a>).</p>
<h3 id="pubsubhubbub-support">pubsubhubbub support</h3>
<p>Download <a href="https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php">publisher.php</a> at the root of your Shaarli installation and set <code>$GLOBALS['config']['PUBSUBHUB_URL']</code> in your <code>config.php</code></p>
<h1 id="notes">Notes</h1>
<h3 id="various-hacks">Various hacks</h3>
<ul>
<li><a href="Example-patch---add-new-via-field-for-links">Example patch: add a new &quot;via&quot; field for links</a><br /></li>
<li><a href="Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli">Copy a Shaarli installation over SSH SCP, serve it locally with php cli</a><br /></li>
<li>To display the array representing the data saved in datastore.php, use the following snippet (TODO where is it gone?)</li>
</ul>
<h3 id="changing-timestamp-for-a-link">Changing timestamp for a link</h3>
<ul>
<li>Look for <code>&lt;input type=&quot;hidden&quot; name=&quot;lf_linkdate&quot; value=&quot;{$link.linkdate}&quot;&gt;</code> in <code>tpl/editlink.tpl</code> (line 14)<br /></li>
<li>Remove <code>type=&quot;hidden&quot;</code> from this line<br /></li>
<li>A new date/time field becomes available in the edit/new link dialog. You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li>
</ul>
<pre><code>$data = &quot;tZNdb9MwFIb... &lt;Commented content inside datastore.php&gt;&quot;;
$out = unserialize(gzinflate(base64_decode($data)));
echo &quot;&lt;pre&gt;&quot;; // Pretty printing is love, pretty printing is life
print_r($out);
echo &quot;&lt;/pre&gt;&quot;;
exit;</code></pre>
<p>This will output the internal representation of the datastore, &quot;unobfuscated&quot; (if this can really be considered obfuscation)</p>
<h1 id="related-software">Related software</h1>
<p>Unofficial but relatedd work on Shaarli. If you maintain one of these, please get in touch with us to help us find a way to adapt your work to our fork. <strong>TODO</strong> contact repos owners to see if they'd like to standardize their work for the community fork.</p>
<ul>
<li><a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> - Archive your Shaarli bookmarks and their content<br /></li>
<li><a href="http://sebsauvage.net/links/?ZAyDzg">Shaarli for Android</a> - Android application that adds Shaarli as a sharing provider<br /></li>
<li><a href="https://play.google.com/store/apps/details?id=com.dimtion.shaarlier">Shaarlier for Android</a> - Android application to simply add links directly into your Shaarli<br /></li>
<li><a href="https://github.com/mknexen/shaarli-river">shaarli-river</a> - an aggregator for shaarlis with many features<br /></li>
<li><a href="https://github.com/DMeloni/shaarlo">Shaarlo</a> - an aggregator for shaarlis with many features (<a href="http://shaarli.fr/">Demo</a>)<br /></li>
<li><a href="https://github.com/kalvn/shaarli-blocks">kalvn/shaarli-blocks</a> - A template/theme for Shaarli<br /></li>
<li><a href="https://github.com/kalvn/Shaarli-Material">kalvn/Shaarli-Material</a> -<br />A theme (template) based on Google's Material Design for Shaarli, the superfast delicious clone.<br /></li>
<li><a href="https://github.com/Vinm/Blue-theme-for-Shaarli">Vinm/Blue-theme-for Shaarli</a> - A template/theme for Shaarli (<a href="https://github.com/Vinm/Blue-theme-for-Shaarli/issues/2">unmaintained</a>, compatibility unknown)<br /></li>
<li><a href="https://github.com/vivienhaese/shaarlitheme">vivienhaese/shaarlitheme</a> - A Shaarli fork meant to be run in an openshift instance<br /></li>
<li><a href="https://github.com/jcsaaddupuy/tt-rss-shaarli">tt-rss-shaarli</a> - <a href="http://tt-rss.org/">TinyTiny RSS</a> plugin that adds support for sharing articles with Shaarli<br /></li>
<li><a href="https://github.com/dhoko/ShaarliTemplate">dhoko/ShaarliTemplate</a> - A template/theme for Shaarli<br /></li>
<li><a href="https://github.com/mknexen/shaarli-api">mknexen/shaarli-api</a> - a REST API for Shaarli<br /></li>
<li><a href="https://github.com/alexisju/albinomouse-template">Albinomouse</a> - A full template for Shaarli<br /></li>
<li><a href="https://github.com/BoboTiG/shaarlimages">Shaarlimages</a> - An image-oriented aggregator for Shaarlis<br /></li>
<li><a href="https://github.com/AkibaTech/Shaarli---SuperHero-Theme">Shaarli Superhero Theme</a> - A template/theme for Shaarli<br /></li>
<li><a href="https://github.com/misterair/limonade">Limonade</a> - A fork of Shaarli with a new template<br /></li>
<li><a href="https://github.com/ahmet2mir/octopress-shaarli">octopress-shaarli</a> - octoprress plugin to retrieve SHaarli links on the sidebara<br /></li>
<li><a href="https://github.com/bookieio/bookie">Bookie</a> - Another self-hostable, Free bookmark sharing software, written in Python<br /></li>
<li><a href="https://github.com/plainmade/unmark">Unmark</a> - An open source to do app for bookmarks (<a href="https://unmark.it/">Homepage</a>)</li>
</ul>
<h1 id="other-links">Other links</h1>
<ul>
<li><a href="http://sebsauvage.net/links/">Liens en vrac de sebsauvage</a> - the original Shaarli<br /></li>
<li><a href="http://porneia.free.fr/pub/links/ou-est-shaarli.html">A large list of Shaarlis</a><br /></li>
<li><a href="https://raw.githubusercontent.com/Oros42/find_shaarlis/master/annuaires.json">A list of working Shaarli aggregators</a><br /></li>
<li><a href="https://github.com/Oros42/shaarlis_list">A list of some known Shaarlis</a><br /></li>
<li><a href="http://sebsauvage.net/rhaa/index.php?2011/09/16/09/29/58-adieu-delicious-diigo-et-stumbleupon-salut-shaarli-">Adieu Delicious, Diigo et StumbleUpon. Salut Shaarli ! - sebsauvage.net</a> (fr) <em>16/09/2011 - the original post about Shaarli</em><br /></li>
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:ideas">Original ideas/fixme/TODO page</a><br /></li>
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:discussion">Original discussion page</a> (fr)<br /></li>
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:history">Original revisions history</a><br /></li>
<li><a href="https://www.shaarli.fr/my.php">Shaarli.fr/my</a> - Unofficial, unsupported (old fork) hosted Shaarlis provider, courtesy of <a href="https://github.com/DMeloni">DMeloni</a><br /></li>
<li><a href="http://shaarferme.etudiant-libre.fr.nf/index.php">Shaarli Communauty</a> - Another unofficial Shaarli hoster (unsupported, old fork), hoster unknown</li>
</ul>
<h1 id="faq">FAQ</h1>
<h3 id="why-did-you-create-shaarli">Why did you create Shaarli ?</h3>
<p>I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… <strong>their Firefox addon sends to Diigo every single URL you visit</strong> (Don't believe me ? Use <a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a> and open any page).</p>
<p>Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server.</p>
<h3 id="why-use-shaarli-and-not-deliciousdiigo">Why use Shaarli and not Delicious/Diigo ?</h3>
<p>With Shaarli:</p>
<ul>
<li>The data is yours: It's hosted on your server.<br /></li>
<li>Never fear of having your data locked-in.<br /></li>
<li>Never fear to have your data sold to third party.<br /></li>
<li>Your private links are not hosted on a third party server.<br /></li>
<li>You are not tracked by browser addons (like Diigo does)<br /></li>
<li>You can change the look and feel of the pages if you want.<br /></li>
<li>You can change the behaviour of the program.<br /></li>
<li>It's magnitude faster than most bookmarking services.</li>
</ul>
<h3 id="what-does-shaarli-mean">What does Shaarli mean ?</h3>
<p>Shaarli is for shaaring your links.</p>
<h1 id="technical-details">Technical details</h1>
<ul>
<li>Application is protected against XSRF (Cross-site requests forgery): Forms which act on data (save,delete…) contain a token generated by the server. Any posted form which does not contain a valid token is rejected. Any token can only be used once. Token are attached to the session and cannot be reused in another session.<br /></li>
<li>Sessions automatically expires after 60 minutes. Sessions are protected against highjacking: The sessionID cannot be used from a different IP address.<br /></li>
<li>An .htaccess file protects the data file.<br /></li>
<li><p>Link database is an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a .php file. Thus even if the server does not support htaccess files, the data file will still not be readable by URL. The database looks like this:</p>
<pre><code>&lt;?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...
...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?&gt;</code></pre></li>
<li>The password is salted, hashed and stored in the data subdirectory, in a php file, and protected by htaccess. Even if the webserver does not support htaccess, the hash is not readable by URL. Even if the .php file is stolen, the password cannot deduced from the hash. The salt prevents rainbow-tables attacks.<br /></li>
<li>Shaarli relies on <code>HTTP_REFERER</code> for some functions (like redirects and clicking on tags). If you have disabled or masqueraded <code>HTTP_REFERER</code> in your browser, some features of Shaarli may not work<br /></li>
<li><code>magic_quotes</code> is a horrible option of php which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with magic_quotes on, so you should not be bothered even on crappy hosts.<br /></li>
<li><p>Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg.20110923_150523) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only A-Z a-z 0-9 - _ and @.</p></li>
</ul>
<h3 id="directory-structure">Directory structure</h3>
<p>Here is the directory structure of Shaarli and the purpose of the different files:</p>
<pre><code> index.php : Main program.
COPYING : Shaarli license.
inc/ : Includes (libraries, CSS…)
shaarli.css : Shaarli stylesheet.
jquery.min.js : jQuery javascript library.
jquery-ui.min.js : jQuery-UI javascript library.
jquery-MIT-LICENSE.txt: jQuery license.
jquery.lazyload.min.js: LazyLoad javascript library.
rain.tpl.class.php : RainTPL templating library.
tpl/ : RainTPL templates for Shaarli. They are used to build the pages.
images/ : Images and icons used in Shaarli.
data/ : Directory where data is stored (bookmark database, configuration, logs, banlist…)
config.php : Shaarli configuration (login, password, timezone, title…)
datastore.php : Your link database (compressed).
ipban.php : IP address ban system data.
lastupdatecheck.txt : Update check timestamp file (used to check every 24 hours if a new version of Shaarli is available).
log.txt : login/IPban log.
cache/ : Directory containing the thumbnails cache. This directory is automatically created. You can erase it anytime you want.
tmp/ : Temporary directory for compiled RainTPL templates. This directory is automatically created. You can erase it anytime you want.</code></pre>
<h3 id="why-not-use-a-real-database-files-are-slow">Why not use a real database ? Files are slow !</h3>
<p>Does browsing <a href="http://sebsauvage.net/links/">this page</a> feel slow ? Try browsing older pages, too.</p>
<p>It's not slow at all, is it ? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why ?</p>
<p>The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time.</p>
<h1 id="wiki---todo">Wiki - TODO</h1>
<ul>
<li>Translate (new page can be called Home.fr, Home.es ...) and linked from Home<br /></li>
<li>add more screenshots<br /></li>
<li>add developer documentation (storage architecture, classes and functions, security handling, ...)<br /></li>
<li>Contact related projects<br /></li>
<li>Add a Table of Contents to the wiki (can be added to the sidebar)</li>
</ul>
<p>...</p>
</body>
</html>

View file

@ -8,6 +8,52 @@ If you'd like a feature added, see if it fits in the list of [Ideas for Plugins]
_Note: This documentation is available online at https://github.com/shaarli/Shaarli/wiki, and locally in the `doc/` directory of your Shaarli installation._ _Note: This documentation is available online at https://github.com/shaarli/Shaarli/wiki, and locally in the `doc/` directory of your Shaarli installation._
----------------------------------------------------------------------------------
<!-- MarkdownTOC depth=3 -->
- [Basic Usage](#basic-usage)
- [Add the sharing button (_bookmarklet_) to your browser](#add-the-sharing-button-_bookmarklet_-to-your-browser)
- [Share links using the _bookmarklet_](#share-links-using-the-_bookmarklet_)
- [Other usage examples](#other-usage-examples)
- [Using Shaarli as a blog, notepad, pastebin...](#using-shaarli-as-a-blog-notepad-pastebin)
- [RSS Feeds or Picture Wall for a specific search/tag](#rss-feeds-or-picture-wall-for-a-specific-searchtag)
- [Configuration](#configuration)
- [Main data/options.php file](#main-dataoptionsphp-file)
- [Changing theme](#changing-theme)
- [Changing template](#changing-template)
- [Backup](#backup)
- [Troubleshooting](#troubleshooting)
- [I forgot my password !](#i-forgot-my-password-)
- [I'm locked out - Login bruteforce protection](#im-locked-out---login-bruteforce-protection)
- [List of all login attempts](#list-of-all-login-attempts)
- [Exporting from Diigo](#exporting-from-diigo)
- [Importing from SemanticScuttle](#importing-from-semanticscuttle)
- [Importing from Mister Wong](#importing-from-mister-wong)
- [Hosting problems](#hosting-problems)
- [Dates are not properly formatted](#dates-are-not-properly-formatted)
- [Problems on CentOS servers](#problems-on-centos-servers)
- [My session expires ! I can't stay logged in](#my-session-expires--i-cant-stay-logged-in)
- [`Sessions do not seem to work correctly on your server`](#sessions-do-not-seem-to-work-correctly-on-your-server)
- [pubsubhubbub support](#pubsubhubbub-support)
- [Notes](#notes)
- [Various hacks](#various-hacks)
- [Changing timestamp for a link](#changing-timestamp-for-a-link)
- [Related software](#related-software)
- [Other links](#other-links)
- [FAQ](#faq)
- [Why did you create Shaarli ?](#why-did-you-create-shaarli-)
- [Why use Shaarli and not Delicious/Diigo ?](#why-use-shaarli-and-not-deliciousdiigo-)
- [What does Shaarli mean ?](#what-does-shaarli-mean-)
- [Technical details](#technical-details)
- [Directory structure](#directory-structure)
- [Why not use a real database ? Files are slow !](#why-not-use-a-real-database--files-are-slow-)
- [Wiki - TODO](#wiki---todo)
<!-- /MarkdownTOC -->
------------------------------------------------------------------ ------------------------------------------------------------------
# Basic Usage # Basic Usage
@ -139,17 +185,6 @@ You have two ways of backing up your database:
* This can be done using the [shaarchiver](https://github.com/nodiscc/shaarchiver) tool. Example command: `./export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all` * This can be done using the [shaarchiver](https://github.com/nodiscc/shaarchiver) tool. Example command: `./export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all`
# Login bruteforce protection
Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.
To remove the current IP bans, delete the file `data/ipbans.php`
## List of all login attempts
The file `data/log.txt` shows all logins (successful or failed) and bans/lifted bans.
Search for `failed` in this file to look for unauthorized login attempts.
# Troubleshooting # Troubleshooting
### I forgot my password ! ### I forgot my password !
@ -157,6 +192,18 @@ Search for `failed` in this file to look for unauthorized login attempts.
Delete the file data/config.php and display the page again. You will be asked for a new login/password. Delete the file data/config.php and display the page again. You will be asked for a new login/password.
### I'm locked out - Login bruteforce protection
Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.
To remove the current IP bans, delete the file `data/ipbans.php`
### List of all login attempts
The file `data/log.txt` shows all logins (successful or failed) and bans/lifted bans.
Search for `failed` in this file to look for unauthorized login attempts.
### Exporting from Diigo ### Exporting from Diigo
If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.) If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<p>Please list here ideas for potential plugins. Do not include lengthy discussion about why/how the plugin should work, but link instead to an issue where this would have been discussed.<br />By listing these ideas here, we can keep the issues list a bit more clean, and have a centralized place where people wanting to contribute can find potential enhancement ideas.<br />Also have a look at <a href="https://github.com/shaarli/Shaarli/issues/14">https://github.com/shaarli/Shaarli/issues/14</a> for other suggestions.</p>
<ul>
<li><a href="https://github.com/shaarli/Shaarli/issues/101">Mozilla Social API integration</a><br /></li>
<li><a href="https://github.com/shaarli/Shaarli/issues/58">File sharing/Upload service integration</a><br /></li>
<li><a href="https://github.com/sebsauvage/Shaarli/pull/70">Publish to social media services (twitter, facebook, ...)</a><br /></li>
<li><a href="https://github.com/sebsauvage/Shaarli/issues/170">Comment system</a><br /></li>
<li><a href="https://github.com/sebsauvage/Shaarli/pull/144">Syntax highlighting support</a><br /></li>
<li><a href="https://github.com/sebsauvage/Shaarli/issues/81">Piwik tracking code integration</a><br /></li>
<li><a href="https://github.com/sebsauvage/Shaarli/issues/75">Pingback support</a></li>
</ul>
</body>
</html>

70
doc/_Sidebar.html Normal file
View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="github-markdown.css">
</head>
<body>
<ul>
<li><p><a href="#basic-usage">Basic Usage</a></p>
<ul>
<li><a href="#add-the-sharing-button-_bookmarklet_-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</a><br /></li>
<li><a href="#share-links-using-the-_bookmarklet_">Share links using the <em>bookmarklet</em></a><br /></li>
</ul></li>
<li><p><a href="#other-usage-examples">Other usage examples</a></p>
<ul>
<li><a href="#using-shaarli-as-a-blog-notepad-pastebin">Using Shaarli as a blog, notepad, pastebin...</a><br /></li>
<li><a href="#rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</a><br /></li>
</ul></li>
<li><p><a href="#configuration">Configuration</a></p>
<ul>
<li><a href="#main-dataoptionsphp-file">Main data/options.php file</a><br /></li>
<li><a href="#changing-theme">Changing theme</a><br /></li>
</ul></li>
<li><a href="#backup">Backup</a><br /></li>
<li><p><a href="#login-bruteforce-protection">Login bruteforce protection</a></p>
<ul>
<li><a href="#list-of-all-login-attempts">List of all login attempts</a><br /></li>
</ul></li>
<li><p><a href="#troubleshooting">Troubleshooting</a></p>
<ul>
<li><a href="#i-forgot-my-password-">I forgot my password !</a><br /></li>
<li><a href="#exporting-from-diigo">Exporting from Diigo</a><br /></li>
<li><a href="#importing-from-semanticscuttle">Importing from SemanticScuttle</a><br /></li>
<li><a href="#importing-from-mister-wong">Importing from Mister Wong</a><br /></li>
<li><a href="#hosting-problems">Hosting problems</a><br /></li>
<li><a href="#dates-are-not-properly-formatted">Dates are not properly formatted</a><br /></li>
<li><a href="#problems-on-centos-servers">Problems on CentOS servers</a><br /></li>
<li><a href="#my-session-expires--i-cant-stay-logged-in">My session expires ! I can't stay logged in</a><br /></li>
<li><a href="#sessions-do-not-seem-to-work-correctly-on-your-server"><code>Sessions do not seem to work correctly on your server</code></a><br /></li>
<li><a href="#pubsubhubbub-support">pubsubhubbub support</a><br /></li>
</ul></li>
<li><p><a href="#notes">Notes</a></p>
<ul>
<li><a href="#various-hacks">Various hacks</a><br /></li>
<li><a href="#changing-timestamp-for-a-link">Changing timestamp for a link</a><br /></li>
</ul></li>
<li><a href="#related-software">Related software</a><br /></li>
<li><a href="#other-links">Other links</a><br /></li>
<li><p><a href="#faq">FAQ</a></p>
<ul>
<li><a href="#why-did-you-create-shaarli-">Why did you create Shaarli ?</a><br /></li>
<li><a href="#why-use-shaarli-and-not-deliciousdiigo-">Why use Shaarli and not Delicious/Diigo ?</a><br /></li>
<li><a href="#what-does-shaarli-mean-">What does Shaarli mean ?</a><br /></li>
</ul></li>
<li><p><a href="#technical-details">Technical details</a></p>
<ul>
<li><a href="#directory-structure">Directory structure</a><br /></li>
<li><a href="#why-not-use-a-real-database--files-are-slow-">Why not use a real database ? Files are slow !</a><br /></li>
</ul></li>
<li><p><a href="#wiki---todo">Wiki - TODO</a></p></li>
</ul>
</body>
</html>

277
doc/github-markdown.css Normal file
View file

@ -0,0 +1,277 @@
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 10px 20%; }
body > *:first-child {
margin-top: 0 !important; }
body > *:last-child {
margin-bottom: 0 !important; }
a {
color: #4183C4; }
a.absent {
color: #cc0000; }
a.anchor {
display: block;
padding-left: 30px;
margin-left: -30px;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
bottom: 0; }
h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
cursor: text;
position: relative; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
background: url("../../images/modules/styleguide/para.png") no-repeat 10px center;
text-decoration: none; }
h1 tt, h1 code {
font-size: inherit; }
h2 tt, h2 code {
font-size: inherit; }
h3 tt, h3 code {
font-size: inherit; }
h4 tt, h4 code {
font-size: inherit; }
h5 tt, h5 code {
font-size: inherit; }
h6 tt, h6 code {
font-size: inherit; }
h1 {
font-size: 28px;
color: black; }
h2 {
font-size: 24px;
border-bottom: 1px solid #cccccc;
color: black; }
h3 {
font-size: 18px; }
h4 {
font-size: 16px; }
h5 {
font-size: 14px; }
h6 {
color: #777777;
font-size: 14px; }
p, blockquote, ol, dl, table, pre {
margin: 15px 0; }
hr {
background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0;
border: 0 none;
color: #cccccc;
height: 4px;
padding: 0; }
body > h2:first-child {
margin-top: 0;
padding-top: 0; }
body > h1:first-child {
margin-top: 0;
padding-top: 0; }
body > h1:first-child + h2 {
margin-top: 0;
padding-top: 0; }
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
margin-top: 0;
padding-top: 0; }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0; }
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
margin-top: 0; }
li p.first {
display: inline-block; }
ul, ol {
padding-left: 30px; }
ul :first-child, ol :first-child {
margin-top: 0; }
ul :last-child, ol :last-child {
margin-bottom: 0; }
dl {
padding: 0; }
dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px; }
dl dt:first-child {
padding: 0; }
dl dt > :first-child {
margin-top: 0; }
dl dt > :last-child {
margin-bottom: 0; }
dl dd {
margin: 0 0 15px;
padding: 0 15px; }
dl dd > :first-child {
margin-top: 0; }
dl dd > :last-child {
margin-bottom: 0; }
blockquote {
border-left: 4px solid #dddddd;
padding: 0 15px;
color: #777777; }
blockquote > :first-child {
margin-top: 0; }
blockquote > :last-child {
margin-bottom: 0; }
table {
padding: 0; }
table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
table tr:nth-child(2n) {
background-color: #f8f8f8; }
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr td {
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr th :first-child, table tr td :first-child {
margin-top: 0; }
table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
img {
max-width: 100%; }
span.frame {
display: block;
overflow: hidden; }
span.frame > span {
border: 1px solid #dddddd;
display: block;
float: left;
overflow: hidden;
margin: 13px 0 0;
padding: 7px;
width: auto; }
span.frame span img {
display: block;
float: left; }
span.frame span span {
clear: both;
color: #333333;
display: block;
padding: 5px 0 0; }
span.align-center {
display: block;
overflow: hidden;
clear: both; }
span.align-center > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: center; }
span.align-center span img {
margin: 0 auto;
text-align: center; }
span.align-right {
display: block;
overflow: hidden;
clear: both; }
span.align-right > span {
display: block;
overflow: hidden;
margin: 13px 0 0;
text-align: right; }
span.align-right span img {
margin: 0;
text-align: right; }
span.float-left {
display: block;
margin-right: 13px;
overflow: hidden;
float: left; }
span.float-left span {
margin: 13px 0 0; }
span.float-right {
display: block;
margin-left: 13px;
overflow: hidden;
float: right; }
span.float-right > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: right; }
code, tt {
margin: 0 2px;
padding: 0 5px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px; }
pre code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent; }
.highlight pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px; }
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px; }
pre code, pre tt {
background-color: transparent;
border: none; }

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
<div id="footer"> <div id="footer">
<b><a href="https://github.com/shaarli/Shaarli">Shaarli</a></b> - The personal, minimalist, super-fast, no-database delicious clone by the <a href="https://github.com/shaarli/Shaarli">Shaarli</a> community - <a href="doc/index.html">Help/documentation</a> <b><a href="https://github.com/shaarli/Shaarli">Shaarli</a></b> - The personal, minimalist, super-fast, no-database delicious clone by the <a href="https://github.com/shaarli/Shaarli">Shaarli</a> community - <a href="doc/Home.html">Help/documentation</a>
</div> </div>
{if="$newversion"} {if="$newversion"}
<div id="newversion"><span id="version_id">&#x25CF;</span> Shaarli {$newversion|htmlspecialchars} is <a href="https://github.com/shaarli/Shaarli/releases">available</a>.</div> <div id="newversion"><span id="version_id">&#x25CF;</span> Shaarli {$newversion|htmlspecialchars} is <a href="https://github.com/shaarli/Shaarli/releases">available</a>.</div>