<?php
defined (
'main'
)
or
die
(
'no direct access'
);
require_once
(
'include/includes/func/gallery.php'
);
$title
=
$allgAr
[
'title'
].
' :: Galleryupload '
;
$hmenu
=
'Galleryupload'
;
$design
=
new
design (
$title
,
$hmenu
);
$design
->header();
if
(loggedin()) {
# Bilder in eine Kategorie hochladen
$msg
=
''
;
if
(isset(
$_POST
[
'hochladen'
]) AND
$_POST
[
'hochladen'
] ==
'yes'
) {
foreach
(
$_FILES
[
'file'
][
'name'
] AS
$k
=>
$v
) {
if
(!
empty
(
$_FILES
[
'file'
][
'name'
][
$k
])) {
$name
=
$_FILES
[
'file'
][
'name'
][
$k
];
$tmp
=
explode
(
'.'
,
$name
);
$tm1
=
count
(
$tmp
) -1;
$endung
=
$tmp
[
$tm1
];
unset(
$tmp
[
$tm1
]);
$name
= implode(
''
,
$tmp
);
$besch
= escape(
$_POST
[
'besch'
][
$k
],
'string'
);
$id
= db_result(db_query(
"SHOW TABLE STATUS FROM `"
. DBDATE .
"` LIKE 'prefix_gallery_imgs'"
),0,
'Auto_increment'
);
$bild_url
=
'include/images/gallery/img_'
.
$id
.
'.'
.
$endung
;
if
(@move_uploaded_file (
$_FILES
[
'file'
][
'tmp_name'
][
$k
],
$bild_url
)) {
db_query(
"INSERT INTO prefix_gallery_imgs (cat,datei_name,endung,besch) VALUES ("
.
"0,'"
.
$name
.
"','"
.
$endung
.
"','"
.
$besch
.
"')"
);
$msg
.=
'Datei '
.
$name
.
'.'
.
$endung
.
' erfolgreich hochgeladen<br />'
;
$bild_thumb
=
'include/images/gallery/img_thumb_'
.
$id
.
'.'
.
$endung
;
$bild_norm
=
'include/images/gallery/img_norm_'
.
$id
.
'.'
.
$endung
;
create_thumb (
$bild_url
,
$bild_thumb
,
$allgAr
[
'gallery_preview_width'
]);
create_thumb (
$bild_url
,
$bild_norm
,
$allgAr
[
'gallery_normal_width'
]);
}
else
{
$msg
.=
'Datei '
.
$name
.
'.'
.
$endung
.
' konnte nicht hochgeladen werden<br />'
;
}
}
}
}
?>
<table border=
"0"
cellpadding=
"5"
cellspacing=
"1"
class
=
"border"
width=
"100%"
>
<tr>
<td
class
=
"Callg"
><?=
$msg
?>
<form action=
"index.php?galleryupl"
method=
"POST"
enctype=
"multipart/form-data"
>
<input type=
"hidden"
name=
"hochladen"
value=
"yes"
/>
<table border=
"0"
cellpadding=
"5"
cellspacing=
"1"
class
=
"border"
width=
"100%"
>
<tr>
<td
class
=
"Cmite"
>
<input size=
"55"
type=
"file"
name=
"file[]"
/>
<br />Beschreibung: <input type=
"text"
name=
"besch[]"
value=
""
size=
"50"
/>
</td>
</tr><tr>
<td
class
=
"Cdark"
>
<input type=
"submit"
value=
"Absenden"
/>
</td>
</tr>
</table>
</form>
</td>
</tr></table>
<?
}
else
{
echo
'<br>Gäste dürfen keine Bilder in die Gallery hochladen!'
;
$tpl
=
new
tpl (
'user/login'
);
$tpl
->set_out(
'WDLINK'
,
'index.php?galleryupl'
, 0);
}
$design
->footer();
?>