diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5b8e235f1..f99281458 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -337,10 +337,23 @@ class Poche $this->messages->add('s', _('The tag has been successfully deleted')); Tools::redirect(); break; + + case 'reload_article' : + Tools::logm('reload article'); + $id = $_GET['id']; + $entry = $this->store->retrieveOneById($id, $this->user->getId()); + Tools::logm('reload url ' . $entry['url']); + $url = new Url(base64_encode($entry['url'])); + $this->action('add', $url); + break; + /* 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/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index a159e713c..aaaf12a66 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php @@ -62,6 +62,7 @@ @define ('SHOW_PRINTLINK', '1'); // display or not percent of read in article view. Affects only default theme. @define ('SHOW_READPERCENT', '1'); +@define ('RELOAD_ARTICLE', TRUE); @define ('ABS_PATH', 'assets/'); @define ('DEFAULT_THEME', 'baggy'); diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 9356deda9..90d546fcd 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"; } diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index 1afd9df6a..0a8380ded 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig @@ -19,6 +19,7 @@ {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}