aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche
diff options
context:
space:
mode:
authorThomas Citharel <thomas.citharet@gmail.com>2013-09-08 21:52:01 +0200
committerThomas Citharel <thomas.citharet@gmail.com>2013-09-08 21:52:01 +0200
commitaf1d2792263d45c5ffea2e5485dd81bf59b7bded (patch)
tree1c0814b8929028fab0872a5f1f5b3ed4a0f1d779 /inc/poche
parenta32231274060ec2de453124117518458c4fa00df (diff)
downloadwallabag-af1d2792263d45c5ffea2e5485dd81bf59b7bded.tar.gz
wallabag-af1d2792263d45c5ffea2e5485dd81bf59b7bded.tar.zst
wallabag-af1d2792263d45c5ffea2e5485dd81bf59b7bded.zip
Fixed errors and changed source of flattrs
Fixed errors, and the number displayed is no longer the number of peope who has flattred an article, but the number of flattrs he has got.
Diffstat (limited to 'inc/poche')
-rw-r--r--inc/poche/Poche.class.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 5dab10df..8b24e5cd 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -249,20 +249,21 @@ class Poche
249 $content = $tidy->value; 249 $content = $tidy->value;
250 250
251 // flattr checking 251 // flattr checking
252 $flattr = new FlattrItem(); 252 $flattr = new FlattrItem();
253 $flattr->checkitem($entry['url']); 253 $flattr->checkitem($entry['url']);
254 254
255 $tpl_vars = array( 255 $tpl_vars = array(
256 'entry' => $entry, 256 'entry' => $entry,
257 'content' => $content, 257 'content' => $content,
258 'flattr' => $flattr, 258 'flattr' => $flattr
259 ); 259 );
260 }
260 } 261 }
261 else { 262 else {
262 Tools::logm('error in view call : entry is null'); 263 Tools::logm('error in view call : entry is null');
263 } 264 }
264 break; 265 break;
265 default: # home, favorites and archive views 266 default : // home, favorites and archive views
266 $entries = $this->store->getEntriesByView($view, $this->user->getId()); 267 $entries = $this->store->getEntriesByView($view, $this->user->getId());
267 $tpl_vars = array( 268 $tpl_vars = array(
268 'entries' => '', 269 'entries' => '',
@@ -577,7 +578,6 @@ class FlattrItem{
577 public function checkitem($urltoflattr){ 578 public function checkitem($urltoflattr){
578 $this->cacheflattrfile($urltoflattr); 579 $this->cacheflattrfile($urltoflattr);
579 $flattrResponse = file_get_contents("cache/flattr/".base64_encode($urltoflattr).".cache"); 580 $flattrResponse = file_get_contents("cache/flattr/".base64_encode($urltoflattr).".cache");
580 var_dump($flattrResponse);
581 if($flattrResponse != FALSE){ 581 if($flattrResponse != FALSE){
582 $result = json_decode($flattrResponse); 582 $result = json_decode($flattrResponse);
583 if (isset($result->message)){ 583 if (isset($result->message)){
@@ -588,7 +588,7 @@ class FlattrItem{
588 elseif ($result->link) { 588 elseif ($result->link) {
589 $this->status = "flattred"; 589 $this->status = "flattred";
590 $this->flattrItemURL = $result->link; 590 $this->flattrItemURL = $result->link;
591 $this->numflattrs = $result->flattrs_user_count; 591 $this->numflattrs = $result->flattrs;
592 } 592 }
593 else{ 593 else{
594 $this->status = "not flattrable"; 594 $this->status = "not flattrable";