Zitat von Underserial
Ok, mein Freund.
Ich habe leider keine Ahnung von was du da redest ich hab das nicht selbst gecodet .
Sorry.
...
Und wo ist der ••••••••r, der gecodet hat?
Versuche es mit dieser überarbeiteten Version, eventuell genügt das.
AUch wenn nicht, die teils bessere Formatierung hilft bei der Fehlersuche.
PHP-Code:
<?php include( 'admin/config.inc.php' ); include( 'admin/var.inc.php' ); if( mysql_connect ( $sql_host , $sql_user , $sql_pass ) ) { mysql_select_db ( $sql_db ); } else { error ( 'Keine DB Verbindung möglich' , 'Die Verbindung zur Datenbank konnte nicht hergestellt werden' ); } $sub = htmlspecialchars ( $_GET [ 'sub' ]); $con = htmlspecialchars ( $_GET [ 'con' ]); if( $sub == '' ) { $sub = $startcat ; $con = $startpage ; } if( $con == '' ) { $con = $startpage ; } $res = mysql_query ( 'SELECT * FROM content WHERE submenu = "' . $sub . '" ORDER by name;' ); while( $arr = mysql_fetch_row ( $res )) { if ( $con == $arr [ 0 ]) { $submenu .= '<a class="left_mark" href="index.php?con=' . $arr [ 0 ] . '&sub=' . $arr [ 3 ] . '">' . $arr [ 1 ] . '</a>' ; }else{ $submenu .= '<a class="left" href="index.php?con=' . $arr [ 0 ] . '&sub=' . $arr [ 3 ] . '">' . $arr [ 1 ] . '</a>' ; } } $res = mysql_query ( 'SELECT * FROM menu ORDER by name;' ); while( $arr = mysql_fetch_row ( $res )) { if ( $arr [ 2 ]== 0 ) { $idee = $arr [ 0 ]; $resulu = mysql_query ( 'SELECT * FROM content WHERE id = ' . $idee . ' ORDER BY id LIMIT 1;' ); $cona = mysql_fetch_array ( $resulu ); $conit = $cona [ 0 ]; }else{ $conit = $arr [ 2 ]; } if ( $sub == $arr [ 0 ]) { $menu .= '<a class="top_mark" href="index.php?con=' . $conit . '&sub=' . $arr [ 0 ] . '">' . $arr [ 1 ] . '</a>' ; }else{ $menu .= '<a class="top" href="index.php?con=' . $conit . '&sub=' . $arr [ 0 ] . '">' . $arr [ 1 ] . '</a>' ; } } $res = mysql_query ( 'SELECT * FROM box' ); while( $arr = mysql_fetch_row ( $res )) { if( $arr [ 3 ]== 1 ) { $box_left .= file_get_contents ( 'templates/box.tpl' ) . '<br>' ; $box_left = str_replace ( '{box_title}' , $arr [ 1 ], $box_left ); $box_left = str_replace ( '{box_con}' , $arr [ 2 ], $box_left ); }else{ $box_right .= file_get_contents ( 'templates/box.tpl' ). '<br>' ; $box_right = str_replace ( '{box_title}' , $arr [ 1 ], $box_right ); $box_right = str_replace ( '{box_con}' , $arr [ 2 ], $box_right ); } } $res = mysql_query ( 'SELECT * FROM content WHERE id="' . $con . '";' ); $arr = mysql_fetch_array ( $res ); $con_center = file_get_contents ( 'templates/box.tpl' ); $con_center = str_replace ( '{box_title}' , $arr [ 1 ], $con_center ); $con_center = str_replace ( '{box_con}' , $arr [ 2 ], $con_center ); $con_info = file_get_contents ( 'templates/box.tpl' ); $con_info = str_replace ( '{box_title}' , $info_name , $con_info ); $con_info = str_replace ( '{box_con}' , $info_con , $con_info ); $con_menu = file_get_contents ( 'templates/box.tpl' ); $con_menu = str_replace ( '{box_title}' , 'Hauptmenü' , $con_menu ); $con_index = file_get_contents ( 'templates/index.tpl' ); $con_index = str_replace ( '{menu}' , $menu , $con_index ); $con_index = str_replace ( '{center}' , $con_center , $con_index ); $con_index = str_replace ( '{box_right}' , $box_right , $con_index ); $con_index = str_replace ( '{box_left}' , $box_left , $con_index ); $con_index = str_replace ( '{leftmenu}' , $con_menu , $con_index ); $con_index = str_replace ( '{box_con}' , $submenu , $con_index ); $con_index = str_replace ( '{info}' , $con_info , $con_index ); echo $con_index ; ?>