From: Thomas Citharel Date: Tue, 10 Sep 2013 16:23:56 +0000 (+0200) Subject: Fixed bugs, added a flattr button and an option X-Git-Tag: 1.0-beta5^2~28^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=964481d023676bee964141a1d14f638995ac8d30;p=github%2Fwallabag%2Fwallabag.git 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. --- 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{ private function cacheflattrfile($urltoflattr){ if (!is_dir('cache/flattr')){ - mkdir('./cache/flattr', 0700); + mkdir('./cache/flattr', 0777); } // 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 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); define ('DOWNLOAD_PICTURES', FALSE); define ('SHARE_TWITTER', TRUE); define ('SHARE_MAIL', TRUE); -define ('SHARE_SHAARLI', FALSE); +define ('SHARE_SHAARLI', TRUE); define ('SHAARLI_URL', 'http://myshaarliurl.com'); +define ('FLATTR', TRUE); define ('ABS_PATH', 'assets/'); define ('TPL', __DIR__ . '/../../tpl'); 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 { background: url('../img/light/shaarli.png') no-repeat; } +a.flattr span { + background: url('../img/light/flattr.png'); +} + a.email span { background: url('../img/light/envelop.png') no-repeat; } diff --git a/tpl/img/light/flattr.png b/tpl/img/light/flattr.png new file mode 100644 index 00000000..d9007c0c Binary files /dev/null and b/tpl/img/light/flattr.png 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 @@ {% if constant('SHARE_TWITTER') == 1 %}
  • {% endif %} {% if constant('SHARE_MAIL') == 1 %}
  • {% endif %} {% if constant('SHARE_SHAARLI') == 1 %}
  • {% trans "shaarli" %}
  • {% endif %} + {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}
  • flattr
  • {% elseif flattr.status == "flattred" %}
  • flattr{{ flattr.numflattrs }}
  • {% else %}{% endif %}{% endif %}
    @@ -31,7 +32,7 @@ {% if constant('SHARE_TWITTER') == 1 %}
  • {% endif %} {% if constant('SHARE_MAIL') == 1 %}
  • {% endif %} {% if constant('SHARE_SHAARLI') == 1 %}
  • {% trans "shaarli" %}
  • {% endif %} -
  • {% if flattr.status == "flattrable" %} This thing is flattrable !{% elseif flattr.status == "flattred" %} This thing has already been flattred {{ flattr.numflattrs }} times and can be flattred !{% else %}This article cannot be flattred{% endif %}
  • + {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}
  • flattr
  • {% elseif flattr.status == "flattred" %}
  • flattr{{ flattr.numflattrs }}
  • {% else %}{% endif %}{% endif %}

    {% trans "this article appears wrong?" %} {% trans "create an issue" %} {% trans "or" %} {% trans "contact us by mail" %}