]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fixed bugs, added a flattr button and an option 214/head
authorThomas Citharel <thomas.citharet@gmail.com>
Tue, 10 Sep 2013 16:23:56 +0000 (18:23 +0200)
committerThomas Citharel <thomas.citharet@gmail.com>
Tue, 10 Sep 2013 16:23:56 +0000 (18:23 +0200)
There's a button and an option in define.inc.php to show the button or
not.

inc/poche/Poche.class.php
inc/poche/define.inc.php
tpl/css/style-light.css
tpl/img/light/flattr.png [new file with mode: 0644]
tpl/view.twig

index 8b24e5cdcfa098d6cc86418bf31b6640a65076cf..b0efe69a673f9e8f4f241a7964a0bb5e78fbdb5e 100644 (file)
@@ -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))
index 3f66743076f5ef306e94fe0635d0ed7af7bc3535..62777282a34687d9c193e23c71e4c14d66af9cd3 100644 (file)
@@ -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');
index e2788a1ce05ebcac9c1570652548383d010d2891..224ef1829bbd638e20479353ef75040779e93944 100644 (file)
@@ -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 (file)
index 0000000..d9007c0
Binary files /dev/null and b/tpl/img/light/flattr.png differ
index c101db0ab692132f1e7d3bd6e1c8deeeabde3d56..283cfb5b5fdd19c2f06c01c91d57acfb110e7e6e 100644 (file)
@@ -11,6 +11,7 @@
                     {% 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 %}
                     {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
                     {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
+                    {% 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 %}
                 </ul>
             </div>
             <header class="mbm">
@@ -31,7 +32,7 @@
                     {% 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 %}
                     {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
                     {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
-                    <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>
+                    {% 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 %}
                 </ul>
                 <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&amp;body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p>
             </div>