myGully.com

myGully.com (https://mygully.com/index.php)
-   Programmierung (https://mygully.com/forumdisplay.php?f=67)
-   -   PHP Frage. (https://mygully.com/showthread.php?t=2011695)

fabbi94 17.03.10 18:54

PHP Frage.
 
Hi ich habe eine frage und zwar wie kann ich mit PHP mir eine seite zusammenfügen also dass ich z.b. 4 HTML seiten habe und 1. z.b navbar 2.header 3. Inhalt 4. Foder.

Dass ich die dann in einem PHP dokument aufrufe und in die richtige position stecke dass ich dann z.b. die navbar schnell in allen dokumenten ändern kann meine ich. Wisst ihr was ich meine wenn ich versuch ich es nochmal genauer zu erklären?

Wäre sehr erfreud über eine antwort.

Irolight 17.03.10 22:32

PHP-Code:

function getDokument($source) {
    if(!
is_file($source))
        return; 
// Bricht ab, wenn datei nicht exisitert
    
ob_start(); // es wird die Ausgabe intern zwischen gespeichert, sprich alles was ab jetzt eigentlich angezeigt wird, sieht man nicht
    
include($source); // läd deine Datei
    
$result ob_get_contents(); // Alles was zwischen gespeichert wurde wird in die Variable geschrieben
    
ob_end_clean(); // Zwichenspeichern wird beendet und der Speicher gelehrt.
    
return $result;
}
$meineDatei getDokument("navbar.html");
echo 
$navbar


hilde.hilden 20.03.10 16:45

nen einfaches
PHP-Code:

<html>
<head>...</head>
<body>
<?include('navbar.html')?>
<?
include('header.html')?>
....
</body>
</html>

sollte reichen

urga 21.03.10 00:26

nimm dir nen tag zeit, und arbeite dich in eine template-engine ein. z.b. smarty: [Link nur für registrierte und freigeschaltete Mitglieder sichtbar. Jetzt registrieren...]

ckjthedogmaster 23.03.10 19:48

Schliess mich hier mal an, und zwar erweitere ich mein Wissen und versuch mich grad mit PHPKIT ne HP zu erstellen. Learning by doing

Hab mir jetzt n Style runtergeladen, und läuft auch eigentlich. Krieg auch einige sachen hin im PHP, aber nun ist oben ne Navi - Box mit diversen Buttons.

Zu sehen hier: [Link nur für registrierte und freigeschaltete Mitglieder sichtbar. Jetzt registrieren...]

Die Bearbeitung der Navi Box geschieht über den Adminbereich, Vorlagen in site.htm .

Mein Vorhaben: Ich habe die BLANKO Button, und wollte nun einige Button ganz verschwinden lassen, so, das auch die Verlinkung weg ist. Nun ist die Frage, wie muss ich den Code jetzt ändern,. Die BLANKO Datei wird gleich benannt wie die Originale. Bei dem reinen Austausch der Grafik, bleibt ja der Link nur halt "versteckt"

Ich stelle jetzt nicht die ganze site.htm rein, sondern nur die eben betroffenen Zeilen.

PHP-Code:

<div id="header">
 <
table border="0" cellspacing="0" cellpadding="0">
<
tr>
 <
td colspan="12"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_02.jpg" style="width:980px;height:7px;border:0px"/></td>
</
tr>
<
tr>
 <
td><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_01.jpg" style="width:75px;height:31px;border:0px"/></td>
 <
td><a href="include.php?path=start" title="Zurück zur Startseite"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_05.jpg" style="width:62px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_05_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_05.jpg'"></a></td>
 <
td><a href="include.php?path=forumsdisplay" title="Öffnet das Forum"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_06.jpg" style="width:67px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_06_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_06.jpg'"></a></td>
 <
td><a href="include.php?path=news" title="News Übersicht"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_07.jpg" style="width:67px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_07_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_07.jpg'"></a></td>
 <
td><a href="include.php?path=contentarchive&type=1" title="Artikel Übersicht"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_08.jpg" style="width:86px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_08_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_08.jpg'"></a></td>
 <
td><a href="include.php?path=contentarchive&type=3" title="Links und Partner"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_09.jpg" style="width:68px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_09_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_09.jpg'"></a></td>
 <
td><a href="include.php?path=contentarchive&type=4" title="Download Übersicht"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_10.jpg" style="width:105px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_10_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_10.jpg'"></a></td>
 <
td><a href="include.php?path=guestbook" title="Unser Gästebuch"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_11.jpg" style="width:109px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_11_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_11.jpg'"></a></td>
 <
td><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_12.jpg" style="width:116px;height:31px;border:0px" /></td>
 <
td><a href="include.php?path=contact" title="Email an den Webmaster"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_13.jpg" style="width:83px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_13_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_13.jpg'"></a></td>
 <
td><a href="include.php?path=content&contentid=4" title="Impressum"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_14.jpg" style="width:80px;height:31px;border:0px" onMouseOver="this.src='images/style/LCL_Style_Fantasy/fantasy_14_o.jpg'" onMouseOut="this.src='images/style/LCL_Style_Fantasy/fantasy_14.jpg'"></a></td>
 <
td><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_15.jpg" style="width:62px;height:31px;border:0px"/></td>
</
tr>
<
tr>
 <
td colspan="12"><img src="http://mygully.com/images/style/LCL_Style_Fantasy/fantasy_17.jpg" style="width:980px;height:176px;border:0px"/></td


Habe versucht, z.b die Spalte mit dem Inprint/Impressum die Verlinkung einfach rausnehmen, und halt die Grafik auszutauschen. Jedoch scheint die Grafik dann kleiner, obwohl sie gleich groß sind, weil am Rande erscheinen dann braune oder mal graue Balken zwischen den Button.

Wer weiß, wie ich das nun anstelle, das zumindest erstmal die Leiste da bleibt, aber die Links weg sind.





Habs nu selbst hingekriegt, einfach <a href="include.php?path=........."> entfernt und die folgenden Pfade zu den Bilddateien auf die jeweilige Blankodatei gelgt.


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:11 Uhr.

Powered by vBulletin® (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.