View Full Version : Help with $navbits[lastelement] and $navbits
ForumsMods
10-11-2008, 08:10 PM
I need put $navbits[lastelement] and $navbits in header, How i can do it??
Dismounted
10-12-2008, 05:17 AM
The header template is already evaluated before $navbits is initialised.
ForumsMods
10-12-2008, 01:05 PM
And there is any way that It can do?
I found this code:
// ################################################## ###########################
/**
* Returns the HTML for the navigation breadcrumb in the navbar
*
* This function will also set the GLOBAL $pagetitle to equal whatever is the last item in the navbits
*
* @param array Array of link => title pairs from which to build the link chain
*
* @return string
*/
function construct_navbits($nav_array)
{
global $pagetitle, $stylevar, $vbulletin, $vbphrase, $show;
$code = array(
'breadcrumb' => '',
'lastelement' => ''
);
$lastelement = sizeof($nav_array);
$counter = 0;
if (is_array($nav_array))
{
foreach($nav_array AS $nav_url => $nav_title)
{
$pagetitle = $nav_title;
$elementtype = (++$counter == $lastelement) ? 'lastelement' : 'breadcrumb';
$show['breadcrumb'] = ($elementtype == 'breadcrumb');
if (empty($nav_title))
{
continue;
}
$skip_nav_entry = false;
($hook = vBulletinHook::fetch_hook('navbits')) ? eval($hook) : false;
if ($skip_nav_entry)
{
continue;
}
eval('$code["$elementtype"] .= "' . fetch_template('navbar_link') . '";');
}
}
($hook = vBulletinHook::fetch_hook('navbits_complete')) ? eval($hook) : false;
return $code;
}
I think it may be useful
Dismounted
10-13-2008, 06:01 AM
That function is used to compile the navbits from an array of breadcrumb elements - this array does not exist, or is not complete, when the header is evaluated.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.