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:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121: | <?php
include("../config.inc.php");
include("../functions.inc.php");
include("login.inc.php");
session_start();
$session_name = session_name();
include("kopf.php");
switch ($action) {
case "insert":
for ($i = 1; $i <= 4; $i++) {
if ($picture[$i]!="" and $picture[$i]!="none") {
$dest = $root . $picture_directory . "/" . $picture_name[$i];
if (!copy($picture[$i], $dest)) echo "<br>Fehler beim Dateiupload!<br>";
$picture_array[] = array("picture" =>$picture_directory . "/" .$picture_name[$i], "description" => $description[$i]);
}
}
break;
case "delete":
foreach ($HTTP_POST_VARS as $elem=>$k) {
if (substr($elem,0,8)=="picture_") {
$id= substr($elem,8);
$file = $root . $picture_array[$id]["picture"];
if (!unlink($file)) echo "<br>Fehler beim Löschen der Datei!<br>";
unset($picture_array[$id]);
}
}
break;
}
session_register("picture_array");
echo "<br>";
?>
<br>
<FORM ENCTYPE="multipart/form-data" ACTION="picture_upload.php?type=<?php echo $type; ?>&action=insert&sid=<?php echo $sid; ?>" METHOD="POST" name="picture">
<input type="hidden" name="picture_directory" value="<?php echo $type ?>">
<table width="98%" border="0" cellspacing="0" cellpadding="4" align="center">
<tr valign="top">
<td width="10%">Picture 1:</td>
<td width="90%"><input name="picture[1]" type="FILE" size="35"></td>
</tr>
<tr valign="top">
<td width="10%">Picture 2:</td>
<td width="90%"><input name="picture[2]" type="FILE" size="35"></td>
</tr>
<tr valign="top">
<td width="10%">Picture 3:</td>
<td width="90%"><input name="picture[3]" type="FILE" size="35"></td>
</tr>
<tr valign="top">
<td width="10%">Picture 4:</td>
<td width="90%"><input name="picture[4]" type="FILE" size="35"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Upload Picture"></td>
</tr>
</table>
</form>
<br>
<?php
if ($picture_array) {
?>
<form name="Screens" method="post" action="picture_upload.php?type=<?php echo $type; ?>&action=delete&sid=<?php echo $sid; ?>">
<table width="98%" border="0" cellspacing="0" cellpadding="4" align="center">
<tr bgcolor="<?php echo $c_head; ?>">
<td width="10%"> </td>
<td width="50%">Datei</td>
<td width="40%" align="left">URL</td>
</tr>
<?php
reset($picture_array);
$k=0;
for ($i = 0; $i < count($picture_array); $i++) {
if ($k==0) {
$backcolor="$c_line1";
$k=1;
}
else {
$backcolor="$c_line2";
$k=0;
}
?>
<tr bgcolor="<?php echo $backcolor; ?>">
<td width="10%">
<input type="checkbox" name="picture_<?php echo key($picture_array); ?>" value="kill">
</td>
<td width="50%">
<a href="<?php echo $siteurl; echo $picture_array[key($picture_array)]["picture"]; ?>" class="news" target="_blank"><?php echo $picture_array[key($picture_array)]["picture"]; ?></a>
</td>
<td width="40%" align="left">
<?php echo $siteurl; echo $picture_array[key($picture_array)]["picture"]; ?>
</td>
</tr>
<?php
next($picture_array);
}
?>
<tr bgcolor="<?php echo $c_head; ?>">
<td width="10%"> </td>
<td width="50%">
<input type="submit" name="button" value="Markierte Datein löschen">
</td>
<td width="40%"> </td>
</tr>
</table>
</form>
<?php
}
?>
<?php
include("fuss.php");
?> |