diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5dab10d..8b24e5c 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -249,20 +249,21 @@ class Poche $content = $tidy->value; // flattr checking - $flattr = new FlattrItem(); - $flattr->checkitem($entry['url']); + $flattr = new FlattrItem(); + $flattr->checkitem($entry['url']); - $tpl_vars = array( + $tpl_vars = array( 'entry' => $entry, 'content' => $content, - 'flattr' => $flattr, - ); + 'flattr' => $flattr + ); + } } else { Tools::logm('error in view call : entry is null'); } break; - default: # home, favorites and archive views + default : // home, favorites and archive views $entries = $this->store->getEntriesByView($view, $this->user->getId()); $tpl_vars = array( 'entries' => '', @@ -577,7 +578,6 @@ class FlattrItem{ public function checkitem($urltoflattr){ $this->cacheflattrfile($urltoflattr); $flattrResponse = file_get_contents("cache/flattr/".base64_encode($urltoflattr).".cache"); - var_dump($flattrResponse); if($flattrResponse != FALSE){ $result = json_decode($flattrResponse); if (isset($result->message)){ @@ -588,7 +588,7 @@ class FlattrItem{ elseif ($result->link) { $this->status = "flattred"; $this->flattrItemURL = $result->link; - $this->numflattrs = $result->flattrs_user_count; + $this->numflattrs = $result->flattrs; } else{ $this->status = "not flattrable"; diff --git a/tpl/view.twig b/tpl/view.twig index 7b15c7c..c101db0 100644 --- a/tpl/view.twig +++ b/tpl/view.twig @@ -31,7 +31,7 @@ {% if constant('SHARE_TWITTER') == 1 %}
  • {% trans "tweet" %}
  • {% endif %} {% if constant('SHARE_MAIL') == 1 %}
  • {% trans "email" %}
  • {% 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 by {{ flattr.numflattrs }} users and can be flattred !{% else %}This article cannot be flattred{% 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 %}
  • {% trans "this article appears wrong?" %} {% trans "create an issue" %} {% trans "or" %} {% trans "contact us by mail" %}