diff options
author | Thomas Citharel <thomas.citharet@gmail.com> | 2013-09-10 18:23:56 +0200 |
---|---|---|
committer | Thomas Citharel <thomas.citharet@gmail.com> | 2013-09-10 18:23:56 +0200 |
commit | 964481d023676bee964141a1d14f638995ac8d30 (patch) | |
tree | 3875e93c7c92da7a98d0d8f867d10c404c789805 | |
parent | af1d2792263d45c5ffea2e5485dd81bf59b7bded (diff) | |
download | wallabag-964481d023676bee964141a1d14f638995ac8d30.tar.gz wallabag-964481d023676bee964141a1d14f638995ac8d30.tar.zst wallabag-964481d023676bee964141a1d14f638995ac8d30.zip |
Fixed bugs, added a flattr button and an option
There's a button and an option in define.inc.php to show the button or
not.
-rw-r--r-- | inc/poche/Poche.class.php | 2 | ||||
-rw-r--r-- | inc/poche/define.inc.php | 3 | ||||
-rw-r--r-- | tpl/css/style-light.css | 4 | ||||
-rw-r--r-- | tpl/img/light/flattr.png | bin | 0 -> 3521 bytes | |||
-rw-r--r-- | tpl/view.twig | 3 |
5 files changed, 9 insertions, 3 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 8b24e5cd..b0efe69a 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -602,7 +602,7 @@ class FlattrItem{ | |||
602 | 602 | ||
603 | private function cacheflattrfile($urltoflattr){ | 603 | private function cacheflattrfile($urltoflattr){ |
604 | if (!is_dir('cache/flattr')){ | 604 | if (!is_dir('cache/flattr')){ |
605 | mkdir('./cache/flattr', 0700); | 605 | mkdir('./cache/flattr', 0777); |
606 | } | 606 | } |
607 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache | 607 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache |
608 | if ((!file_exists("cache/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime("cache/flattr/".base64_encode($urltoflattr).".cache") > 86400)) | 608 | if ((!file_exists("cache/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime("cache/flattr/".base64_encode($urltoflattr).".cache") > 86400)) |
diff --git a/inc/poche/define.inc.php b/inc/poche/define.inc.php index 3f667430..62777282 100644 --- a/inc/poche/define.inc.php +++ b/inc/poche/define.inc.php | |||
@@ -20,8 +20,9 @@ define ('DEBUG_POCHE', FALSE); | |||
20 | define ('DOWNLOAD_PICTURES', FALSE); | 20 | define ('DOWNLOAD_PICTURES', FALSE); |
21 | define ('SHARE_TWITTER', TRUE); | 21 | define ('SHARE_TWITTER', TRUE); |
22 | define ('SHARE_MAIL', TRUE); | 22 | define ('SHARE_MAIL', TRUE); |
23 | define ('SHARE_SHAARLI', FALSE); | 23 | define ('SHARE_SHAARLI', TRUE); |
24 | define ('SHAARLI_URL', 'http://myshaarliurl.com'); | 24 | define ('SHAARLI_URL', 'http://myshaarliurl.com'); |
25 | define ('FLATTR', TRUE); | ||
25 | define ('ABS_PATH', 'assets/'); | 26 | define ('ABS_PATH', 'assets/'); |
26 | define ('TPL', __DIR__ . '/../../tpl'); | 27 | define ('TPL', __DIR__ . '/../../tpl'); |
27 | define ('LOCALE', __DIR__ . '/../../locale'); | 28 | define ('LOCALE', __DIR__ . '/../../locale'); |
diff --git a/tpl/css/style-light.css b/tpl/css/style-light.css index e2788a1c..224ef182 100644 --- a/tpl/css/style-light.css +++ b/tpl/css/style-light.css | |||
@@ -48,6 +48,10 @@ a.shaarli span { | |||
48 | background: url('../img/light/shaarli.png') no-repeat; | 48 | background: url('../img/light/shaarli.png') no-repeat; |
49 | } | 49 | } |
50 | 50 | ||
51 | a.flattr span { | ||
52 | background: url('../img/light/flattr.png'); | ||
53 | } | ||
54 | |||
51 | a.email span { | 55 | a.email span { |
52 | background: url('../img/light/envelop.png') no-repeat; | 56 | background: url('../img/light/envelop.png') no-repeat; |
53 | } | 57 | } |
diff --git a/tpl/img/light/flattr.png b/tpl/img/light/flattr.png new file mode 100644 index 00000000..d9007c0c --- /dev/null +++ b/tpl/img/light/flattr.png | |||
Binary files differ | |||
diff --git a/tpl/view.twig b/tpl/view.twig index c101db0a..283cfb5b 100644 --- a/tpl/view.twig +++ b/tpl/view.twig | |||
@@ -11,6 +11,7 @@ | |||
11 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %} | 11 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %} |
12 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} | 12 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} |
13 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} | 13 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} |
14 | {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %} | ||
14 | </ul> | 15 | </ul> |
15 | </div> | 16 | </div> |
16 | <header class="mbm"> | 17 | <header class="mbm"> |
@@ -31,7 +32,7 @@ | |||
31 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %} | 32 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %} |
32 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} | 33 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} |
33 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} | 34 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} |
34 | <li>{% if flattr.status == "flattrable" %} This thing is flattrable !{% elseif flattr.status == "flattred" %} <a href="{{ flattr.flattrItemURL }}" >This thing has already been flattred {{ flattr.numflattrs }} times and can be flattred !</a>{% else %}This article cannot be flattred{% endif %}</li> | 35 | {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %} |
35 | </ul> | 36 | </ul> |
36 | <p>{% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com?subject=Wrong%20display%20in%20poche&body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p> | 37 | <p>{% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com?subject=Wrong%20display%20in%20poche&body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p> |
37 | </div> | 38 | </div> |