wie ändere ich das so das es im Header auch geht mit den Kategorien?
Code: Alles auswählen
//
// Create the personal board menu
$fixlinks = array();
include_once($phpbb_root_path . 'includes/functions_board_menu.'.$phpEx);
$bl_level_access = get_bllink_access();
$bl_fix = ( $bl_level_access == '' ) ? ' WHERE bl_fix = 1' : ' AND bl_fix = 1';
$sql = "SELECT * FROM " . BOARD_LINKS_TABLE . "
$bl_level_access
$bl_fix
ORDER BY bl_psort DESC";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read portal menu for user', '', __LINE__, __FILE__, $sql);
}
$ubl = '';
$ubs = '';
$i = 1;
$links_check = array();
if ( $userdata['profil_links'] != '' )
{
$link_check = explode(',', $userdata['profile_links']);
}
while ( $row = $db->sql_fetchrow($result) )
{
$fix_link_id = $row['bl_id'];
if ( !in_array($fix_link_id, $links_check) )
{
$ubl .= ( $ubl == '' ) ? ($row['bl_id']) : ',' . ($row['bl_id']);
$ubs .= ( $ubs == '' ) ? (0 - $i) : ',' . (0 - $i);
$i++;
}
}
$sql_cat = "SELECT * FROM " . BOARD_MENU_CAT_TABLE . "
ORDER BY cat_sort";
if ( !$result2 = $db->sql_query($sql_cat) )
{
message_die(GENERAL_ERROR, 'Could not read portal menu for user', '', __LINE__, __FILE__, $sql);
}
$portal_menu_links = '';
while ( $row2 = $db->sql_fetchrow($result2) )
{
$category = $row2['cat_name'];
$catname = $lang[$category];
$cat = $row2['cat_id'];
$show_catname = $row2['show_cat_name'];
$show_seperator = $row2['show_seperator'];
if ( $userdata['session_logged_in'] && $userdata['portal_links'] != '' )
{
$userdata['portal_links'] .= ( $ubl != '' ) ? ','.$ubl : '';
$userdata['portal_sort'] .= ( $ubs != '' ) ? ','.$ubs : '';
$pl_links = array();
$pl_sort = array();
$pl_links = explode(',', $userdata['portal_links']);
$pl_sort = explode(',', $userdata['portal_sort']);
array_multisort($pl_sort, SORT_DESC, $pl_links);
$sql_order = 'ORDER BY';
for ( $i = 0; $i < count($pl_links); $i++ )
{
$sql_order .= ( $sql_order == 'ORDER BY' ) ? ' bl_id = '.$pl_links[$i] : ', bl_id = '.$pl_links[$i];
}
$sql = "SELECT * FROM " . BOARD_LINKS_TABLE . " l, " . BOARD_MENU_MERGE_TABLE . " m
WHERE l.bl_id IN (".$userdata['portal_links'].")
AND l.bl_id = m.link_id
AND m.cat_id = $cat
$sql_order";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read portal menu for user', '', __LINE__, __FILE__, $sql);
}
}
else
{
$sql = "SELECT * FROM " . BOARD_LINKS_TABLE . " l, " . BOARD_MENU_MERGE_TABLE . " m
WHERE l.bl_level = " . ANONYMOUS . "
AND l.bl_id = m.link_id
AND m.cat_id = $cat
ORDER BY l.bl_psort, l.bl_id";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read portal menu for user', '', __LINE__, __FILE__, $sql);
}
}
if ( $count = $db->sql_numrows($result) )
{
$portal_menu_links .= ( $show_seperator == TRUE ) ? '<hr>' : '';
$portal_menu_links .= ( $show_catname == TRUE ) ? '<b>'.$catname.'</b><br />' : '';
$board_config['bl_seperator_content'] = str_replace('SPACE', ' ', $board_config['bl_seperator_content']);
$i = 0;
while ( $row = $db->sql_fetchrow($result) )
{
if (substr($row['bl_link'],0,10) != 'javascript')
{
$phpext = '.'.$phpEx;
$sidext = ( $row['bl_parameter'] != '' ) ? '&sid='.$userdata['session_id'] : '?sid='.$userdata['session_id'];
}
else
{
$phpext = '';
$sidext = '';
}
$portal_menu_links .= ( $board_config['bl_seperator'] == 1 ) ? '<img src="'.$board_config['bl_seperator_content'].'" border="0" /> ' : $board_config['bl_seperator_content'];
$portal_menu_links .= ( $row['bl_img'] != '' ) ? '<img src="'.get_bl_theme().$row['bl_img'].'" border="0" /> ' : '';
$portal_menu_links .= '<a href="'.$row[bl_link].$phpext.(( $row['bl_parameter'] != '') ? '?'.$row['bl_parameter'] : '').$sidext;
$portal_menu_links .= '" class="mainmenu" title="'.$lang[$row['bl_name']].'">'.$lang[$row['bl_name']].'</a>';
$portal_menu_links .= '<br />';
$i++;
}
}
}
$template->assign_vars(array(
'BOARD_MENU' => $portal_menu_links)
);
// Create the personal board menu
//