1

Topic: help intergrating

ok heres what i want to do.
i want to have my main site links work so that if you are not logged into the forum then some of the links wont work.
you need to be logged into forum for the links to work.

any help is appriciated.

Re: help intergrating

If you play with this code in the /include/functions.php... should find what u r looking for...

//
// 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="index.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>';
            $links[] = '<li id="navlogout"><a href="login.php?action=out&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>';
            $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
        }
    }

    // Are there any additional navlinks we should insert into the array before imploding it?
    if ($pun_config['o_additional_navlinks'] != '')
    {
        if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))
        {
            // Insert any additional links into the $links array (at the correct index)
            for ($i = 0; $i < count($extra_links[1]); ++$i)
                array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
        }
    }

    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>';
}

What links would you like disabled until they r logged in??
Plus... This wont help with any additional links you may have added through the admin options.

Re: help intergrating

Mark wrote:

I want to have my main site links work so that if you are not logged into the forum then some of the links wont work.
you need to be logged into forum for the links to work.

Could you possibly clarify?
Because above is for just the PunBB main site links. If you require external links from your home page to do the same (i.e. not PunBB links) then let me know.

4

Re: help intergrating

i wish to have links on my home page the link to another place in my web site (not forum) and i want to have like the forum uses to have it so users must login to access certain parts of the site.

5

Re: help intergrating

someone gimmie a hint?

6

Re: help intergrating

http://punbb.org/docs/dev.html#integration

Then on your homepage you can have a simple...

<?php

   if ($pun_user['is_guest'])
    {
    nbsp
    }
    else
    {
    links
    }

?>

7

Re: help intergrating

it dont work sad