1

Topic: navigation bar help!

im making some changes in my forum, but i cant figure out how to change the names of the links in the nav bar... ive tried to change in the lang file, but it doesent work.... i also checked the styles css sheet to see if there were anything there.. but no luck sad

anyone who can help me?

2

Re: navigation bar help!

noone? there must be someone who can help!

Re: navigation bar help!

should be in the language/../common.php file...

4

Re: navigation bar help!

ive changed it. didnt help..

5

Re: navigation bar help!

i also need to change the redictering. i want it to go from index.php to forum.php

6 (edited by KeyDog 2009-08-18 10:20)

Re: navigation bar help!

// Stuff for the navigator (top of every page)
'Index'                        =>    'Home',
'User list'                    =>    'User list',
'Rules'                        =>  'Rules',
'Search'                    =>  'Search',
'Register'                    =>  'Register',
'register'                    =>    'register',

I just changed mine in /lang/english/common.php and it showed immediately...
You say you can't do that?

http://punbb-b.keydogbb.info

7

Re: navigation bar help!

ive tried that... tried again now and named it something else.. it doesent work..

Re: navigation bar help!

maybe a cache problem
try installing this extension then uninstalling it...  then maybe you'll see the changes from common.php as it replaces navlinks...

just an idea...

9

Re: navigation bar help!

but eh.. how do you install it?

10

Re: navigation bar help!

what pun version are you even running? if not 1.3.x don't bother reading on big_smile

admin>extensions>    then find it on the list....

11

Re: navigation bar help!

hehe i dont use 1.3 tongue but how do i change the file index link goes to? if i can find that, i can live with it being named index tongue

12 (edited by KeyDog 2009-08-18 14:56)

Re: navigation bar help!

okey .... I just tried my method of just changing common.php in lang folder.... with a 1.2.x and it worked aswell.

Edit:

probably best bet is to change in functions.php

info on navlinks that might help:
http://punbb.informer.com/forums/topic/ … o-navlink/

you could also maybe search at punres.org for more help / mods for adding/changing links on navlinks bar...

13

Re: navigation bar help!

when i changed in functions.php it only changed in admin index...

14

Re: navigation bar help!

bump

15

Re: navigation bar help!

What code of functions.php did you changed?

16 (edited by darc 2009-08-20 08:26)

Re: navigation bar help!

i changed

$links[] = '<li id="navindex"><a href="index.php">'.$lang_common['index'].'</a>';

to

$links[] = '<li id="navindex"><a href="forum.php">'.$lang_common['forum'].'</a>';

from:

// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
    global $pun_config, $lang_common, $pun_user;

    // Index and Userlist should always be displayed
    $links[] = '<li id="navindex"><a href="forum.php">'.$lang_common['forum'].'</a>';
    $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';

17

Re: navigation bar help!

bump

18

Re: navigation bar help!

please, i need some help!

19

Re: navigation bar help!

Examine the code of <FORUM_ROOT>/include/functions.php (lines 280-305). In this piece of code the links are generated depending on user rights.

20

Re: navigation bar help!

// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
    global $pun_config, $lang_common, $pun_user;

    // Index and Userlist should always be displayed
    $links[] = '<li id="navindex"><a href="forum.php">'.$lang_common['index'].'</a>';
    $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';

    if ($pun_config['o_rules'] == '1')
        $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';

    if ($pun_user['is_guest'])
    {
        if ($pun_user['g_search'] == '1')
            $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';

        $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>';
        $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>';

        $info = $lang_common['Not logged in'];
    }
    else
    {
        if ($pun_user['g_id'] > PUN_MOD)
        {
            if ($pun_user['g_search'] == '1')
                $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';

            $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
            require(PUN_ROOT.'include/pms/functions_navlinks.php');
            $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
        }
        else
        {
            $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
            $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
            $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';
            require(PUN_ROOT.'include/pms/functions_navlinks.php');
            $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
        }

21

Re: navigation bar help!

Describe your problem in more detail, please. What order of links do you want to have?

22

Re: navigation bar help!

i want to change the index in navlink to Forum, and make it redirect to forum.php instead of index.php.

23 (edited by StevenBullen 2009-08-25 11:54)

Re: navigation bar help!

In functions.php change

    // Index and Userlist should always be displayed
    $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
    $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';

to

    // Index and Userlist should always be displayed
    $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
    $links[] = '<li id="navforum"><a href="forum.php">'.$lang_common['Forum'].'</a>';
    $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';

Then go to lang/English/common.php and find

// Stuff for the navigator (top of every page)
'Index'                    =>    'Index',

and replace with

// Stuff for the navigator (top of every page)
'Index'                    =>    'Index',
'Forum'                    =>    'Forum',

That should do as required... but be warned that doing this will make some things not work right. wink

You will need to change all the following files: delete.php, edit.php, moderate.php, post.php, viewforum.php, viewtopic.php,

<a href="index.php"><?php echo $lang_common['Index'] ?>

to this

<a href="forum.php"><?php echo $lang_common['Forum'] ?>

And also change the following file: header.php

if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))

to this

if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))

Any trouble let me know. wink

24

Re: navigation bar help!

thanks! will try as soon as i got time

25 (edited by StevenBullen 2009-08-25 12:59)

Re: navigation bar help!

@darc
Not a problem

@Slavok
Off-topic - Why did you not move this to the correct forum?