PDA

View Full Version : Navbar question


wirewolf
12-27-2004, 07:55 PM
I've installed the " Users Can create their own drop down list in navbar " by Michael Morris over at vbull.org, and it's working great in my forum (Vb v 3.0.3), but not in my "Links Directory" (from vBadvanced v1.0.0 RC3).
See my post: http://www.vbulletin.org/forum/showpost.php?p=586576&postcount=30 and the two attachments. Some users over at vbull.org seem to be having similar problems with other vBadvanced scripts and the use of the regular vb navbar. They seem to think it has something to do with the PHPINCLUDE_START template (needed for the "My Links" mod to work) not being called on correctly or at all by the vBadvanced scripts, or it's in the area around line 398-// ### Construct Navbar ### section of the includes/functions_links.php file . This is no criticism of the links directory script or of Michael's mod. We're just trying to figure out what the hang up could be. I just figured you might have a clue.
Thanks for any help you can give,
John

wirewolf
12-28-2004, 11:10 AM
After looking again at the code again (after getting a nights sleep) I think I found the answer. In the code for includes/functions_links.php around line 398:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox; I added $mylinks to the one line:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox, $mylinks; The "My Links" now shows in the navbar when going to my "Links Directory" Pages. The only thing I'm not sure of is in the rest of the code in the Construct Navbar section:
if (!empty($navbits))
{
$navbits = construct_navbits($navbits);
}
eval('$navbar = "' . fetch_template('navbar') . '";');

$navbar = str_replace(
array(
'"memberlist.php',
'"usercp.php',
'"register.php',
'"faq.php',
'"calendar.php',
'"search.php',
'"login.php',
'"forumdisplay.php',
'"profile.php',
'"private.php',
'"subscription.php',
'"member.php',
'"online.php',
'"clientscript',
'\'misc.php',
$vboptions['bbtitle'],
'"' . $vboptions['forumhome'] . '.php'
),
array(
'"' . $vboptions['bburl'] . '/memberlist.php',
'"' . $vboptions['bburl'] . '/usercp.php',
'"' . $vboptions['bburl'] . '/register.php',
'"' . $vboptions['bburl'] . '/faq.php',
'"' . $vboptions['bburl'] . '/calendar.php',
'"' . $vboptions['bburl'] . '/search.php',
'"' . $vboptions['bburl'] . '/login.php',
'"' . $vboptions['bburl'] . '/forumdisplay.php',
'"' . $vboptions['bburl'] . '/profile.php',
'"' . $vboptions['bburl'] . '/private.php',
'"' . $vboptions['bburl'] . '/subscription.php',
'"' . $vboptions['bburl'] . '/member.php',
'"' . $vboptions['bburl'] . '/online.php',
'"' . $vboptions['bburl'] . '/clientscript',
'\'' . $vboptions['bburl'] . '/misc.php',
iif($vba_options['links_navbarhomelink'], $vboptions['hometitle'], $vba_options['links_title']),
'"' . iif($vba_options['links_navbarhomelink'], $vboptions['homeurl'], $vba_options['links_homeurl'])
), $navbar);
return $navbar;
}
}Would any changes have to be made in this section too?
John

Our Sponsors
 

Brian
12-28-2004, 11:30 AM
It depends on where the links in the 'My Links' section are linking to. I would assume that users are using the full URL when they add links to this section, in which case it wouldn't be necessary to add anything else.

wirewolf
12-28-2004, 11:54 AM
Thanks for the quick responce Brian.
Your right. My first two "My Links" test url's were full and they worked ok in the navbar (both forum and links directory). But after reading your reply, I tried it with this:
Post #474 , in the forum navbar it returns the full url -
http://shipmodeling.net/vb_forum/showthread.php?p=474#post474,
as expected. But in the navbar when you go to the links directory it returns this -
http://shipmodeling.net/vb_forum/links/showthread.php?p=474#post474
I guess there's no way around this in the coding. Either in your coding or in Michaels' Navbar "My Links" coding. I'll just instruct my members that they have to enter the full url in the text box. Most of them will most likely be putting in external urls anyway.
Thanks again,
John

Our Sponsors
 

Brian
12-28-2004, 11:57 AM
Try replacing that function with this:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox;

if (!empty($navbits))
{
$navbits = construct_navbits($navbits);
}
eval('$navbar = "' . fetch_template('navbar') . '";');

$navbar = str_replace(
array(
'"memberlist.php',
'"usercp.php',
'"register.php',
'"faq.php',
'"calendar.php',
'"search.php',
'"login.php',
'"forumdisplay.php',
'"profile.php',
'"private.php',
'"subscription.php',
'"member.php',
'"online.php',
'"clientscript',
'\'misc.php',
'"showthread.php',
$vboptions['bbtitle'],
'"' . $vboptions['forumhome'] . '.php'
),
array(
'"' . $vboptions['bburl'] . '/memberlist.php',
'"' . $vboptions['bburl'] . '/usercp.php',
'"' . $vboptions['bburl'] . '/register.php',
'"' . $vboptions['bburl'] . '/faq.php',
'"' . $vboptions['bburl'] . '/calendar.php',
'"' . $vboptions['bburl'] . '/search.php',
'"' . $vboptions['bburl'] . '/login.php',
'"' . $vboptions['bburl'] . '/forumdisplay.php',
'"' . $vboptions['bburl'] . '/profile.php',
'"' . $vboptions['bburl'] . '/private.php',
'"' . $vboptions['bburl'] . '/subscription.php',
'"' . $vboptions['bburl'] . '/member.php',
'"' . $vboptions['bburl'] . '/online.php',
'"' . $vboptions['bburl'] . '/clientscript',
'\'' . $vboptions['bburl'] . '/misc.php',
'"' . $vboptions['bburl'] . '/showthread.php',
iif($vba_options['links_navbarhomelink'], $vboptions['hometitle'], $vba_options['links_title']),
'"' . iif($vba_options['links_navbarhomelink'], $vboptions['homeurl'], $vba_options['links_homeurl'])
), $navbar);
return $navbar;
}
}

wirewolf
12-28-2004, 12:28 PM
Inserting the lines, '"showthread.php', and, '"' . $vboptions['bburl'] . '/showthread.php', worked. Still had to include the - $mylinks on the one line. But you know what. Some of my users would like to include a link to their photo gallery (Photopost) among others. A lot of the users have trouble enough with using bbcodes. It will probally be easier for them to include the full url in the first place. Easier for me to explain it to them too.
Thanks Brian. I'll keep that code fix in mind for the future.
Have a Happy and Healthy New Year!
John