aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-02-01 12:01:39 +0100
committerThomas Citharel <tcit@tcit.fr>2015-02-01 12:01:39 +0100
commit3831c1525ccc512e27309f2cd531f0beff8dc430 (patch)
treea9999a87fc5f9d389f892463e66d57690567b2bf /inc/poche/Poche.class.php
parentbc6f5a8086b331bf21cdfcac799788264d8cd3b2 (diff)
parent522841c77e8ace6045cb10f9387d514179d05aeb (diff)
downloadwallabag-3831c1525ccc512e27309f2cd531f0beff8dc430.tar.gz
wallabag-3831c1525ccc512e27309f2cd531f0beff8dc430.tar.zst
wallabag-3831c1525ccc512e27309f2cd531f0beff8dc430.zip
Merge pull request #964 from wallabag/randomarticle
implemented random button
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-xinc/poche/Poche.class.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 81a18c86..5b8e235f 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -337,6 +337,14 @@ class Poche
337 $this->messages->add('s', _('The tag has been successfully deleted')); 337 $this->messages->add('s', _('The tag has been successfully deleted'));
338 Tools::redirect(); 338 Tools::redirect();
339 break; 339 break;
340 /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */
341 case 'random':
342 $count = $this->store->getEntriesByViewCount($view, $this->user->getId());
343 $id = rand(1,$count);
344 Tools::logm('get a random article');
345 Tools::redirect('?view=view&id=' . $id);
346 //$this->displayView('view', $id);
347 break;
340 default: 348 default:
341 break; 349 break;
342 } 350 }