From 89637c2a1dcc114b17a8f7eef493b51315e1a6ac Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 1 Feb 2015 12:22:14 +0100 Subject: [PATCH] added reload icon and fixed a bug where random could redirect to deleted articles --- inc/poche/Poche.class.php | 7 +++++-- themes/baggy/css/main.css | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index fb74ab9a..f9928145 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -349,8 +349,11 @@ class Poche /* 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 */ case 'random': - $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); - $id = rand(1,$count); + $id = 0; + while ($this->store->retrieveOneById($id,$this->user->getId()) == null) { + $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); + $id = rand(1,$count); + } Tools::logm('get a random article'); Tools::redirect('?view=view&id=' . $id); //$this->displayView('view', $id); diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 9356deda..90d546fc 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css @@ -737,7 +737,10 @@ a.add-to-wallabag-link-after:after { content: "\e80d"; } .icon-random:before { - content: "\e915"; + content: "\e915"; +} +.icon-reload:before { + content: "\ea2e"; } -- 2.41.0