View Full Version : $navbits[breadcrumb] edit
cagatayh
11-12-2011, 09:24 PM
With vbseo my categories are like that: http://yourforumsroot/#category_title
So I don't want to use category title in navbar.
I mean:
Not its like that:
vBulletin.org Forum / vBulletin 3 Discussion / vB3 General Discussions
What I want is:
vBulletin.org Forum / vB3 General Discussions
Which php file should i look at ?
Lynne
11-13-2011, 03:12 AM
Perhaps you want to look at the function contruct navbits in /includes/functions.php There is a hook in there that may be useful.
cagatayh
11-13-2011, 03:05 PM
I think there is nothing to do in this file.
/**
* 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;
}
Lynne
11-13-2011, 04:34 PM
There are two hooks in there, my guess is you want to write a plugin using the hook location navbits to set $skip_nav_entry to true in certain circumstances.
cagatayh
11-13-2011, 04:51 PM
Thanks
theksmith
04-17-2012, 12:37 PM
looks like the function is still the same in vbulletin 4, the following plugin should work in either 3.x or 4.x ...
hook location: "navbits"
if (in_array(THIS_SCRIPT, array('showthread'))) {
if ($counter == $lastelement-1) {
$elementtype = 'lastelement';
$show['breadcrumb'] = false;
} else if ($counter == $lastelement) {
$skip_nav_entry = true;
}
}
fxdigi-cash
04-20-2014, 12:02 PM
Thanks @theksmith (https://vborg.vbsupport.ru/member.php?u=341242)
This is what I was looking for...
it worked on vb4.x.x like a charm
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.