added reload icon and fixed a bug where random could redirect to deleted articles

This commit is contained in:
Thomas Citharel 2015-02-01 12:22:14 +01:00
parent d4b6e20e2f
commit 89637c2a1d
2 changed files with 9 additions and 3 deletions

View file

@ -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);

View file

@ -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";
}