![]() |
[php]Anzeigenamen aus Seite laden
Hallo,
wie kann ich den Anzeigenamen einer Seite in ein Linkmenu laden? Ich habe mehrere Seiten (seite1.php, seite2.php, seite3.php ...) und eine index.php. Die Linkliste soll dann so aussehn: MfG freak |
Re: [php]Anzeigenamen aus Seite laden
Beim phpBB wird sowas im Admin-Panel verwendet:
Am Anfang jeder Datei das:
Code:
Und für die Auflistung das:
if( !empty($setmodules) )
{ $filename = basename(__FILE__); $module['Users']['Disallow'] = append_sid($filename); return; }
Code:
Der Code sollte sich leicht auf dein Problem anpassen lassen. :wink:
$dir = @opendir(".");
$setmodules = 1; while( $file = @readdir($dir) ) { if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) ) { include($file); } } @closedir($dir); unset($setmodules); [...] ksort($module); while( list($cat, $action_array) = each($module) ) { $cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat); [...] ksort($action_array); $row_count = 0; while( list($action, $file) = each($action_array) ) { [...] $action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action); [...] } } |
Re: [php]Anzeigenamen aus Seite laden
Zitat:
|
Re: [php]Anzeigenamen aus Seite laden
Ich habs jetzt so:
index.php
Code:
seite1.php
<html>
<head> </head> <body> <? $dir = @opendir("."); $LoadOnlyCaption = 1; while($file = @readdir($dir)){ if(($file != '.') and ($file != '..') and ($file != 'index.php') and (!is_dir($file))){ include($file); echo "<a href=\"index.php?seite=$file\">$Beschreibung[$file]</a>"; } } echo " "; echo " "; unset($LoadOnlyCaption); @include($_GET["seite"]); ?> </body> </html>
Code:
Dabei werden alle Seiten gefunden, aber nur die mit Beschreibung auch ausgegeben. Das find ich gut. :D Danke!
<html>
<head> </head> <body> <? if(!empty($LoadOnlyCaption)){ $Beschreibung["seite1.php"] = "Das Wetter wird wolkig. "; } else { echo '[url=""][img]icons/weather_cloudy.png[/img][/url] Wolkig! '; } ?> </body> </html> MfG freak |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:27 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz