#1 2005-01-04 00:10:12

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14087

navigation bar

Whiler wrote:

z0rglub, I tried your last BSF...

I really like the new function create_navigation_bar...

But personnally, I update it like this :

(To avoid stuff like : 1 ... 2 or    n-1 ... n)

Code:

#
#-----[ OPEN ]------------------------------------------
#
./include/functions_html.inc.php
#
#-----[ REPLACE ]------------------------------------------
#
    if ($cur_page > $pages_around + 1)
    {
      $navbar.= ' <a href="';
      $navbar.= add_session_id($url.'&amp;start=0');
      $navbar.= '" class="'.$link_class.'">1</a> ...';
    }
#
#-----[ WITH ]------------------------------------------
#
    if ($cur_page > $pages_around + 1)
    {
      $navbar.= ' <a href="';
      $navbar.= add_session_id($url.'&amp;start=0');
      $navbar.= '" class="'.$link_class.'">1</a>';
      if ($cur_page > $pages_around + 2) $navbar.= ' ...';
    }
#
#-----[ REPLACE ]------------------------------------------
#
    if ($cur_page < ($maximum - $pages_around))
    {
      $temp_start = ($maximum - 1) * $nb_element_page;
      $navbar.= ' ... <a href="';
      $navbar.= add_session_id($url.'&amp;start='.$temp_start);
      $navbar.= '" class="'.$link_class.'">'.$maximum.'</a>';
    }
#
#-----[ WITH ]------------------------------------------
#
    if ($cur_page < ($maximum - $pages_around))
    {
      $temp_start = ($maximum - 1) * $nb_element_page;
      if ($cur_page < ($maximum - $pages_around - 1)) $navbar.= ' ...';
      $navbar.= ' <a href="';
      $navbar.= add_session_id($url.'&amp;start='.$temp_start);
      $navbar.= '" class="'.$link_class.'">'.$maximum.'</a>';
    }
#
#-----[ SAVE/CLOSE THE FILE ]------------------------------------------
#

As usual, if you prefer to move/remove my post... feel free to do it... ;)

I moved your post to an appropriate topic.

You're right. I'll make the change :-)

(I'm currently working on the migration script from 1.3 branch...for next build in the week)

Offline

 

#2 2005-01-04 01:09:51

Whiler
Member
Clichy
2004-12-24
24

Re: navigation bar

z0rglub wrote:

You're right. I'll make the change :-)

(I'm currently working on the migration script from 1.3 branch...for next build in the week)

thx ;)

bon courage ;o)

Offline

 

Board footer

Powered by FluxBB