|
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 |
aerodynamic Smarty n00b
Joined: 04 Sep 2004 Posts: 3
|
Posted: Sat Sep 04, 2004 11:30 am Post subject: Probleme mit If-Entscheidung |
|
|
[php:1:f53dc3523f]<?php
$link = mysql_connect("blabla", "blabla", "blabla");
mysql_select_db("blabla", $link);
define('SMARTY_DIR','/homepages/18/d72843438/htdocs/ich/acog/template/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty->compile_dir = '/homepages/18/d72843438/htdocs/ich/acog/jugend/templates_c/';
$result = mysql_query("SELECT * FROM acog_jugend", $link);
while ($row = mysql_fetch_array($result, MYSQL_BOTH))
{
$id[] = $row["id"];
$name[] = $row["name"];
$vorname[] = $row["vorname"];
$ort[] = $row["ort"];
$motto[] = $row["motto"];
$warum[] = $row["warum"];
$liebling[] = $row["liebling"];
$flugzeuge[] = $row["flugzeuge"];
$sonst[] = $row["sonst"];
$sonst2[] = $row["sonst2"];
}
if($mode=="view")
{
$smarty = new Smarty;
$x=0;
while($x<count($id))
{
$out[] = "<a class=type_2 href=jugend.php?mode=profile&userid=$id[$x]>$vorname[$x] $name[$x]</a><br><trenn>";
$x++;
}
$out = implode('<trenn>',$out);
$smarty->assign('inhalt', $out);
$smarty->display('ju1.html');
}
?>[/php:1:f53dc3523f]
Ich habe die Template Engine bereist mit einem einfacheren Skript getestet (ohne mode=irgendwas) und es geht. Wie muss ich das Skript umschreiben das es geht? Die If-Entscheidung muss jedoch bestehen bleiben. Bzw. muss ich mit datei.php?mode=view etc. auf diverse funktionen gesondert zugreifen können.
kann mir da jemand helfen? |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Sep 06, 2004 6:56 am Post subject: |
|
|
was soll passieren, wenn mode nicht "view" ist? |
|
Back to top |
|
aerodynamic Smarty n00b
Joined: 04 Sep 2004 Posts: 3
|
Posted: Mon Sep 06, 2004 4:43 pm Post subject: |
|
|
es gibt 2 modes... "view" und "profile"... der 2. mode ist aus gründen der übersicht weggelassen... was mir aufgefallen ist das wenn ich diese if-entscheidung aus lasse funktioniert Smarty... mit If-Entscheidung aber nicht. wo ist das Problem? |
|
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
|