|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Schebi Smarty Rookie
Joined: 14 Feb 2005 Posts: 5 Location: Berlin
|
Posted: Sat Feb 19, 2005 5:38 pm Post subject: Lokal alles Super ! |
|
|
Habe ein Problem !
Bei mir auf meinem Windowssystem läuft die Seite !
Auf dem Webserver bekomme ich Fehler die ich nicht nachvollziehen kann:
Code: |
Warning: filemtime(): Stat failed for /kunden/83799_13086/webseiten/test/news/news.tpl (errno=2 - No such file or directory) in /kunden/83799_13086/webseiten/test/libs/Smarty.class.php on line 1558
|
Mein Code sieht so aus :
in der Root meine Files :
index.php und news.php
Code: |
<?php
global $inhalt;
global $erg;
global $datei;
require './libs/Smarty.class.php';
include './dbconnect.php';
if ($inhalt == "")
{
$inhalt = "news";
}
$smarty = new Smarty;
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';
$smarty->cache_dir = './cache/';
$smarty->compile_check = true;
$smarty->caching = true;
$smarty->debugging = true;
$smarty->assign('inhalt', $inhalt);
if(file_exists($inhalt.'.php'))
{
$datei = $inhalt.'.php';
include $datei;
}
$smarty->assign('Newserg', $erg);
$smarty->display('index.tpl');
?> |
Code: |
<?php
$query = "SELECT * FROM news WHERE aktiv = 1 ORDER BY ID DESC ";
$erg = mysql_query($query, $dbh);
$ergebnis = array();
$HBGCOLOR = '#808080';
$i=0;
while ($r=mysql_fetch_array($erg)) {
$tmp = array(
'NewsTitel' => $r['NewsTitel'],
'NewsKurz' => $r['NewsKurz'],
'NewsLang' => $r['NewsLang'],
'DatumEröffnet' => $r['DatumEröffnet'],
'DatumGeändert' => $r['DatumGeändert'],
'hervorheben' => $r['hervorheben']
);
$ergebnis[$i++] = $tmp;
}
$smarty->assign('NewsErg', $ergebnis);
?>
|
im Templates meine Datei :
index.tpl
Code: |
{config_load file=test.conf section="setup"}
{include file="header.tpl" title=Schebeko.de}
{include file="$inhalt/index.tpl"}
{include file="footer.tpl"}
|
im Newsunterverzeichnis dann die für die Newsseite:
index.tpl
Code: |
<div height='100%'>
<div class='inhalt' style='position:relative; left:0%; width: 80%; float: left;'>
{include file='./news/news.tpl'}
</div>
<div class='inhalt' style=" position:relative; left:0%; width:20%; top: 10px;">
{literal}
<script language="Javascript" src="http://www.wetter.com/v2/woys2/woys2.js.php?29397,35aca905b0470369997b5f9907a866f2"></script>
{/literal}
</div>
<div class='inhalt' style="position:relative; left:0%; width:20%; top: 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="138">
<tr>
<td>
..... und so weiter
|
Mit dem Einbinden der Dateien hab ich schon fast alles versucht. Mal mit absoluten Pfad mal mit file: etc. keine Ahnung was jetzt falsch ist. Dachte eigentlich das ich es fast eins zu eins übernehmen kann ! Aber siehe da weit gefehlt !
Vielleicht hab ihr ja einen Heissen Tip ich weiss nicht mehr wo ich noch schauen soll. _________________ ______________________________________________________________
Schebi
______________________________________________________________
. : |' Kill all Spamers '| : . |
|
Back to top |
|
T. Smarty Regular
Joined: 22 Aug 2004 Posts: 69 Location: AT
|
Posted: Mon Feb 21, 2005 12:46 pm Post subject: |
|
|
funktioniert nur diese eine Seite nicht oder generell alle Seiten die du uploadest? _________________ Oppossom - Heavy rock from austria |
|
Back to top |
|
Schebi Smarty Rookie
Joined: 14 Feb 2005 Posts: 5 Location: Berlin
|
Posted: Mon Feb 21, 2005 4:36 pm Post subject: |
|
|
Nun scheint es zu funktionieren ! ist es möglich das auf linuxkisten ich keine Variablen nutzen sollte die Umlaute haben ? Weil jetzt bekomme ich folgende Meldung :
Code: |
Fatal error: Smarty error: [in ./news/news.tpl line 6]: syntax error: unrecognized tag: $NewsErg[nr].DatumEröffnet (Smarty_Compiler.class.php, line 403) in /kunden/83799_13086/webseiten/test/libs/Smarty.class.php on line 1102
|
_________________ ______________________________________________________________
Schebi
______________________________________________________________
. : |' Kill all Spamers '| : . |
|
Back to top |
|
Schebi Smarty Rookie
Joined: 14 Feb 2005 Posts: 5 Location: Berlin
|
Posted: Mon Feb 21, 2005 4:42 pm Post subject: |
|
|
Jupp das war das Zweite Problem !
Was der Grund fürs erste war ist mir zwar immer noch nicht klar ! Vielleicht war es einfach am Wochenende auch einfach nur zu spät ! Danke für die Hilfe !
Und das ihr mir zugehört (äähmm Gelesen) habt !
THX und weiter so ! _________________ ______________________________________________________________
Schebi
______________________________________________________________
. : |' Kill all Spamers '| : . |
|
Back to top |
|
T. Smarty Regular
Joined: 22 Aug 2004 Posts: 69 Location: AT
|
Posted: Mon Feb 21, 2005 5:34 pm Post subject: |
|
|
man sollte eigentlich generell in Variablennamen weder Umlaute noch Sonderzeichen verwenden _________________ Oppossom - Heavy rock from austria |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|