maar er moet geen nieuwe file gemaakt worden! per album word er een aparte xml file aangemaakt. Dit is dus de xml-file voor de map Usa:
code:
1
2
3
4
5
| <?xml version='1.0'?> <beschreibung>
<bild><name>+</name><wert> </wert></bild>
<bild><name>CIMG4474_rs.jpg</name><wert>beepo</wert></bild>
<bild><name>sa_CIMG3195_p.jpg</name><wert>beepo2</wert></bild>
</beschreibung> |
nu wil er een upload functie bij maken. Mensen kunnen dan een foto uploaden in een map die ik zelf heb gemaakt bv. 'vakantie'. En als mensen de foto uploaden kunnen ze er ook een beschrijving bij zetten. De beschrijving moeten worden toegevoegd aan de xml-file. Deze regel moet dus worden tóegevoegd aan de xml-file:
<bild><name>CIMG4474_rs.jpg</name><wert>beepo</wert></bild>
Normaal kun je de titel alleen wijzigen als je de admin bent. Dat gaat met het volgende script:
code:
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
122
| <?php
/*************************
Copyright (c) 2004-2006 TinyWebGallery
written by Michael Dempfle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
TWG version: 1.4.2
$Date: 2006/04/25 10:57 $
**********************************************/
require "../config.php";
include "../inc/mysession.inc.php";
include_once "../inc/filefunctions.inc.php";
include "i_parserequest.inc.php";
$titel = '';
if (isset($_GET['twg_titel'])) {
$titel = $_GET['twg_titel'];
} else {
$titel = false;
}
$titel = nl2br($titel);
$titel = stripslashes($titel);
$xmldir = "../" . $xmldir;
include "../inc/readxml.inc.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TinyWebGallery</title>
<meta name="author" content="mid" />
<?php
echo '<meta name="author" content="';
require "../language/language_" . $default_language . ".php";
echo '" />';
if ($login <> "TRUE") {
echo $lang_email_admin_notloggedin;
return;
}
if (isset($charset)) {
set_error_handler("on_error_no_output"); // using utf-8 gives a warning i don't care
header("Content-Type: text/html;charset=' . $charset . '");
set_error_handler("on_error");
echo '<META http-equiv="Content-Type" content="text/html; charset=' . $charset . '"/>';
// we have to store the utf8 comments html encoded because otherwise the site mixup would not work!
$titel = htmlentities($titel, ENT_QUOTES, $charset);
}
?>
<link rel="stylesheet" type="text/css" href="iframe.css" />
<script type="text/javaScript">reload = false;</script>
<script type="text/javaScript" src="../js/twg_image.js"></script>
<?php
include "i_key.inc.php";
?>
</head>
<body onload="makeFocus('twg_titel')">
<form action=" <?php print $_SERVER['PHP_SELF']; ?> " method="get">
<table summary='' style="width: 100%; height:100%" cellpadding='0' cellspacing='0'><tr><td class="closebutton">
[img]"../buttons/close.gif"[/img]
</td></tr><tr><td>
<input name="twg_album" type="hidden" value=" <?php echo encodespace($twg_album);
?> "/>
<input name="twg_show" type="hidden" value=" <?php echo encodespace($image);
?> "/>
<?php echo $hiddenvals; ?>
<?php
if ($titel == false) {
echo $lang_titel_php_titel;
} else {
$_SESSION["actalbum"] = "LOAD NEW";
loadXMLFiles(urldecode($twg_album));
saveBeschreibung($titel, $twg_album, $image, $werte, $index);
if (isset($_GET["PHPSESSID"])) {
$closescript = "<script>closeiframe(); if (reload) { parent.location='" . urldecode($twg_root) ."?PHPSESSID=" . $_GET["PHPSESSID"] . "&twg_album=" . $album_enc . "&twg_show=" . $image_enc . $twg_standalonejs . "' }</script>";
} else {
$closescript = "<script>closeiframe(); if (reload) { parent.location='" . urldecode($twg_root) ."?twg_album=" . $album_enc . "&twg_show=" . $image_enc . $twg_standalonejs . "' }</script>";
}
// $closescript = "<script>closeiframe(); if (reload) { parent.location.reload(); }</script>";
echo $closescript;
}
echo'
<center>[img]"../buttons/1x1.gif"[/img]<table summary=""><tr><td>';
if ($enable_smily_support) {
echo'
[img]"../buttons/smilie.gif"[/img]</td><td>[img]"../buttons/1x1.gif"[/img]</td><td>';
}
?>
<input id="twg_titel" name="twg_titel" type="text" size="25"/>
[img]"../buttons/1x1.gif"[/img]
<input type="submit" name="twg_submit" value=" <?php echo $lang_titel_php_save ?> "/>
</td></tr></table>
</center>
</td></tr></table>
</form>
<?php
if ($enable_smily_support) {
echo '
<div id="twg_smilie" class="twg_smiliediv"><table summary="" cellpadding="0" cellspacing="0"><tr><td class="twg_smilie">'. create_smilie_div() . '</td></tr></table></div>
<div id="twg_smilie_bord" class="twg_smiliedivborder" onmouseover="javascript:hide_smilie_div()" ></div>
';
}
?>
<?php include "i_bottom.inc.php"; ?>
</body>
</html> |
weet iemand hoe ik dat stukje kan 'includen' bij het upload form?
alvast bedankt!
[
Voor 22% gewijzigd door
annuh op 03-07-2006 10:31
]