Topic: Adding more links to top
I wanna know that how to add more links to top of the forums. I mean that place where is all "User list", "Rules", "Search" etc. Example link "Downloads" which go to myserv.com/downloads/index.php
You are not logged in. Please login or register.
PunBB Forums → Feature requests → Adding more links to top
I wanna know that how to add more links to top of the forums. I mean that place where is all "User list", "Rules", "Search" etc. Example link "Downloads" which go to myserv.com/downloads/index.php
look for the Additional Menu items in admin options (v1.2.1 only)
Sorry, I didn't say that I use punBB1.1.5
I tried to update it to 1.2, but when I runned updater file, it destroyed my mySQL database.
So I wanna keep 1.1.5, help?
you need to edit the function generate_navlinks in functions.php
I doubt the 1.2 update script "destroyed" your database. What happened?
I runned updater, then when I tried go to forums, I got msg "mySQL error" or something like that.
But anyway, I got backup from mySQL db so..
Someone know that how to add more links to the top ( with punBB 1.1.5 ) ?
Have you installed any mods or anything that might have changed the database? What was the MySQL error? I'm sure it can be fixed rather easily.
I have installed 3 mods.
Private msg system for 1.1.5
Colouring usernames for 1.1.5
And Multigroup mod for 1.1.5
None of that working. Private msg system didn't make link "Messages" to the top. All mods said "installed successfully" but they didn't make multigroups or colour usernames.
But anyway, dont mind, I still wanna know that how to add links to the top.. ?
you need to edit the function generate_navlinks in functions.php
Hmm what I need to edit in there?
Can you help me, what I do if I wanna link "Downloads" to the top?
look for this. this is a STOCK UNTOUCHED version of the code in question in functions.php file in punbb 1.1.5:
//
// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
global $pun_config, $lang_common, $cookie, $cur_user;
// Home and Userlist should always be displayed
$links[] = '<a href="index.php">'.$lang_common['Home'].'</a> | <a href="userlist.php">'.$lang_common['User list'].'</a>';
if ($pun_config['o_rules'] == '1')
$links[] = '<a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
if ($cookie['is_guest'])
{
if ($pun_config['o_search'] == '1' && $pun_config['p_guests_search'] == '1')
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="register.php">'.$lang_common['Register'].'</a> | <a href="login.php">'.$lang_common['Login'].'</a>';
$info = $lang_common['Not logged in'];
}
else
{
if ($cur_user['status'] < PUN_MOD)
{
if ($pun_config['o_search'] == '1')
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="profile.php?id='.$cur_user['id'].'">'.$lang_common['Profile'].'</a>';
$links[] = '<a href="login.php?action=out">'.$lang_common['Logout'].'</a>';
}
else
{
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="profile.php?id='.$cur_user['id'].'">'.$lang_common['Profile'].'</a>';
$links[] = '<a href="admin_index.php">'.$lang_common['Admin'].'</a>';
$links[] = '<a href="login.php?action=out">'.$lang_common['Logout'].'</a>';
}
}
return implode(' | ', $links);
}
you will need to edit this section to add you own links to the list.
Didn't work:
//
// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
global $pun_config, $lang_common, $cookie, $cur_user;
// Home and Userlist should always be displayed
$links[] = '<a href="index.php">'.$lang_common['Home'].'</a> | <a href="userlist.php">'.$lang_common['User list'].'</a> | <a href="downloads/index.php">'.$lang_common['Downloads'].'</a>';
if ($pun_config['o_rules'] == '1')
$links[] = '<a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
if ($cookie['is_guest'])
{
if ($pun_config['o_search'] == '1' && $pun_config['p_guests_search'] == '1')
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="register.php">'.$lang_common['Register'].'</a> | <a href="login.php">'.$lang_common['Login'].'</a>';
$info = $lang_common['Not logged in'];
}
else
{
if ($cur_user['status'] < PUN_MOD)
{
if ($pun_config['o_search'] == '1')
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="profile.php?id='.$cur_user['id'].'">'.$lang_common['Profile'].'</a>';
$links[] = '<a href="login.php?action=out">'.$lang_common['Logout'].'</a>';
}
else
{
$links[] = '<a href="search.php">'.$lang_common['Search'].'</a>';
$links[] = '<a href="profile.php?id='.$cur_user['id'].'">'.$lang_common['Profile'].'</a>';
$links[] = '<a href="admin_index.php">'.$lang_common['Admin'].'</a>';
$links[] = '<a href="login.php?action=out">'.$lang_common['Logout'].'</a>';
}
}
return implode(' | ', $links);
}
if he is to use
$lang_common['Downloads'].
someone please correct me if i'm wrong but shouldn't he have to add "downloads" to this list(in \lang\en\en_common.php)?
// Stuff for the navigator (top of every page)
'Home' => 'Home',
'User list' => 'User list',
'Rules' => 'Rules',
'Search' => 'Search',
'Register' => 'Register',
'Login' => 'Login',
'Not logged in' => 'You are not logged in.',
'Profile' => 'Profile',
'Logout' => 'Logout',
'Logged in as' => 'Logged in as',
'Admin' => 'Admin',
'Last visit' => 'Last visit',
yeh, but isntead of using $lang_common['Downloads'] just use Downloads
PunBB Forums → Feature requests → Adding more links to top
Powered by PunBB, supported by Informer Technologies, Inc.