ERLEDIGT
NEIN
NEIN
ANTWORTEN
3
3
ZUGRIFFE
235
235
EMPFEHLEN
-
HUHU Ich hab ein riesen Problem.
Ich habe meine alte Homepage mit Müh und Not auf PHP umcodiert. Ich habe ein Navigationssystem. Dieses besteht aus 7 Punkten. per click auf einen öffnet sich im selben Menü ein Untermenü. Soll heissen ne Art Ziamonikamenü :P.
Jetzt soll aber das Untermenü nich mit dem selben Hintergrund angezeigt werden. Ich hab das mit einem Hover-Effekt gemacht. Aber jetzt bekomm ich nicht hin wie ich das für das Untermenü ändere Ich hoff ich habt mich verstanden und könnt mir helfen.
Ich füge mal den Script bei.
Dateien:
- include/global_funk.inc.php
- templates/style.css
Wenn ihr noch mehr braucht schreib ich den rest auch noch...
include/global_funk.inc.php
________________________________________________________
_____________________________________________________________PHP-Code:<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!defined('SCRIPTNAME')) {
echo 'Unzulässiger Scriptaufruf';
exit;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Templatedaten holen fuer Templates ohne Ersatzvariablen
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function get_tdata($tmplname) {
if(file_exists($tmplname)) {
$lines = implode("",file($tmplname));
return $lines;
} else {
print_scripterror("Fehler!", "Die Datei: $tmplname kann nicht geöffnet werden");
exit;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Templateinhalt holen fuer Einzelausgaben und Ausgaben in
// while, for und foreach Schleifen
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function get_tpldata($templatename) {
if(file_exists($templatename)) {
$templatecontent = file($templatename);
return $templatecontent;
} else {
print_scripterror("Fehler!", "Die Datei: $templatename kann nicht geöffnet werden");
exit;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Templateparser
// Aufrufbeispiel:
// echo $tp_content_out = templateparser($templatecontent, $wertearray);
// $templatecontent = Template HTML Code
// $wertearray = Zu ersetztende Platzhalterdaten
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function templateparser($templatedatei, $wertearray) {
if(is_array($wertearray)) {
foreach($wertearray as $key => $value) {
$suchmuster = "/<%%(".strtoupper($key).")%%>/si";
// Gefundene Platzhalter mit Werten aus $wertearray ersetzen
$templatedatei = preg_replace($suchmuster, $value, $templatedatei);
}
// Nicht ersetzte Platzhalter aus Template entfernen
$templatedatei = preg_replace("/((<%%)(.+?)(%%>))/si", '', $templatedatei);
}
return (implode("", $templatedatei));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Globaler Header
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function globaler_header($seitentitel ='', $zusatzcontent ='') {
$contentarray = array(
"SEITENTITEL" => $seitentitel,
"ZUSATZCONTENT" => $zusatzcontent
);
// Templatename
$templatecontent = get_tpldata("templates/header.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Globales oberes Layout
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function globallayoutoben($seitentitel = '', $navimenue = '', $navlink = '') {
$contentarray = array(
"SEITENUEBERSCHRIFT" => $seitentitel,
"MENUEAUSGABE" => get_navi($navimenue, $navlink)
);
// Templatename
$templatecontent = get_tpldata("templates/layoutoben.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Globaler Footer
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function globaler_footer() {
// Templatename
$contentarray = array(
"FOOTERCONTENT" => ''
);
$templatecontent = get_tpldata("templates/footer.html");
return $tp_content_out = templateparser($templatecontent, $contentarray);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Navigation
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function get_navi($navimenue = '' , $aktiverlink = '') {
if ($navimenue == 'HOME') {
$menuedaten = array(
'index' => '>Home',
'home_news' => '--->News',
'firma' => '>Firma',
'produktionen' => '>Produktionen',
'bilder' => '>Bilder',
'tutorials' => '>Tutorials',
'gb' => '>Gästebuch',
'kontakt' => '>Kontakt'
);
} elseif ($navimenue == 'FIRMA') {
$menuedaten = array(
'index' => '>Home',
'firma' => '>Firma',
'firma_ausruestung' => '--->Ausrüstung',
'firma_team' => '--->Team',
'produktionen' => '>Produktionen',
'bilder' => '>Bilder',
'tutorials' => '>Tutorials',
'gb' => '>Gästebuch',
'kontakt' => '>Kontakt'
);
} elseif ($navimenue == 'FIRMA-AUSRUESTUNG') {
$menuedaten = array(
'index' => '>Home',
'firma' => '>Firma',
'firma_ausruestung' => '--->Ausrüstung',
'firma_aus_arbeitsplatz' => '------>Arbeitsplatz',
'firma_aus_camcorder' => '------>Camcorder',
'firma_aus_waffen' => '------>Waffen',
'firma_aus_sonstiges' => '------>Sonstiges',
'firma_team' => '--->Team',
'produktionen' => '>Produktionen',
'bilder' => '>Bilder',
'tutorials' => '>Tutorials',
'gb' => '>Gästebuch',
'kontakt' => '>Kontakt'
);
---->Unterbrochen<----
}
while(list($key, $val) = each($menuedaten)) {
if ($key != $aktiverlink) {
$menuelinks .= "<a href=\"$key.php\">$val</a>\n";
} else {
$menuelinks .= "<div class=\"aktuell\">$val</div>\n";
}
}
return $menuelinks;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Scripterror
// Sofortiger Scriptabbruch bei Fehlern
// gibt einfache HTML Seite aus mit Fehlerhinweisen
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
function print_scripterror($titel = '', $fehlertext = '') {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title><?php echo $titel; ?></title>
<style type="text/css">
body {
background-color: #f7f7f7;
font-family: Verdana, Arial;
font-size: 12px;
color: #000000;
}
.err {
background-color: #000000;
}
.errtop {
background-color: #ffcc00;
font-size: 12px;
color: #000000;
padding: 4px;
}
.errcont {
background-color: #ffffff;
font-size: 12px;
color: #000000;
padding: 4px;
}
</style>
</head>
<body>
<div align="center">
<table cellspacing="1" cellpadding="0" border="0" width="600" class="err">
<tr>
<td class="errtop"><b><?php echo $titel; ?></b></td>
</tr>
<tr>
<td class="errcont"><?php echo $fehlertext; ?></td>
</tr>
</table>
</div>
</body>
</html>
<?php
exit;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
?>
templates/style.css
_____________________________________________________________
_________________________________________________________________PHP-Code:/* - - - - - - - - - - - - - - - - - - - - */
/* BODY */
/* - - - - - - - - - - - - - - - - - - - - */
body, html {
background: #000000;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
color: #000000;
}
/* - - - - - - - - - - - - - - - - - - - - */
/* AEUSSERE CONTENTBOX */
/* - - - - - - - - - - - - - - - - - - - - */
#inhalt {
margin:10px auto;
text-align:left;
width: 738px;
padding: 0px;
background: #000000;
}
/* - - - - - - - - - - - - - - - - - - - - */
/* DESIGNTABELLE*/
/* - - - - - - - - - - - - - - - - - - - - */
#design {
width: 738px;
background: #000000;
}
#head {
background-image: url(../colorschemes/colorscheme1/images/static/bg_header.jpg);
background-repeat: no-repeat;
height: 160px;
text-align: center;
color: #ffffff;
}
#tnleft {
background-image: url(../colorschemes/colorscheme1/images/static/bg_sub_container1.gif);
color: #ecdc93;
font-size: 14px;
height: 32px;
padding-right: 6px;
background-repeat: no-repeat;
}
#tnright {
background-image: url(../colorschemes/colorscheme1/images/static/bg_sub_container2.gif);
color: #ecdc93;
font-size: 14px;
}
#menue {
background: url(images/dynamic/buttonset1/sub_nav.gif);
background-image:url(../colorschemes/colorscheme1/images/static/bg_main_container3.gif);
background-repeat:repeat-y;
padding-right: 6px;
color: #000000;
vertical-align: top;
}
.menuelinks a {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/sub_nav.gif);
height: 26px;
color: #000000;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
text-decoration: none;
line-height: 26px;
}
.menuelinks a:hover {
background-image:url(../images/dynamic/buttonset1/sub_nav_active.gif);
text-decoration: none;
text-indent: 18px;
line-height: 26px;
}
.menuelinks .aktuell {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/sub_nav_active.gif);
height: 26px;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
line-height: 26px;
}
#untermenue {
background: url(images/dynamic/buttonset1/unter_nav.gif);
background-image:url(../colorschemes/colorscheme1/images/static/bg_main_container3.gif);
background-repeat:repeat-y;
padding-right: 6px;
color: #000000;
vertical-align: top;
}
.untermenuelinks a {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/unter_nav.gif);
height: 26px;
color: #000000;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
text-decoration: none;
line-height: 26px;
}
.untermenuelinks a:hover {
background-image:url(../images/dynamic/buttonset1/unter_nav_active.gif);
text-decoration: none;
text-indent: 18px;
line-height: 26px;
}
.untermenuelinks .aktuell {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/unter_nav_active.gif);
height: 26px;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
line-height: 26px;
}
#unter2menue {
background: url(images/dynamic/buttonset1/unter2_nav.gif);
background-image:url(../colorschemes/colorscheme1/images/static/bg_main_container3.gif);
background-repeat:repeat-y;
padding-right: 6px;
color: #000000;
vertical-align: top;
}
.unter2menuelinks a {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/unter2_nav.gif);
height: 26px;
color: #000000;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
text-decoration: none;
line-height: 26px;
}
.unter2menuelinks a:hover {
background-image:url(../images/dynamic/buttonset1/unter2_nav_active.gif);
text-decoration: none;
text-indent: 18px;
line-height: 26px;
}
.unter2menuelinks .aktuell {
display: block;
width: 187px;
background-image:url(../images/dynamic/buttonset1/unter2_nav_active.gif);
height: 26px;
font-size: 10px;
font-weight: bold;
text-indent: 18px;
line-height: 26px;
}
#content {
background-image:url(../colorschemes/colorscheme1/images/static/bg_main_container.gif);
vertical-align: top;
padding: 10px 10px 10px 10px;
}
#content a:visited {
text-decoration: none;
color: #c73b00;
}
#content a:link {
text-decoration: none;
color: #c73b00;
}
#content a:hover {
text-decoration: underline;
color: #c73b00;
}
#content a:active {
text-decoration: none;
color: #c73b00;
}
#footer {
background-image:url(../colorschemes/colorscheme1/images/static/bg_footer.gif);
color: #ffffff;
text-align: center;
}
Danke schonmal für die Hilfe
LG TechnikerGeändert von techniker (16.02.08 um 18:33 Uhr)
-
16.02.08 18:24 #2
- Registriert seit
- Jun 2007
- Ort
- Passau (Niederbayern)
- Beiträge
- 1.394
1. Bitte den Code erst mit den entprechenden Codetags formatieren, sonst wird sich keiner die Mühe machen den ewig langen Code zu lesen und dir helfen.
2. Kürze das ganze bitte mal auf 2-3 Menüpunkte, wir brauchen eh nicht alles.
3. Aber hier mal ein Tip: Warum eine Ellenlange "IF-ELSEIF-ELSEIF..." Anweisung, das ganze kann man um einiges schöner und kürzer auch per switch-case machen.Geändert von Bratkartoffel (16.02.08 um 18:27 Uhr)
Über eine gute Bewertung freut sich jeder ;)
Bitte erledigte Threads als "Erledigt" markieren.
"Though a program be but three lines long, someday it will have to be maintained.''
-- Geoffrey James, "The Tao of Programming"
-
Für mich scheint das eher ein CSS-Problem zu sein.
Markus Wulftange
-
HUHU
Ja das hab ich mir auch gedacht. Aber ich bekomm die Unterpunkte nicht mit der CSS verknüfpt.
In der style.css sthen die Untermenüs schon drin. Aber ich weiss nicht wie ich die mit den richtigen Punkten verknüpfen soll.
LG Techniker
Ähnliche Themen
-
Hilfe - Quellcode funktioniert nicht
Von knibbel11 im Forum C/C++Antworten: 10Letzter Beitrag: 26.09.08, 10:35 -
[VC++ 6.0] Hilfe zu Fehlern im Quellcode!
Von berwing im Forum C/C++Antworten: 0Letzter Beitrag: 13.01.08, 01:26 -
[C++] Quellcode Hilfe für winforms
Von blotte im Forum C/C++Antworten: 2Letzter Beitrag: 02.09.06, 14:09 -
Quellcode bitte erklären
Von BiggJoee im Forum Visual Basic 6.0Antworten: 5Letzter Beitrag: 28.07.04, 16:10 -
BITTE BITTE HILFE ''Laufzeitfehler 713'
Von anyaa im Forum Visual Basic 6.0Antworten: 2Letzter Beitrag: 26.04.04, 10:44





Zitieren

Login






[PHP][Snippet] Array zu XML konvertieren