Hallo,

kann mir jemand helfen das obere Menü so anzupassen,
dass es so dargestellt wir wie das untere Menü?
Das Script kommt von einer CMS "Xoops"
Ich habe schwierigkeiten damit die Datenbankabfragen in
dem Menü und dem Javascript einzubauen....


-----------------------------------------------------


Menü ohne klappbare Sublinks
So sieht das Grundmenü aus:

PHP-Code:
function b_easyweb_show1($options){
  global 
$db$xoopsConfig$xoopsModule$xoopsUser,$REQUEST_URI,$QUERY_STRING$PHP_SELF;
  include_once(
XOOPS_ROOT_PATH."/class/xoopsgroup.php");
  if ( 
$xoopsUser )
  {
  
$groeps $xoopsUser->groups();
  } else {
  
$groeps 0;
  }
  
$block = array();
  
$block['title'] = _EASYWEB_TITLE;
  
$block['content'] = "";
  
$content '';
  
$sublinks = array();
  
$result1 $db->query("select easyid,easyname,weight,isactive from ".$db->prefix("easyweb")." WHERE isactive=1 ORDER BY weight ASC");
  while ( list(
$easyid,$easyname,$weight,$isactive) = $db->fetch_row($result1) ) {
  
$result3 $db->query("select artid from ".$db->prefix("eascont")." WHERE easyid=$easyid");
  list(
$artid) = $db->fetch_row($result3);
  if(!
$artid){
  }else{
  
$content .= "<div><b>$easyname</b></div>";
  
$result2 $db->query("select artid,easyid,title,url_title,isactive from ".$db->prefix("eascont")." WHERE isactive=1 and easyid=$easyid ORDER BY weight ASC");
  while ( list(
$artid,$easyid,$title,$url_title,$isactive) = $db->fetch_row($result2) ) {
  
$content .= "&nbsp;<strong><big>&middot;</big></strong>&nbsp;<a href='".$xoopsConfig['xoops_url']."/modules/easyweb/index.php?artid=$artid'>$url_title</a><br />";
  }
  }
  }
  
$block['content'] = $content;
  return 
$block;

-----------------------------------------------------------

Menü mit klappbaren Sublinks
So wie dieses Menü soll es das vorherige aussehen:


PHP-Code:
function b_system_main_dynshow() {
global 
$db$xoopsUser$xoopsModule;

$groups   = array();
$block    = array();
$sublinks = array();
$subcont  = array();
$groups   $xoopsUser $xoopsUser->groups() : XoopsGroup::getByType('Anonymous');

$block['title']   = _MB_SYSTEM_MMENU;
$block['content'] = "
<script type='text/javascript'>
function toggle_dynmenu(id)  {
    if (xoopsGetElementById(id + '_sub')) {
        var dom = xoopsGetElementById(id + '_sub').style.display;
        if (dom == 'none') {
            xoopsGetElementById(id + '_sub').style.display = 'inline';
            xoopsGetElementById(id + '_sign').src   = '"
.XOOPS_URL."/images/menu/minus.gif';
            xoopsGetElementById(id + '_folder').src = '"
.XOOPS_URL."/images/menu/tree_open.gif';
            } else if (dom == 'inline') {
                xoopsGetElementById(id + '_sub').style.display = 'none';
                xoopsGetElementById(id + '_sign').src   = '"
.XOOPS_URL."/images/menu/plus.gif';
                xoopsGetElementById(id + '_folder').src = '"
.XOOPS_URL."/images/menu/tree_close.gif';
            }
    }
}
</script>"
;

$block['content'] .= "<img src='".XOOPS_URL."/images/menu/d_tree_home.gif' alt='' /> <a href='".XOOPS_URL."/'>"._MB_SYSTEM_HOME."</a>";

$sql    '
        SELECT
        M.mid,
        M.dirname
        FROM
        '
.$db->prefix('modules').' M,
        '
.$db->prefix('groups_modules_link').' L
        WHERE M.hasmain=1
        AND M.isactive=1
        AND M.weight>0
        AND M.mid = L.mid
        AND L.groupid IN('
.join(','$groups).')
        GROUP BY M.dirname
        ORDER BY M.weight ASC'
;

$result $db->query($sql);
while (
$myrow $db->fetch_array($result)) {
    if ( @
file_exists(XOOPS_ROOT_PATH.'/modules/'.$myrow['dirname'].'/xoops_version.php') ) {
        
$module = new XoopsModule($myrow);
        if (
$sublinks $module->subLink()) {
            
$subcont[] = $myrow['dirname'];
            
$block['content'] .= "<br /><a href='javascript:toggle_dynmenu(\"".$myrow['dirname']."\");'><img id='".$myrow['dirname']."_sign' name='".$myrow['dirname']."_sign' src='".XOOPS_URL."/images/menu/minus.gif' height='9' width='9' align='absmiddle' border='0' /></a> ";
            
$block['content'] .= "<img id='".$myrow['dirname']."_folder' name='".$myrow['dirname']."_folder' src='".XOOPS_URL."/images/menu/tree_open.gif' alt='' /> ".$module->mainLink();
            
$block['content'] .= "<span id='".$myrow['dirname']."_sub' name='".$myrow['dirname']."_sub' style='display:inline;'>";
            foreach(
$sublinks as $sublink) {
                
$block['content'] .= "<br /> <img src='".XOOPS_URL."/images/menu/d_tree_content.gif' alt='' /> ".$sublink;
            }
            
$block['content'] .= "</span>";
            } else {
                
$block['content'] .= "<br /><img src='".XOOPS_URL."/images/menu/d_tree_close.gif' alt='' /> ".$module->mainLink()."\n";
            }
    }
}

if ( !empty(
$subcont) ) {
    
$block['content'] .= "<script type='text/javascript'>\n";
    foreach(
$subcont as $value) {
        if (!
$xoopsModule || ($xoopsModule->dirname() != $value)) {
            
$block['content'] .= "toggle_dynmenu('$value');\n";
        }
    }
    
$block['content'] .= "</script>";
}

return 
$block;

----------------------------------------


Danke für die Hilfe