schon wieder templates :P

alive

Erfahrenes Mitglied
So da bin ich mal wieder udn mein Problem ist folgendes:
Ich habe mir aus Templates ein News System mit Comments geschrieben....
So ich habe dann in der "more.php", die die Comments anzeigt folgendes stehen:
PHP:
<?php 
include "class/class.FastTemplate.php3";
$tpl = new FastTemplate(".");
$tpl->define(array(
"template" => "news/templ/news.php"
));
include ("mysql/mysql.php");
$q = mysql_query ("SELECT * FROM news WHERE id ='$id'");
while ($a = mysql_fetch_array($q)) {
$c = mysql_query ("SELECT * FROM news_comments WHERE newsid = $a[id]") ;
$erg = mysql_num_rows($c) ;
$tpl->assign("{kommentare}", $erg);
$tpl->assign("{titel}", $a[titel]);
$tpl->assign("{news}", $a[text]);
$tpl->assign("{zeit}", date("H:i",$a[timestamp]));
$tpl->assign("{datum}", date("d.m.Y",$a[timestamp]));
$tpl->assign("{poster}", $a[poster]);
$tpl->assign("{newsid}", $a[id]);
$tpl->assign("{posterid}", $a[posterid]);
$tpl->parse("ausgabe", "template");
$tpl->FastPrint("ausgabe");
}
?>
<br>
<?php 
include "class/class.FastTemplate.php3";
$tpl = new FastTemplate(".");
$tpl->define(array(
"template" => "news/templ/comments.php"
));
include ("mysql/mysql.php");
$s = mysql_query ("SELECT * FROM news_comments WHERE newsid = '$id'");
while ($b = mysql_fetch_array($s)) {
$tpl->assign("{c_titel}", $b[titel]);
$tpl->assign("{c_text}", $b[text]);
$tpl->assign("{c_zeit}", date("H:i",$b[timestamp]));
$tpl->assign("{c_datum}", date("d.m.Y",$b[timestamp]));
$tpl->assign("{c_poster}", $b[poster]);
$tpl->assign("{c_posterid}", $b[posterid]);
$tpl->parse("ausgabe", "template");
$tpl->FastPrint("ausgabe");
}
?>
Der Fehler :
"Fatal error: Cannot redeclare class fasttemplate in C:\wampp2\htdocs\WEBSEITE\class\class.FastTemplate.php3 on line 7"
Was soll ich tun, oder wie kann ich das lösen?
 
Includest du den obigen Code in einer anderen Datei, die ihrerseits bereits die Templateklasse eingebunden hat? Die Fehlermeldung besagt ja, das die entsprechende Klasse schon mal deklariert wurde, d.h. ihr Code steht (mindestens) zweimal im Script. Naheliegend ist daher, dass du sie schlicht zweimal eingebunden hast.
 
Zurück