1 (edited by mello757 2009-07-27 01:27)

Topic: Question about Navlinks section

I'm trying to add "|" inbetween my navlinks.

It looks like this right now...

    Index   User list   Search   Profile   Administration   Messages   Logout

I want it to look like this...

   Index | User list | Search | Profile | Administration | Messages | Logout

I'm thinking that I have to edit functions.php because that is where the navlinks bar is created.

        {
            $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>';
            $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&id='.$pun_user['id'].'&csrf_token='.sha1($pun_user['id'].sha1(get_remote_address())).'">'.$lang_common['Logout'].'</a>';
        }

I'm not sure what to put in there to make the desired output. I've been trying to put in...

.$lang_topic['Link separator'].

But I can't figure out where to put it so that it works. That's what is used in the viewtopic page for the "report | delete | edit | quote" section.

Am I on the right track?

Re: Question about Navlinks section

It's $lang_common, not $lang_topic.

Re: Question about Navlinks section

I have this entry in my topic.php language file.

'Link separator'            =>    ' | ',    // The text that separates links in posts (website, e-mail, report, edit etc.)

I don't see anything referring to the ' | ' in my common.php language file. Plus I have no idea how to put it in to the code without causing errors.

Re: Question about Navlinks section

http://punbb.informer.com/trac/browser/ … s.php#L320

5 (edited by mello757 2009-07-27 16:27)

Re: Question about Navlinks section

I know what you are saying. I know that each of the "words" at the top of the navlink are in lang_common. The code I put in the OP is the code I have NOW. I want to ADD (put into) to that code. I want to put a "|" in between those words. That "|" symbol is a 'Link separator' and it resides in the topic language file.

Repeating the original post:

What the navlinks bar looks like NOW:

    Index   User list   Search   Profile   Administration   Messages   Logout

What I WANT it it look like:

   Index | User list | Search | Profile | Administration | Messages | Logout

Does anyone know what I'm talking about?

Re: Question about Navlinks section

Show me your entire function. I'll fix whatever you're talking about.

Re: Question about Navlinks section

That's the whole point...nothing is broken. I want to ADD to what is already there.

This what I have in the functions.php that creates my NAVLINKS

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

    if ($pun_user['is_guest'])
    {
        if ($pun_user['g_search'] == '1')
        $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="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
            $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';
            $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&id='.$pun_user['id'].'&csrf_token='.sha1($pun_user['id'].sha1(get_remote_address())).'">'.$lang_common['Logout'].'</a>';
        }
        else
        {
            $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>';
            $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&id='.$pun_user['id'].'&csrf_token='.sha1($pun_user['id'].sha1(get_remote_address())).'">'.$lang_common['Logout'].'</a>';
        }
    }

My navlinks bar looks like this...

    Index   User list   Search   Profile   Administration   Messages   Logout

I want it to look like this...

   Index | User list | Search | Profile | Administration | Messages | Logout

Re: Question about Navlinks section

That function is not returning anything.

Use this?

    return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';

That should add the " | ", if it's set in $lang_common (lang/English/common.php).

Re: Question about Navlinks section

Where in the code do I put that? after it?

10

Re: Question about Navlinks section

Just before the final }.

Re: Question about Navlinks section

Thanks very much guys. That was the trick. But unfortunately it just doesn't look right. There seems to be a space (gap) in between the words. I can't get the desired effect.

Instead of this...

      Index | User list | Search | Profile | Administration | Messages | Logout

It looks like this...

      Index |    User list |    Search |    Profile |    Administration |    Messages |    Logout

I think I'll just bail on the idea.

12

Re: Question about Navlinks section

It's the CSS margin.