Topic: Change navlinks order in navbar

Hi,
I searched through every topic related to punbb 1.4 and couldn't find an answer, so I decided to register and ask for some help.

As it is my first post, I want to thank the creators and the community of punbb, it's the best forum system I could find with such a functionalities/lightweight ratio.

Now, here's my issue:
I made an installation of punbb for a friend of mine. He's as satisfied as I am with it. He asked me some adjustments I could made within the Administration panel or by tweaking a little the locales files. But recently, he asked me one thing I couldn't figure out: he wants me, if possible, to invert the positions of "Search" and "User list" navlinks. That's a tiny detail, he told me it would be OK if I couldn't find how to do such a thing, but I still want to ask the question: is it possible? If it is, what would be the trick without messing up the code, as I'm not really at ease with writing code (I can copy, paste, re-order some expressions if told me with precision, but I can't interpret it and identify what's wrong if I make a mistake). The best I could do with handling some PHP code was this tweak, and, yes, I'm proud of it big_smile

Thanks for any answer I may receive smile

2

Re: Change navlinks order in navbar

Open includes/functions.php

FIND:

    // Index should always be displayed
    $links['index'] = '<li id="navindex"'.((FORUM_PAGE == 'index') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['index']).'">'.$lang_common['Index'].'</a></li>';

    if ($forum_user['g_read_board'] == '1' && $forum_user['g_view_users'] == '1')
        $links['userlist'] = '<li id="navuserlist"'.((FORUM_PAGE == 'userlist') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['users']).'">'.$lang_common['User list'].'</a></li>';

    if ($forum_config['o_rules'] == '1' && (!$forum_user['is_guest'] || $forum_user['g_read_board'] == '1' || $forum_config['o_regs_allow'] == '1'))
        $links['rules'] = '<li id="navrules"'.((FORUM_PAGE == 'rules') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['rules']).'">'.$lang_common['Rules'].'</a></li>';

    if ($forum_user['is_guest'])
    {
        if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
            $links['search'] = '<li id="navsearch"'.((FORUM_PAGE == 'search') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['search']).'">'.$lang_common['Search'].'</a></li>';

        $links['register'] = '<li id="navregister"'.((FORUM_PAGE == 'register') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['register']).'">'.$lang_common['Register'].'</a></li>';
        $links['login'] = '<li id="navlogin"'.((FORUM_PAGE == 'login') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['login']).'">'.$lang_common['Login'].'</a></li>';
    }

REPLACE WITH:

    // Index should always be displayed
    $links['index'] = '<li id="navindex"'.((FORUM_PAGE == 'index') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['index']).'">'.$lang_common['Index'].'</a></li>';

    if ($forum_config['o_rules'] == '1' && (!$forum_user['is_guest'] || $forum_user['g_read_board'] == '1' || $forum_config['o_regs_allow'] == '1'))
        $links['rules'] = '<li id="navrules"'.((FORUM_PAGE == 'rules') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['rules']).'">'.$lang_common['Rules'].'</a></li>';

    if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
        $links['search'] = '<li id="navsearch"'.((FORUM_PAGE == 'search') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['search']).'">'.$lang_common['Search'].'</a></li>';
    
    if ($forum_user['g_read_board'] == '1' && $forum_user['g_view_users'] == '1')
        $links['userlist'] = '<li id="navuserlist"'.((FORUM_PAGE == 'userlist') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['users']).'">'.$lang_common['User list'].'</a></li>';        
    if ($forum_user['is_guest'])
    {
        $links['register'] = '<li id="navregister"'.((FORUM_PAGE == 'register') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['register']).'">'.$lang_common['Register'].'</a></li>';
        $links['login'] = '<li id="navlogin"'.((FORUM_PAGE == 'login') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['login']).'">'.$lang_common['Login'].'</a></li>';
    }

I don't remember what I've edited and have no time to compare both files, so I've gived you "bigger" code. But don't worry. Everything should be OK smile.

Re: Change navlinks order in navbar

Just done. Perfectly working! Many thanks, Trace, I appreciate your help.