Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Fehler beim Includieren...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
mix
Smarty n00b


Joined: 21 Jun 2004
Posts: 4

PostPosted: Tue Jun 22, 2004 10:37 am    Post subject: Fehler beim Includieren... Reply with quote

hi leute

em jo ich bin an meinem eigenen cms und das will ich mit der smarty template engine realisieren.

und da hab ich jetzt die navigation erfolgreich gemacht und will nun die navigation in den block der links ist, einbinden. nun geht das aber nicht Wink

und es gibt den fehler aus:

http://mix.mittelerde.ch/beta/left.php wrote:

Fatal error: Smarty error: [in navigation.mod.php line 27]: syntax error: unrecognized tag: $nav[] = array( 'id' => $row['id'], 'name' => $row['name'], 'url' => $row['url'], 'position' => $row['position'], 'visible' => $row['visible']); (Smarty_Compiler.class.php, line 403) in /home/mix88/mix.mittelerde.ch/htdocs/beta/smarty/Smarty.class.php on line 1102


nun... jetzt die codes in dem die fehler sein sollten...

left.php
[php:1:51c3bff6c8]
//.....
$table = $db_praefix."_modules";
// Aus der Tabelle werden die module ausgewählt, welche zu sehen sein sollen und auf der linken seite sein sollen. Weiter wird nach der position geordnet.
$sql = "SELECT * FROM ".$table." WHERE visible=1 AND align=1 ORDER BY position ASC";
$res = mysql_query($sql) or die(mcms_error($table,$db_praefix));
// Selbsterklärend...
while($row = mysql_fetch_array($res))
{
$id = $row["id"];
$name = $row["name"];
$file = $row["file"];
$title = $row["title"];
$visible = $row["visible"];
$align = $row["align"];
$position = $row["position"];

// Falls $file existiert...
if(file_exists($file))
{
// ....soll smarty das file assignen.
$smarty->assign("left_output",$file);
}
else
{
// Andernfalls einen Fehler ausgeben
echo 'Fehler';
}
}

// Das ganze ausparsen in left.tpl
$smarty->display('left.tpl');
?>
[/php:1:51c3bff6c8]

left.tpl
Code:

{*Smarty*}
            <tr>
              <td>
                <table border="0" cellpadding="0" cellspacing="0" align="center">
                  <tr>
                    <td>
                      <table border="0" cellpadding="0" cellspacing="0" align="center">
                        <tr>
                          <td>
                            <table border="0" cellpadding="0" cellspacing="0" align="left">
                              {include file=$left_output}                           
                            </table>
                          </td>


navigation.mod.php
[php:1:51c3bff6c8]
//.....
$table = $db_praefix."_navigation";
// Navigation aus Tabelle auslesen
$sql = "SELECT * FROM ".$table." WHERE visible=1 ORDER BY position DESC";
$res = mysql_query($sql) or die(mcms_error($table,$db_praefix));

while($row = mysql_fetch_array($res))
{
$nav[] = array(
'id' => $row['id'],
'name' => $row['name'],
'url' => $row['url'],
'position' => $row['position'],
'visible' => $row['visible']);

}
// Assignen
$smarty->assign("nav",$nav);

$table = $db_praefix."_modules";
// Ueberschrift der Navigation auslesen
$sql = "SELECT * FROM ".$table." WHERE file='navigation_mod.php'";
$res = mysql_query($sql) or die(mcms_error($table,$db_praefix));

while($row = mysql_fetch_array($res))
{
$title = $row["title"];
// Assignen
$smarty->assign("title",$title);
}

$smarty->display("navigation.mod.tpl");
?>
[/php:1:51c3bff6c8]

navigation.mod.tpl
Code:

{* Smarty *}
                               
                                  <tr>
                                    <td>
                                      <table class="side" border="0" cellpadding="0" cellspacing="0" align="left">
                                        <tr>
                                          <td class="side_title">{$title}</td>
                                        </tr>
                                        <tr>
                                          <td class="side">{foreach from=$nav item=n}{if $n.url == ""}<b>{$n.name}</b>{else}&&<a href="{$n.url}">{$n.name}</a>{/if}<br />                                {/foreach}</td>
                                        </tr>
                                      </table>
                                    </td>
                                  </tr>



so .. ich hoffe man kommt einigermassen draus was ich machen möchte Wink

thx für die antworten...

gruss
mix
Back to top
View user's profile Send private message
mix
Smarty n00b


Joined: 21 Jun 2004
Posts: 4

PostPosted: Wed Jun 23, 2004 5:48 pm    Post subject: Reply with quote

hm..habs selber lösen können :>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP