Customize the breadcrumb list
#4
Replace the existing build_forum_breadcrumbs function with this, see if it works:

function build_forum_breadcrumb($fid, $archive=0)
{
    global $pforumcache, $db, $currentitem, $forum_cache, $navbits, $lang, $base_url, $archiveurl;
if($archive)
{
    if(!$pforumcache)
    {
        if(!is_array($forum_cache))
        {
            cache_forums();
        }
        foreach($forum_cache as $key => $val)
        {
            $pforumcache[$val['fid']][$val['pid']] = $val;
        }
    }
    if(is_array($pforumcache[$fid]))
    {
        foreach($pforumcache[$fid] as $key => $forumnav)
        {
            if($fid == $forumnav['fid'])
            {
                if($pforumcache[$forumnav['pid']])
                {
                    build_forum_breadcrumb($forumnav['pid'], $archive);
                }
                $navsize = count($navbits);
                $navbits[$navsize]['name'] = $forumnav['name'];
                if($archive == 1)
                {
                    // Set up link to forum in breadcrumb.
                    if($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c')
                    {
                        $navbits[$navsize]['url'] = "{$base_url}forum-".$forumnav['fid'].".html";
                    }
                    else
                    {
                        $navbits[$navsize]['url'] = $archiveurl."/index.php";
                    }
                }
                else
                {
                    $navbits[$navsize]['url'] = "forumdisplay.php?fid=".$forumnav['fid'];
                }
            }
        }
    }
}
else
{
        if(!is_array($forum_cache))
        {
            cache_forums();
        }
                $navsize = count($navbits);
                $navbits[$navsize]['name'] = $forum_cache[$fid]['name'];
                    $navbits[$navsize]['url'] = "forumdisplay.php?fid=".$fid;
}
    return 1;
}
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
Reply


Messages In This Thread
Customize the breadcrumb list - by CCKitty - 2008-03-27, 08:59 PM
RE: Customize the breadcrumb list - by CCKitty - 2008-04-01, 07:39 PM
RE: Customize the breadcrumb list - by Dennis Tsang - 2008-04-03, 04:53 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)