aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-xinc/poche/Poche.class.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 2a8037cc..3c7a2c5a 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -303,6 +303,14 @@ class Poche
303 $this->messages->add('s', _('The tag has been successfully deleted')); 303 $this->messages->add('s', _('The tag has been successfully deleted'));
304 Tools::redirect(); 304 Tools::redirect();
305 break; 305 break;
306 /* 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 */
307 case 'random':
308 $count = $this->store->getEntriesByViewCount($view, $this->user->getId());
309 $id = rand(1,$count);
310 Tools::logm('get a random article');
311 Tools::redirect('?view=view&id=' . $id);
312 //$this->displayView('view', $id);
313 break;
306 default: 314 default:
307 break; 315 break;
308 } 316 }
@@ -445,7 +453,6 @@ class Poche
445 $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id); 453 $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id);
446 $tpl_vars['page_links'] = $page_links; 454 $tpl_vars['page_links'] = $page_links;
447 $tpl_vars['nb_results'] = $count; 455 $tpl_vars['nb_results'] = $count;
448 $tpl_vars['random'] = rand(1,$count);
449 } 456 }
450 Tools::logm('display ' . $view . ' view'); 457 Tools::logm('display ' . $view . ' view');
451 break; 458 break;