vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   $navbits[breadcrumb] edit (https://vborg.vbsupport.ru/showthread.php?t=273912)

cagatayh 11-12-2011 09:24 PM

$navbits[breadcrumb] edit
 
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.


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


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"
PHP Code:

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

This is what I was looking for...

it worked on vb4.x.x like a charm


All times are GMT. The time now is 04:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01115 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete