Zum Inhalt springen

Ausgabe Marker erfolgt vor HTML

Erstellt am 30. Dezember 2008 · 3 Antworten · letzte Antwort am 31. Dezember 2008

Tags: PHP, Frage

MaloDE ·

Hallo an alle!

Ich hab ein seltsames Problem. Ich habe einen Marker ###AUSGABE###. Dieser wird auch wie gewollt ersetzt durch ein PHP Script, welches ich als PHP-Datei abgelegt habe. Nur aus irgendwelchen gründen gibt er den ersetzten Marker ganz am Anfang der Seite aus statt im entsprechenden DIV. Hier mal das Root Template:

page = PAGE
page {
    typeNum = 0

   ### UTF-8 und DocType Angaben ###
   config {
      #doctype = html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
      doctype = xhtml_trans
      doctypeSwitch = 1
      xmlprologue = none
      xhtml_cleaning = all
      htmlTag_langKey = de
      language = de
      metaCharset = utf-8
      additionalHeaders = Content-Type:text/html;charset=utf-8
      }
   
    # Allgemeine Seiteneigenschaften
    stylesheet = fileadmin/css/home.css

   # Designvorlage integrieren
   10 = TEMPLATE
   10.template = FILE
   10.template.file = fileadmin/sub_home.html
   10.workOnSubpart = DOKUMENT


   10.marks {
   
      NAVISUB= HMENU
      NAVISUB.special = directory
      NAVISUB.special.value=2
      NAVISUB.entryLevel=1
      NAVISUB.1 = TMENU

      NAVISUB.1 {

          NO.linkWrap =  |<br>|*||<br>|*||
          NO.ATagParams = class="mainnaviNO"
          ACT = 1
          ACT.linkWrap =  |<br>|*||<br>|*||
          ACT.ATagParams = class="mainnaviACT"
          }

      NAVIMAIN=HMENU
      NAVIMAIN.special = directory
      NAVIMAIN.special.value = 8
      NAVIMAIN.1 = TMENU
      NAVIMAIN.1 {

          expAll = 1
          NO.linkWrap =  |<br>|*||<BR>|*||
          NO.ATagParams = class="subnaviNO"
          ACT = 1
          ACT.linkWrap =  |<br>|*||<BR>|*||
          ACT.ATagParams = class="subnaviNO"
          }

      NAVIMAIN.2 = TMENU
      NAVIMAIN.2 {
       
          NO.linkWrap =  |<br>|*||<BR>|*||<br><br>
          NO.ATagParams = class="subnaviSub"
          ACT = 1
          ACT.linkWrap =  |<br>|*||<BR>|*||<br><br>
          ACT.ATagParams = class="subnaviSubACT"
         }

   }



      #Inhalt
      10.marks.INHALT < styles.content.get

      #Inhalt
      10.marks.AKTUELL < styles.content.getRight

    
}

Auf der entsprechenden Seite habe ich ein Extension Template:

page.10.template.file = fileadmin/sub_ref_overview.html
page.stylesheet = fileadmin/css/ref-overview.css

page.10.marks.AUSGABE = PHP_SCRIPT
page.10.marks.AUSGABE.file = fileadmin/referenzen/overview.php

Die Designvorlage sieht so aus:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
<link href="fileadmin/css/ref-overview.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!--- ###DOKUMENT### start -->
<div id="containerTop">
   <div id="container-head">
      <div id="container-head-logo"><a href="index.php"><img src="fileadmin/gfx/sub_logo.jpg" alt="BOOMBOXX Digitale Medien" width="189" height="47" border="0" /></a></div>
      <div id="container-head-contact"><span class="container-head-contact-span">BOOMBOXX</span> Digitale Medien</div>
  </div>
<div id="container-content">
      <div id="container-content-menu">###NAVIMAIN###</div>
      <div id="container-content-content">###AUSGABE###</div>
   </div>
  <div style="clear:both;"></div>
</div>
<div id="containerBottom">
   <div id="container-footer"></div>
</div>
<!--- ###DOKUMENT### ende -->
</body>
</html>

und zu guter letzt das PHP-Script:

<?php

// Config includen
require("config/config.php");

// Datenbank Connect
$database = mysql_connect($config["dbHost"], $config["dbUser"], $config["dbPassword"]);
mysql_select_db($config["dbName"], $database);
if (!$database) { echo "Error while connecting with database!"; die; } // Error while connecting

?>

<h1>Internetpräsenzen</h1>
<?php

// Records auslesen und anzeigen
$divCol=1;
$qry = mysql_db_query($config["dbName"],"select * from script_referenzen");
echo "ja: ".mysql_num_rows($qry);
while ($records = mysql_fetch_array($qry))
   {
   // Standards setzen für DIV-Ausrichtung
   $margin="0px";
   $float="left";
   
   // Left Margin für mittlere Spalte
   if ($divCol==2)
      {
      $margin="100px;";
      }
      
   // Right Float für rechte Spalte    
   if ($divCol==3)
      {
      $float="right";
      }      
      
   // Ausgabe des DIV
?>
<div style="width:150px; height:120px; margin-bottom:15px; text-align:center; display:inline; float:<?php echo $float; ?>; margin-left:<?php echo $margin; ?>;">
<img src="fileadmin/referenzen/img/overview/<?php echo $records['imgOverview']; ?>.jpg" id="ref<?php echo $records['id']; ?>" alt="<?php echo $records['title']; ?>" width="150" height="90" onmouseover="opacity('ref<?php echo $records['id']; ?>',50,100,500)" onmouseout="opacity('ref<?php echo $records['id']; ?>',100,50,500)" />

</div>
<?php   
   $divCol++;
   if ($divCol == 4) { $divCol=1; }
   }

?>

ERGEBNIS:

<h1>Internetpräsenzen</h1>
ja: 1<div style="width:150px; height:120px; margin-bottom:15px; text-align:center; display:inline; float:left; margin-left:0px;">
<img src="fileadmin/referenzen/img/overview/www_adlerimmobilien.jpg" id="ref1" alt="Adler Immobilien" width="150" height="90" onmouseover="opacity('ref1',50,100,500)" onmouseout="opacity('ref1',100,50,500)" />

</div>
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/boomboxx/fileadmin/referenzen/overview.php:14) in <b>/www/htdocs/boomboxx/typo3/sysext/cms/tslib/class.tslib_fe.php</b> on line <b>2830</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/htdocs/boomboxx/fileadmin/referenzen/overview.php:14) in <b>/www/htdocs/boomboxx/typo3/sysext/cms/tslib/class.tslib_fe.php</b> on line <b>2843</b><br />
<!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" xml:lang="de" lang="de">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- 
	This website is powered by TYPO3 - inspiring people to share!
	TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
	TYPO3 is copyright 1998-2006 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
	Information and contribution at http://typo3.com/ and http://typo3.org/
-->

	<link rel="stylesheet" type="text/css" href="fileadmin/css/ref-overview.css" />
	<title>Projektbeispiele</title>
	<script type="text/javascript" src="typo3temp/javascript_757c080409.js"></script>


</head>
<body>

<div id="containerTop">
   <div id="container-head">
      <div id="container-head-logo"><a href="index.php"><img src="fileadmin/gfx/sub_logo.jpg" alt="BOOMBOXX Digitale Medien" width="189" height="47" border="0" /></a></div>
      <div id="container-head-contact"><span class="container-head-contact-span">BOOMBOXX</span> Digitale Medien&nbsp;&nbsp;//&nbsp;   T: 0 61 84 - 90 02 07   &nbsp;//&nbsp;   <a href="mailto:office@boomboxx.de">office@boomboxx.de</a></div>
  </div>
<div id="container-content">
      <div id="container-content-menu"><a href="index.php?id=9" onfocus="blurLink(this);" class="subnaviNO">Internet</a><br /><a href="index.php?id=18" onfocus="blurLink(this);" class="subnaviSub">Möglichkeiten</a><br /><a href="index.php?id=19" onfocus="blurLink(this);" class="subnaviSub">Projektablauf</a><br /><a href="index.php?id=20" onfocus="blurLink(this);" class="subnaviSub">Typo3? CMS!</a><br /><a href="index.php?id=21" onfocus="blurLink(this);" class="subnaviSub">WebShop</a><br /><br /><a href="index.php?id=10" onfocus="blurLink(this);" class="subnaviNO">Präsentationen</a><br /><a href="index.php?id=12" onfocus="blurLink(this);" class="subnaviSub">Powerpoint</a><br /><a href="index.php?id=13" onfocus="blurLink(this);" class="subnaviSub">Flash</a><br /><br /><a href="index.php?id=11" onfocus="blurLink(this);" class="subnaviNO">Darüber hinaus</a><br /><a href="index.php?id=24" onfocus="blurLink(this);" class="subnaviSub">Print</a><br /><br /><a href="index.php?id=26" onfocus="blurLink(this);" class="subnaviNO">Projektbeispiele</a></div>
      <div id="container-content-content"></div>
   </div>
  <div style="clear:both;"></div>
</div>
<div id="containerBottom">
   <div id="container-footer"></div>
</div>

</body>
</html>

Hat wer von Euch vielleicht eine Idee? Ich bin mit meinem Latein echt am Ende. WÄre nett, wenn sich das mal jemand mit anschauen würde. Ach ja Typo3-Version ist die 4.0.2.

Riesen Dank im Voraus!

Malo

MaloDE ·

hmmm das problem is net dass er keine ausgabe macht, sondern dass er sie "ganz vorne" macht. bisher hatte ich keinerlei probleme damit #paralyzed#

MaloDE ·

okay ich muss wohl einen compare der DB machen. leider geht es irgendwie nicht. habe es nun so gelöst, dass ich ein Inhaltselement PHP Script verwende, dann macht es keinerlei Probleme. Muss halt mal wenn ich Zeit und Lust habe das Typo3 komplett neu aufsetzen.