Ho chiesto un pò in giro e il codice relativo alla breadcrumb è il seguente:
Codice: Seleziona tutto
if($navmenu_enable)
{
if(isset($template->_tpldata['navlinks']) && isset($template->_tpldata['jumpbox_forums']) && (count($template->_tpldata['jumpbox_forums']) > 1)) {
$breadcrumb_popup = '';
$navlinks_data = &$template->_tpldata['navlinks'];
$tree = build_jumpbox_tree($template->_tpldata['jumpbox_forums']);
$parents = array();
foreach ($navlinks_data as $crumb)
{
$parents[] = $crumb['FORUM_ID'];
}
foreach ($navlinks_data as $level => &$crumb)
{
$breadcrumb_popup = '<div class="nav-popup"><ul>';
$breadcrumb_popup .= generate_advanced_breadcrumb($tree, $crumb['FORUM_ID'], $level, $parents);
$breadcrumb_popup .= '</ul></div>';
$crumb['POPUP'] = $breadcrumb_popup;
}
}
}
/* Generate a forum array tree, based on an unordered array like the jumpbox data */
function build_jumpbox_tree($list) {
$tree = $parent_memory = array();
$prev_id = $prev_level = 0;
foreach($list as $item => $vars) {
$forum_id = $vars['FORUM_ID'];
$level = (isset($vars['level']) && is_array($vars['level'])) ? count($vars['level']) : 0;
if ($level == 0) {
$parent_memory = array(0);
} elseif ($level > $prev_level) {
$parent_memory[$level] = $prev_id;
} elseif ($level < $prev_level) {
unset($parent_memory[$prev_level]);
unset($parent_memory[$prev_level + 1]); // clean up
unset($parent_memory[$prev_level + 2]); // clean up
}
$current = (isset($vars['SELECTED']) && !empty($vars['SELECTED']) ? true : false);
$values = array('parent_id' => $parent_memory[$level], 'level' => $level, 'forum_name' => $vars['FORUM_NAME'], 'current' => $current);
switch($level) {
case 0:
$tree[$forum_id] = $values;
break;
case 1:
$tree[$parent_memory[$level]]['children'][$forum_id] = $values;
break;
case 2:
$tree[$parent_memory[$level-1]]['children'][$parent_memory[$level]]['children'][$forum_id] = $values;
break;
case 3:
$tree[$parent_memory[$level-2]]['children'][$parent_memory[$level-1]]['children'][$parent_memory[$level]]['children'][$forum_id] = $values;
break;
}
$prev_id = $forum_id;
$prev_level = $level;
}
unset($tree[-1]);
return $tree;
}
/* Generates menu blocks based on the forum array tree, to use for popup menus */
function generate_advanced_breadcrumb($tree, $crumb_current, $crumb_level = 0, $parents = array()) {
$link = './viewforum.php?f=';
$html = $childhtml = '';
foreach ($tree as $id => $vars)
{
/*if (($crumb_level > $vars['level']) && $crumb_level !== 0)
{
continue;
}*/
if (isset($vars['children'])) {
$childhtml = generate_advanced_breadcrumb($vars['children'], $crumb_current, $crumb_level, $parents);
} else {
$childhtml = '';
}
$parent_id = $vars['parent_id'];
$level = $vars['level'];
if (($crumb_level <= $vars['level'] && in_array($parent_id, $parents)) || $crumb_level == 0)
{
$class = (!empty($childhtml)) ? 'children' : '';
$class .= ($vars['current'] == true || $id == $crumb_current) ? ' current' : '';
$html .= '<li' . ((!empty($class)) ? (' class="' . $class . '">') : ('>'));
$html .= '<a href="' . $link . $id .'">' . $vars['forum_name'] . '</a>';
if (!empty($childhtml)) {
$html .= '<div class="fly-out"><ul>';
$html .= $childhtml;
$html .= '</ul></div>';
}
$html .= "</li>\n";
} else {
$html .= $childhtml;
}
}
return $html;
}
ho notato che a un certo punto punto compare
penso che l'inghippo sia qui...suggerimenti?