Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 16

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 27.09.2005, 19:25   #1 (permalink)
Baby Mamber
 
njcjans's Avatar
 
Join Date: Feb 2005
Posts: 19
njcjans is on a distinguished road
Default Submenu with mycssmenu.php

I'm using a template which uses mycssmenu.php for the menu. The primary menu-items are working perfectly, but the submenu is crap (menu moves up, text "jml" appears and most submenu-items don't become colored when active) Look at http//:www.nicojans.tk and click on "competenties" and you see what I mean.

Can some-one help me out here?

Template's index.php:
PHP Code:
<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
require(
$mosConfig_absolute_path."/templates/recipes8/mycssmenu.php");
?><?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso explode'='_ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'$iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
if ( $my->id ) {
    
initEditor();
}
?><?php defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
require(
$mosConfig_absolute_path."/templates/recipes8/mycssmenu.php");
?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO?>" />
<?php mosShowHead(); ?>
<link rel="stylesheet" type="text/css" href="<?php echo $mosConfig_live_site?>/templates/recipes8/css/template_css.css" />
</head>
<body>
    <center><table colspan="0" cellspacing="0" border="0" width="711">
        <tr>
        <td id="header"><img src="<?php echo $mosConfig_live_site?>/templates/recipes8/images/blank.gif" width="711" height="180">
        
<div id="example9h">
<!-- BEGIN MENU -->
<div class="navhorzcontainer">
<div class="navsubhorzcontainer">
<?php echo $mycssPRI_SUB_LAYERED ?></div>
</div>
<!-- END MENU -->
<br>                        
</td>
        </tr>
        <tr>
        <td valign="top" id="main">
        
        <?php mosMainBody(); ?>
        
        </div></td>
        </tr>
        <tr>
        <td id="footer"></div></td>
        </tr>
    </table></center
</body>
</html>
njcjans is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 27.09.2005, 19:26   #2 (permalink)
Baby Mamber
 
njcjans's Avatar
 
Join Date: Feb 2005
Posts: 19
njcjans is on a distinguished road
Default Re: Submenu with mycssmenu.php

mycssmenu.php:
PHP Code:
<?php /* mycssmenu.php based on mod_mainmenu.class.php,v 1.13 */
/**
* recoded by Konlong
* produces two variable strings in unordered list format
*      $mycssONLY_PRI_menu => just the top level items of the menu
*      $mycssPRI_SUB_menu => menus with submenu list (nested)
*
*
*  One variable string with the primary unordered list first followed by any sub-menu lists
*      $mycssPRI_SUB_LAYERED => menus with submenu list (layered)
*
*
*  And a simple string of links separated with "::"
*      $mycssPATHmenu => just the top level items of the menu with a separator  "::" between items
*
*NOTE: ONLY "$mycssPRI_SUB_LAYERED" Is wrapped in a division tag '<div id="navhorzcontainer">' for
*     primary levels and '<div id="navsubhorzcontainer">' for the sub-levels.
*     The other variables are divisionless
*     and it is up to the template designer to assign a division.
*
*     The id's used are :
*
*                <ul id="navlist">  for Primary levels
*                <li id="active">  for active or chosen item on a Primary level
*                <ul id="subnavlist">  for Sub levels
*                <li id="subactive">  for active or chosen item on a Sub level
*
* This file sould be placed in your templates own directory
* & the following should be at the top of your index.php
*
* <?php
* defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
* require($mosConfig_absolute_path."/templates/XXXXXX/mycssmenu.php");
* ?>
*
* NOTE: replace 'XXXXXX' with the name of your template
*
**/

/* $Id: mod_mainmenu.class.php,v 1.13 2004/01/13 20:36:55 ronbakker Exp $ */
/**
* Menu handling functions
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.13 $
**/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
if (
defined'_VALID_MYCSSMENU' )) return;

/**
* Menu List
*/
    
global $database$my$cur_template$Itemid;
    global 
$mosConfig_absolute_path$mosConfig_live_site$mosConfig_shownoauth;
    
    
$menutype = @$params->menutype $params->menutype 'mainmenu';
  
$class_sfx = @$params->class_suffix $params->class_suffix '';

    
$mycssONLY_PRI_menu "\n";
    
$mycssPRI_SUB_menu "\n";
    
$mycssPRI_SUB_LAYERED "\n";
    
$PRI_SUB_LAYERED = array();
    
$PRI_SUB_LAYERED[0] = "\n".'<div id="navhorzcontainer">';
    
$mycssPATHmenu "";
    
/* If a user has signed in, get their user type */
    
$intUserType 0;
    if(
$my->gid){
        switch (
$my->usertype)
        {
            case 
'Super Administrator':
            
$intUserType 0;
            break;
            case 
'Administrator':
            
$intUserType 1;
            break;
            case 
'Editor':
            
$intUserType 2;
            break;
            case 
'Registered':
            
$intUserType 3;
            break;
            case 
'Author':
            
$intUserType 4;
            break;
            case 
'Publisher':
            
$intUserType 5;
            break;
            case 
'Manager':
            
$intUserType 6;
            break;
        }
    }
    else
    {
        
/* user isn't logged in so make their usertype 0 */
        
$intUserType 0;
    }
    
    if (
$mosConfig_shownoauth) {
        
$sql "SELECT m.* FROM #__menu AS m"
        
"\nWHERE menutype='$menutype' AND published='1'"
        
//. "\nAND utaccess >= '$intUserType' "
        
"\nORDER BY parent,ordering";
    } else {
        
$sql "SELECT m.* FROM #__menu AS m"
        
"\nWHERE menutype='$menutype' AND published='1' AND access <= '$my->gid'"
        
//. "\nAND utaccess >= '$intUserType' "
        
"\nORDER BY parent,ordering";
    }
    
$database->setQuery$sql    );
    
    
$rows $database->loadObjectList'id' );
    echo 
$database->getErrorMsg();
    
    
// establish the hierarchy of the menu
    
$children = array();
    
// first pass - collect children
    
foreach ($rows as $v ) {
        
$pt $v->parent;
        
$list = @$children[$pt] ? $children[$pt] : array();
        
array_push$list$v );
        
$children[$pt] = $list;
    }
    
    
// second pass - collect 'open' menus
    
$open = array( $Itemid );
    
$count 20// maximum levels - to prevent runaway loop
    
$x_id $Itemid;
    while (--
$count) {
        if (isset(
$rows[$x_id]) && $rows[$x_id]->parent 0) {
            
$x_id $rows[$x_id]->parent;
            
$open[] = $x_id;
        } else {
            break;
        }
    }
    
cssRecurseMenu00$children$open$class_sfx$mycssONLY_PRI_menu$mycssPRI_SUB_menu$PRI_SUB_LAYERED$mycssPATHmenu );
    
$mycssHORZmenu_content $mycssONLY_PRI_menu .= "\n";
$mycssVIRTmenu_content $mycssPRI_SUB_menu .= "\n";
$PRI_SUB_LAYERED[0] .= "\n".'</div>jml';
$mycssHORZwSUBmenu_content $mycssPRI_SUB_LAYERED .= implode("\n"$PRI_SUB_LAYERED) ."\n";
$mycssPATHmenu_content $mycssPATHmenu substr($mycssPATHmenu,0,strlen($mycssPATHmenu)-4);

define'_VALID_MYCSSMENU'true );
/**
* Utility function to recursively work through a hierarchial menu
*/
function cssRecurseMenu$p_id$level, &$children, &$open$class_sfx, &$navOnlyPrimary, &$navPrimary_Subs, &$navPrimary_Sub_layered, &$navPATH) {
    global 
$Itemid;
    if (@
$children[$p_id]) {
        
    if (
$level)
        {
            
$navPrimary_Subs .= "\n".'<ul id="subnavlist">';
            
$navPrimary_Sub_layered[$level] = "\n".'<div id="navsubhorzcontainer"><ul id="navlist">';
        } else
        {
            
$navPrimary_Subs .= "\n".'<ul id="navlist">';
            
$navOnlyPrimary .= "\n".'<ul id="navlist">';
            
$navPrimary_Sub_layered[$level] .= "\n".'<ul id="navlist">';
        }
        foreach (
$children[$p_id] as $row) {
            
            
$idclass '';
            
$navPrimary_Subs .= "\n<li";
            
$navPrimary_Sub_layered[$level] .= "\n<li";
            if (!
$level)
            {
                
$navOnlyPrimary .= "\n<li";
            }
            if (
$Itemid == $row->id)
            {
                if (
$level)
                {
                    
$navPrimary_Subs .= ' id="subactive"';
                    
$idclass 'id="subcurrent"';
                    
$navPrimary_Sub_layered[$level] .= 'id="subactive"';
                } else
                {
                    
$navPrimary_Subs .= ' id="active"';
                    
$navOnlyPrimary .= ' id="active"';
                    
$navPrimary_Sub_layered[$level] .= ' id="active"';
                    
$idclass 'id="current"';
                }
            }
            
$navPrimary_Subs .= '>';
            
$navPrimary_Sub_layered[$level] .= '>';
            if (!
$level)
            {
                
$navOnlyPrimary .= ">";
            }
//            $nav_cont .= (in_array( $row->id, $open ) ? '-X-': ''); //testing code
            
if (in_array$row->id$open ))
            {
                
$navPATH .= $row->name ' :: ';
                
            }
            
$navLink cssGetMenuLink$row$level$class_sfx$idclass);// id_class no used at present all anchor classes set to images
            
$navPrimary_Subs .= $navLink.'</li>';
            
$navPrimary_Sub_layered[$level] .= $navLink.'</li>';
            if (!
$level)
            {
                
$navOnlyPrimary .= $navLink.'</li>';
            }
            
            if (
in_array$row->id$open )) {
                
cssRecurseMenu$row->id$level+1$children$open$class_sfx$navOnlyPrimary$navPrimary_Subs$navPrimary_Sub_layered$navPATH);
            }
        }
        
$navPrimary_Subs .= "\n</ul>";
        
$navPrimary_Sub_layered[$level] .= "\n</ul>\n</div>";
        if (!
$level)
        {
            
$navOnlyPrimary .= "\n</ul>";
        }
    }
}

/**
* Utility function for writing a menu link
*/
function cssGetMenuLink$mitem$level=0$class_sfx=''$idclass='') {
    
// id_class no used at present all anchor classes set to images
    
global $Itemid$mosConfig_live_site;
    
$txt '';
    
    switch (
$mitem->type) {
        case 
'separator';
        
// do nothing
        
break;
        
        case 
'url':
        if (
eregi"index.php\?"$mitem->link )) {
            
//$mitem->link .= "&Returnid=$Itemid";
            
if (!eregi"Itemid="$mitem->link )) {
                
$mitem->link .= "&Itemid=$mitem->id";
            }
        }
        break;
        
        default:
        
$mitem->link .= "&Itemid=$mitem->id";
        break;
    }
    
    
$mitem->link str_replace'&''&amp;'$mitem->link );
    
    if (
strcasecmp(substr($mitem->link,0,4),"http")) {
        
$mitem->link sefRelToAbs($mitem->link);
    }
    
    
$menuclass "mainlevel$class_sfx";
    if (
$level 0) {
        
$menuclass "sublevel$class_sfx";
    }
    
$menuclass "images";
    switch (
$mitem->browserNav) {
        
// cases are slightly different
        
case 1:
        
// open in a new window
        
$txt "<a href=\"$mitem->link\" target=\"_window\" class=\"$menuclass\" $idclass>$mitem->name</a>";
        break;
        
        case 
2:
        
// open in a popup window
        
$txt "<a href=\"#\" onClick=\"javascript: window.open('$mitem->link', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" $idclass>$mitem->name</a>";
        break;
        
        case 
3:
        
// don't link it
        
$txt "<span class=\"$menuclass\" $idclass>$mitem->name</span>";
        break;
        
        default:    
// formerly case 2
        // open in parent window
        
$txt "<a href=\"$mitem->link\" class=\"$menuclass\" $idclass>$mitem->name</a>";
        break;
    }
    
    return 
$txt;
}
?>
njcjans is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 27.09.2005, 19:27   #3 (permalink)
Baby Mamber
 
njcjans's Avatar
 
Join Date: Feb 2005
Posts: 19
njcjans is on a distinguished road
Default Re: Submenu with mycssmenu.php

Template's css:
PHP Code:
/* horizontale menu */


#example9h #navlist
{
margin-left70px;
margin-right70px;
text-align:center;
fontbold 10px Verdanasans-serif;
letter-spacing1px;
}


#example9h #navlist li
{
list-
stylenone;
margin0;
displayinline;
padding-left:10px;

line-height:18px;
}

#example9h #navlist li a
{

text-decoration:none;
}

#example9h #navlist li a:link { color: #666; }
#example9h #navlist li a:visited { color: #666; }

#example9h #navlist li a:hover
{
color#ccc;
border-top:1px solid #ccc;
border-bottom:1px solid #ccc;


}

#example9h #navlist li a:current
{
border-top:1px solid #4A788C;
border-bottom:1px solid #4A788C;
color#4A788C;
}

#example9h #subnavlist
{
margin-left70px;
margin-right70px;
text-align:center;
fontbold 10px Verdanasans-serif;
letter-spacing1px;
}


#example9h #subnavlist li
{
list-
stylenone;
margin0;
displayinline;
padding-left:10px;

line-height:18px;
}

#example9h #subnavlist li a
{

text-decoration:none;
}

#example9h #subnavlist li a:link { color: #666; }
#example9h #subnavlist li a:visited { color: #666; }

#example9h #subnavlist li a:hover
{
color#ccc;
border-top:1px solid #ccc;
border-bottom:1px solid #ccc;
}

#example9h #subnavlist li a:current
{
border-top:1px solid #4A788C;
border-bottom:1px solid #4A788C;
color#4A788C;
}

body {
    
margin0px;
    
backgroundurl(../images/recipes_01.gifrepeat-#91C1D6;
    
}

#main{    
backgroundurl(../images/recipes_06.gifrepeat-y;
width:711px;
padding-left:70px;
padding-right:70px;

}



#header{
backgroundurl(../images/recipes_03.gifno-repeat;
width711px;
height245px;
}

#footer{
backgroundurl(../images/recipes_08.gifno-repeat;
padding-top:3px;
height51px;
}


td,tr,pdiv{
    
font-familyarial;
    
font-size11px;
    
color#222222;
}
hr {
  
background       #999999;
  
height           1px;
  
width            100%;
}
#mainlevel-nav {
margin0padding0;
padding-left:50px;
}
#mainlevel-nav li {
    
    
padding-left40px;
list-
style:nonedisplay:inline
text-transformuppercase;
font-weightbold;
text-decoration:none;
}
#mainlevel-nav a {
border3px #fff;
height20px;
color#000;

}

#mainlevel-nav a:hover {
color:#ccc
text-transform:none;
height20px;
backgroundurl(../images/mouseover.gifno-repeat;

}

/*different setting for newsflash*/
.newsflash td {
color#000000;
text-alignjustify;
vertical-alignmiddle;
}

/*setting for the greetings*/
.mainpage {
text-alignjustify;
color#333333;
font-familyVerdanaHelveticaArialsans-serif;
font-size13px;
}
.
mainpage-bkg {
    
background-imageurl(../images/lineborder.png);
    
width1px;
}

.
greybg {
  
background#eeeeee;
}

/*pathway setting*/
.pathway {
font-familyVerdanaHelveticaArialsans-serif;
font-size9px;
}

a.pathway:linka.pathway:visited {
  
color            #4A788C;
  
font-weight      normal;
}

a.pathway:hover {
  
color            #ff3300;
  
font-weight      normal;
  
text-decoration   none;
}

/*for title or site name*/
.title {
font-familysans-serif;
font-size20px;
font-weightbold;
color #000000;
margin-left10px;
}

/*for the tag-line*/
.subtitle {
font-familysans-serif;
font-size10px;
font-weightbold;
color #666666;
text-transformuppercase;
letter-spacing2px;
margin-left20px;
}

#active_menu {
  
color#000000;
}

/* --Default Class Settings-- */

a.mainlevel:linka.mainlevel:visited {
displayblock;
color#ffffff;
font-weightbold;
background-imageurl(../images/menu_bgr.png);
background-repeatno-repeat;
width95%;
text-indent15px;
text-decorationnone;
font-familyVerdanaHelveticaArialsans-serif;
line-height20px;
margin-bottom1px;
}
a.mainlevel:hover {
color#333333;
}

a.mainmenu:linka.mainmenu:visited {
color#ffffff; 
font-familyVerdanaHelveticaArialsans-serif;
font-weightbold;
font-size10px;

}
a.mainmenu:hover {
color#333333; 
}
.
pollstableborder {
border1px solid;
padding1px;
}

a.sublevel:linka.sublevel:visited {
        
padding-left1px;
        
vertical-alignmiddle;
        
font-size11px;
        
color#4A788C;
        
text-alignleft;
}


a.sublevel:hover {
color#ff9e31; text-decoration: none;
}

table.moduletable {
    
padding5px 0px 5px 8px;
    
margin-bottom15px;
    
width100%;
    
backgroundurl(../images/bgr.png);
}

table.moduletable th {
    
font-size        11px;
    
font-weight      bold;
    
color            #000000;
    
text-align       left;
    
width            100%;
    
letter-spacing2px;
    
text-indent5px;
    
padding-bottom3px;
}

table.moduletable li {
}

table.moduletable ul {
    
padding0px;
}
table.moduletable td {
font-size10px;
font-weightnormal;
}

.
poll {
  
font-family      ArialHelveticasans-serif;
  
font-size        10px;
  
color            #666666;
  
line-height      14px;
}

table.pollstableborder {
    
border1px solid #cccccc;
}

.
sectiontableheader {
  
  
color            #333333;
  
font-weight      bold;
}

.
sectiontableentry1 {
  
background-color #F0F0F0;
}

.
sectiontableentry2 {
  
background-color #E0E0E0;
}

.
small {
  
font-family      VerdanaArialHelveticasans-serif;
  
font-size        10px;
  
color            #999999;
  
text<