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

Probleme mit If-Entscheidung

 
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
aerodynamic
Smarty n00b


Joined: 04 Sep 2004
Posts: 3

PostPosted: Sat Sep 04, 2004 11:30 am    Post subject: Probleme mit If-Entscheidung Reply with quote

[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
View user's profile Send private message
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Mon Sep 06, 2004 6:56 am    Post subject: Reply with quote

was soll passieren, wenn mode nicht "view" ist?
Back to top
View user's profile Send private message
aerodynamic
Smarty n00b


Joined: 04 Sep 2004
Posts: 3

PostPosted: Mon Sep 06, 2004 4:43 pm    Post subject: Reply with quote

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
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