vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with $navbits[lastelement] and $navbits (https://vborg.vbsupport.ru/showthread.php?t=193377)

ForumsMods 10-11-2008 07:10 PM

Help with $navbits[lastelement] and $navbits
 
I need put $navbits[lastelement] and $navbits in header, How i can do it??

Dismounted 10-12-2008 04:17 AM

The header template is already evaluated before $navbits is initialised.

ForumsMods 10-12-2008 12:05 PM

And there is any way that It can do?
I found this code:
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 05: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.


All times are GMT. The time now is 02:40 AM.

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.04380 seconds
  • Memory Usage 1,714KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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