Thread Problem mit Listenfeld (6 answers)
Opened by Tom at 2004-12-10 18:36

Tom
 2004-12-12 17:21
#25883 #25883
User since
2003-09-20
470 Artikel
BenutzerIn
[Homepage] [default_avatar]
Also das ist das Template

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<TMPL_IF NAME="FORMULAR">
<form name="smilie" method="post" action="<TMPL_VAR NAME=CGI_PATH>admin/admin_smilies.cgi">
<table align="center" border="1" bordercolor="#999999" cellpadding="4" cellspacing="0" style="margin-top:10px;">
<tr>
<td colspan="3" class="td" align="center"><b>Neuen Smilie hinzufügen</b></td>
</tr>
<tr>
<td width="50%" class="tdinput">Code:</td>
<td colspan="2" width="50%" class="admintdinput"><input type="text" name="code" size="35" value=<TMPL_VAR NAME=CODE>></td>
</tr>
<tr>
<td width="50%" class="tdinput">Smilie:</td>
<td width="40%" class="admintdinput">
<select name="bilddatei" onChange="document.getElementById('bild').src=this.value;">
<TMPL_LOOP NAME=LOOP>
<option value="<TMPL_VAR NAME=IMAGES_PATH>/smilies/<TMPL_VAR NAME=SMILIE>"><TMPL_VAR NAME=SMILIE></option>
</TMPL_LOOP>
</select>
</td>
<td width="10%" align="center" class="admintdinput"><img src="<TMPL_VAR NAME=IMAGES_PATH>/smilies/<TMPL_VAR NAME=BILD>" id="bild" /></td>
</tr>

<tr>
<td width="50%" class="tdinput">Beschreibung:</td>
<td colspan="2" width="50%" class="admintdinput"><input type="text" name="beschreibung" size="35" value=<TMPL_VAR NAME=BESCHREIBUNG>></td>
</tr>
<tr>
<td colspan="3" class="td" align="center">
<input type="submit" name="aktion" value="Speichern" />
</td>
</tr>
</table>
</form>
</TMPL_IF>


Und das die Perl-Datei

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
if ($aktion eq "Neuen Smilie hinzufügen")
{
@directories = ("C:\\Projekte\\Eventmanager\\mysql\\bilder\\smilies");
@dateien = ();
find(sub {push(@dateien,$_) unless $_ eq '.' or $_ eq '..' or $_ eq 'Thumbs.db'},@directories);

my $subtemplate = HTML::Template->new(filename => 'smilies.tmpl',
path => [ $absolut_path . '\templates\standard\admin']);
my $navtemplate = HTML::Template->new(filename => 'admin_index.tmpl',

path => [ $absolut_path . '\templates\standard\admin']);


@bilder = @dateien;

print "Content-Type: text/html\n\n";
print $header->output;
$subtemplate->param(ANZEIGE => 0);
$subtemplate->param(FORMULAR => 1);
while (@dateien) {
my %row_data;

$row_data{SMILIE} = shift @dateien;

push(@loop_data, \%row_data);
}
$footer->param(SESSION => "$sid");
$footer->param(ID => "$id");
$navtemplate->param(SESSION => "$sid");
$navtemplate->param(ID => "$id");
$navtemplate->param(CGI_PATH => $cgi_path);
$subtemplate->param(LOOP => \@loop_data);
$subtemplate->param(BILD => $bilder[0]);
$subtemplate->param(IMAGES_PATH => $images_path);
$content = $subtemplate->output();
$navcontent = $navtemplate->output();

$template->param(CONTENT => $content);
$template->param(NAVCONTENT => $navcontent);

print $template->output;
print $footer->output;
exit;
}


Tom
Computerprobleme??? -> http://www.weber-computerhilfe.de

Fordere keine Anerkennung!
Zeige was und man wird Dich kennen

View full thread Problem mit Listenfeld