From: x2003bruneau Date: Sun, 21 Jan 2007 10:36:58 +0000 (+0000) Subject: Do not show broken marketing link on the public profile X-Git-Tag: xorg/0.9.13~99 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a6735b65f3b060a836b6fc56bbc823ce4017d100;p=platal.git Do not show broken marketing link on the public profile git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1372 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/search/search.inc.php b/modules/search/search.inc.php index 97bbe7b..f0bf810 100644 --- a/modules/search/search.inc.php +++ b/modules/search/search.inc.php @@ -133,7 +133,7 @@ class XOrgSearch extends XOrgPlugin function show() { $this->setAuth(); - global $page; + global $page, $globals; $offset = intval($this->get_value('offset')); $tab = @$this->orders[$this->get_value('order')]; @@ -149,20 +149,20 @@ class XOrgSearch extends XOrgPlugin list($list, $total) = call_user_func($this->_callback, $offset, $this->limit, $sql_order); - $page_max = intval(($total-1)/$this->limit); + $page_max = intval(($total-1)/$this->limit); if(!S::logged() && $page_max > $globals->search->public_max) $page_max = $globals->search->public_max; - $links = Array(); - if ($offset) { - $links[] = Array('u'=> $this->make_url(Array('offset'=>$offset-1)), 'i' => $offset-1, 'text' => 'précédent'); - } - for ($i = 0; $i <= $page_max ; $i++) { - $links[] = Array('u'=>$this->make_url(Array('offset'=>$i)), 'i' => $i, 'text' => $i+1); + $links = Array(); + if ($offset) { + $links[] = Array('u'=> $this->make_url(Array('offset'=>$offset-1)), 'i' => $offset-1, 'text' => 'précédent'); + } + for ($i = 0; $i <= $page_max ; $i++) { + $links[] = Array('u'=>$this->make_url(Array('offset'=>$i)), 'i' => $i, 'text' => $i+1); } - if ($offset < $page_max) { - $links[] = Array ('u' => $this->make_url(Array('offset'=>$offset+1)), 'i' => $offset+1, 'text' => 'suivant'); - } + if ($offset < $page_max) { + $links[] = Array ('u' => $this->make_url(Array('offset'=>$offset+1)), 'i' => $offset+1, 'text' => 'suivant'); + } $page->assign('search_results', $list); $page->assign('search_results_nb', $total);