| 1 |
lars |
1 |
<?
|
|
|
2 |
$self=basename($PHP_SELF);
|
|
|
3 |
$DB="gaestebuch_design";
|
|
|
4 |
require_once "../connect2.php";
|
|
|
5 |
require_once "../webs.php";
|
|
|
6 |
if ($action)
|
|
|
7 |
{
|
|
|
8 |
$query = "insert into $DB (site,erstellt_am,erstellt_von,letzte_Aenderung_am,letzte_Aenderung_von) VALUES ('$site',NOW(),'$PHP_AUTH_USER',NOW(),'$PHP_AUTH_USER')";
|
|
|
9 |
$result = mysql_query ($query);
|
|
|
10 |
|
|
|
11 |
unset($HTTP_POST_VARS[action]);
|
|
|
12 |
|
|
|
13 |
// ######################################################################################
|
|
|
14 |
$conn_id = ftp_connect("$webs[FTP_server]");
|
|
|
15 |
if ($webs[FTP_passiv])
|
|
|
16 |
{
|
|
|
17 |
// ftp_pasv ($conn_id,1);
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
$login_result = ftp_login($conn_id, "$webs[FTP_user]", "$webs[FTP_passwd]");
|
|
|
21 |
// Verbindung überprüfen
|
|
|
22 |
if ((!$conn_id) || (!$login_result))
|
|
|
23 |
{
|
|
|
24 |
echo "Ftp-Verbindung nicht hergestellt!";
|
|
|
25 |
echo "Verbindung mit $ftp_server als Benutzer $user nicht möglich";
|
|
|
26 |
die;
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
foreach(array_keys($HTTP_POST_VARS) as $elem)
|
|
|
30 |
{
|
|
|
31 |
if ($elem[0] == "_")
|
|
|
32 |
{
|
|
|
33 |
unset($HTTP_POST_VARS[$elem]);
|
|
|
34 |
$button=$$elem;
|
|
|
35 |
$elem=substr($elem,1);
|
|
|
36 |
$Pfad=$HTTP_POST_VARS[$elem."_Pfad"];
|
|
|
37 |
unset($HTTP_POST_VARS[$elem."_Pfad"]);
|
|
|
38 |
$image=$$elem;
|
|
|
39 |
$image_name=$elem."_name";
|
|
|
40 |
$image_name=urlencode($$image_name);
|
|
|
41 |
switch ($button)
|
|
|
42 |
{
|
|
|
43 |
case 0:
|
|
|
44 |
break;
|
|
|
45 |
case 1:
|
|
|
46 |
$HTTP_POST_VARS[$elem]='';
|
|
|
47 |
break;
|
|
|
48 |
case 2:
|
|
|
49 |
if ($image != "none")
|
|
|
50 |
{
|
|
|
51 |
$image_name=$elem.strrchr($image_name,".");
|
|
|
52 |
$HTTP_POST_VARS[$elem]=$image_name;
|
|
|
53 |
//copy($image,$Pfad.$image_name);
|
|
|
54 |
|
|
|
55 |
$upload = ftp_put($conn_id, "$Pfad$image_name", "$image", FTP_BINARY);
|
|
|
56 |
if (!$upload)
|
|
|
57 |
{
|
|
|
58 |
echo "Ftp upload war fehlerhaft!";
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
break;
|
|
|
62 |
default:
|
|
|
63 |
break;
|
|
|
64 |
}
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
ftp_quit($conn_id);
|
|
|
68 |
|
|
|
69 |
// ######################################################################################
|
|
|
70 |
|
|
|
71 |
$names=array();
|
|
|
72 |
foreach(array_keys($HTTP_POST_VARS) as $elem)
|
|
|
73 |
{
|
|
|
74 |
array_push($names,"$elem='$HTTP_POST_VARS[$elem]'");
|
|
|
75 |
}
|
|
|
76 |
$query="update $DB set letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER', ".join($names,', ');
|
|
|
77 |
$query=$query." where site = '$site'";
|
|
|
78 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
79 |
require_once "update_file.php";
|
|
|
80 |
header("Location: ".$self);
|
|
|
81 |
}
|
|
|
82 |
?>
|
|
|
83 |
|
|
|
84 |
<html>
|
|
|
85 |
<head>
|
|
|
86 |
<title>Content-Management-System - Webagentur Niewerth</title>
|
|
|
87 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
88 |
<script language="JavaScript">
|
|
|
89 |
<!--
|
|
|
90 |
function MM_swapImgRestore() { //v3.0
|
|
|
91 |
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
function MM_preloadImages() { //v3.0
|
|
|
95 |
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
|
|
|
96 |
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
|
|
|
97 |
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
function MM_swapImage() { //v3.0
|
|
|
101 |
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
|
|
|
102 |
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
function MM_findObj(n, d) { //v4.0
|
|
|
106 |
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
|
|
|
107 |
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
|
|
|
108 |
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
|
|
|
109 |
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
|
|
|
110 |
if(!x && document.getElementById) x=document.getElementById(n); return x;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
//-->
|
|
|
114 |
</script>
|
|
|
115 |
<script language="javascript" src="../Farb_Assistent.js"></script>
|
|
|
116 |
<meta name="description" content="Redaktionssystem">
|
|
|
117 |
<meta name="author" content="Webagentur Niewerth">
|
|
|
118 |
<meta name="robots" content="noindex">
|
|
|
119 |
<link rel=stylesheet type="text/css" href="../buttons.css">
|
|
|
120 |
<style type="text/css"><? require_once "../buttons.css"; ?></style>
|
|
|
121 |
</head>
|
|
|
122 |
|
|
|
123 |
<body bgcolor="#<? echo $webs[bgcolor_seite]; ?>" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages('../images/navigation/bt_neu_f2.gif','../images/navigation/bt_delete_f2.gif','../images/navigation/bt_bearbeiten_f2.gif')" text="#000000">
|
|
|
124 |
<form method="post" action="#" name="formname" enctype="multipart/form-data">
|
|
|
125 |
<table width="555" border="0" cellspacing="0" cellpadding="0">
|
|
|
126 |
<tr valign="top">
|
|
|
127 |
<td width="485">
|
|
|
128 |
<?
|
|
|
129 |
$result = mysql_query ("SELECT * FROM $DB where site='$site'") or die (mysql_errno().": ".mysql_error());
|
|
|
130 |
$zeile=mysql_fetch_array($result);
|
|
|
131 |
?>
|
|
|
132 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
133 |
<tr bgcolor="#<? echo $webs[bgcolor_links] ?>">
|
|
|
134 |
<td colspan="3" class="headline">Gästebuchdesign: Bearbeiten
|
|
|
135 |
</td>
|
|
|
136 |
</tr>
|
|
|
137 |
<tr>
|
|
|
138 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105" rowspan="2">Hintergrund:</td>
|
|
|
139 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>" colspan="2">
|
|
|
140 |
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
|
141 |
<tr>
|
|
|
142 |
<td nowrap width="60%">Farbe: #
|
|
|
143 |
<input type="text" name="bgcolor" size="6" maxlength="6" value="<? echo $zeile[bgcolor] ?>">
|
|
|
144 |
<input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.bgcolor.value,'document.formname.bgcolor.value');" name="button">
|
|
|
145 |
</td>
|
|
|
146 |
<td width="40%" align="center">
|
|
|
147 |
<table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
|
|
|
148 |
<tr>
|
|
|
149 |
<td bgcolor="<? echo $zeile[bgcolor] ?>"> </td>
|
|
|
150 |
</tr>
|
|
|
151 |
</table>
|
|
|
152 |
</td>
|
|
|
153 |
</tr>
|
|
|
154 |
</table>
|
|
|
155 |
</td>
|
|
|
156 |
</tr>
|
|
|
157 |
<tr>
|
|
|
158 |
<td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
159 |
<?
|
|
|
160 |
$image_name="background";
|
|
|
161 |
$image_Path="/images/gaestebuch/";
|
|
|
162 |
?>
|
|
|
163 |
<input type="hidden" name="<? echo $image_name ?>_Pfad" value="<? echo $image_Path ?>">
|
|
|
164 |
<?
|
|
|
165 |
if ($zeile[$image_name] != "")
|
|
|
166 |
{
|
|
|
167 |
?>
|
|
|
168 |
<input type="radio" name="_<? echo $image_name ?>" value="0" checked>
|
|
|
169 |
<a href="http://www.<? echo $site.$image_Path.$zeile[$image_name] ?>" target="blank">
|
|
|
170 |
<? echo $zeile[$image_name]; ?>
|
|
|
171 |
</a> <BR>
|
|
|
172 |
<?
|
|
|
173 |
}
|
|
|
174 |
?>
|
|
|
175 |
<input type="radio" name="_<? echo $image_name ?>" value="1" <? if ($zeile[$image_name] == "") {echo "checked";}?>>
|
|
|
176 |
kein Bild<br>
|
|
|
177 |
<input type="radio" name="_<? echo $image_name ?>" value="2">
|
|
|
178 |
<input type="File" name="<? echo $image_name ?>" size="17" maxlength="255" onFocus="this.form._<? echo $image_name ?>[<? if ($zeile[$image_name] != "") {echo "2";} else {echo "1";} ?>].checked=true;">
|
|
|
179 |
</td>
|
|
|
180 |
</tr>
|
|
|
181 |
<tr>
|
|
|
182 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105" rowspan="2">Text:</td>
|
|
|
183 |
<td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
184 |
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
|
185 |
<tr>
|
|
|
186 |
<td nowrap width="60%">Farbe: #
|
|
|
187 |
<input type="text" name="textcolor" size="6" maxlength="6" value="<? echo $zeile[textcolor] ?>">
|
|
|
188 |
<input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.textcolor.value,'document.formname.textcolor.value');" name="button">
|
|
|
189 |
</td>
|
|
|
190 |
<td width="40%" align="center">
|
|
|
191 |
<table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
|
|
|
192 |
<tr>
|
|
|
193 |
<td bgcolor="<? echo $zeile[textcolor] ?>"> </td>
|
|
|
194 |
</tr>
|
|
|
195 |
</table>
|
|
|
196 |
</td>
|
|
|
197 |
</tr>
|
|
|
198 |
</table>
|
|
|
199 |
</td>
|
|
|
200 |
</tr>
|
|
|
201 |
<tr>
|
|
|
202 |
<td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">Art:
|
|
|
203 |
<select name="textart" size="1">
|
|
|
204 |
<option value="Arial, Helvetica, sans-serif"<? if ($zeile[textart] == "Arial, Helvetica, sans-serif") {echo " selected";} ?>>Arial</option>
|
|
|
205 |
<option value="Times New Roman, Times, serif"<? if ($zeile[textart] == "Times New Roman, Times, serif") {echo " selected";} ?>>Times New Roman</option>
|
|
|
206 |
<option value="Courier New, Courier, mono"<? if ($zeile[textart] == "Courier New, Courier, mono") {echo " selected";} ?>>Courier</option>
|
|
|
207 |
<option value="Verdana, Arial, Helvetica, sans-serif"<? if ($zeile[textart] == "Verdana, Arial, Helvetica, sans-serif") {echo " selected";} ?>>Verdana</option>
|
|
|
208 |
</select>
|
|
|
209 |
Größe:
|
|
|
210 |
<? if (!$zeile[textgroesse]) {$zeile[textgroesse]=2;} ?>
|
|
|
211 |
<select name="textgroesse" size="1">
|
|
|
212 |
<option<? if ($zeile[textgroesse] == "1") {echo " selected";} ?>>1</option>
|
|
|
213 |
<option<? if ($zeile[textgroesse] == "2") {echo " selected";} ?>>2</option>
|
|
|
214 |
<option<? if ($zeile[textgroesse] == "3") {echo " selected";} ?>>3</option>
|
|
|
215 |
<option<? if ($zeile[textgroesse] == "4") {echo " selected";} ?>>4</option>
|
|
|
216 |
<option<? if ($zeile[textgroesse] == "5") {echo " selected";} ?>>5</option>
|
|
|
217 |
<option<? if ($zeile[textgroesse] == "6") {echo " selected";} ?>>6</option>
|
|
|
218 |
</select>
|
|
|
219 |
</td>
|
|
|
220 |
</tr>
|
|
|
221 |
<tr>
|
|
|
222 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105">Trennbild:</td>
|
|
|
223 |
<td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
224 |
<?
|
|
|
225 |
$image_name="trennbild";
|
|
|
226 |
$image_Path="/images/gaestebuch/";
|
|
|
227 |
?>
|
|
|
228 |
<input type="hidden" name="<? echo $image_name ?>_Pfad" value="<? echo $image_Path ?>">
|
|
|
229 |
<?
|
|
|
230 |
if ($zeile[$image_name] != "")
|
|
|
231 |
{
|
|
|
232 |
?>
|
|
|
233 |
<input type="radio" name="_<? echo $image_name ?>" value="0" checked>
|
|
|
234 |
<a href="http://www.<? echo $site.$image_Path.$zeile[$image_name] ?>" target="blank">
|
|
|
235 |
<? echo $zeile[$image_name]; ?>
|
|
|
236 |
</a> <BR>
|
|
|
237 |
<?
|
|
|
238 |
}
|
|
|
239 |
?>
|
|
|
240 |
<input type="radio" name="_<? echo $image_name ?>" value="1" <? if ($zeile[$image_name] == "") {echo "checked";}?>>
|
|
|
241 |
kein Bild<br>
|
|
|
242 |
<input type="radio" name="_<? echo $image_name ?>" value="2">
|
|
|
243 |
<input type="File" name="<? echo $image_name ?>" size="17" maxlength="255" onFocus="this.form._<? echo $image_name ?>[<? if ($zeile[$image_name] != "") {echo "2";} else {echo "1";} ?>].checked=true;">
|
|
|
244 |
</td>
|
|
|
245 |
</tr>
|
|
|
246 |
<? if ($ID) {?>
|
|
|
247 |
<tr bgcolor="#<? echo $webs[bgcolor_links] ?>">
|
|
|
248 |
<td class="headline" colspan="4">Datensatz:</td>
|
|
|
249 |
</tr>
|
|
|
250 |
<tr>
|
|
|
251 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="105">erstellt:</td>
|
|
|
252 |
<td colspan="3" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">am:
|
|
|
253 |
<? $erstellt_am=datetime2human($zeile[erstellt_am]); ?>
|
|
|
254 |
<? echo $erstellt_am[Datum] ?>
|
|
|
255 |
um:
|
|
|
256 |
<? echo $erstellt_am[Zeit] ?>
|
|
|
257 |
von:
|
|
|
258 |
<? echo $zeile[erstellt_von] ?>
|
|
|
259 |
</td>
|
|
|
260 |
</tr>
|
|
|
261 |
<tr>
|
|
|
262 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="105" nowrap>letzte Änderung:</td>
|
|
|
263 |
<td colspan="3" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">am:
|
|
|
264 |
<? $letzte_Aenderung_am=datetime2human($zeile[letzte_Aenderung_am]); ?>
|
|
|
265 |
<? echo $letzte_Aenderung_am[Datum] ?>
|
|
|
266 |
um:
|
|
|
267 |
<? echo $letzte_Aenderung_am[Zeit] ?>
|
|
|
268 |
von:
|
|
|
269 |
<? echo $zeile[letzte_Aenderung_von] ?>
|
|
|
270 |
</td>
|
|
|
271 |
</tr>
|
|
|
272 |
<? } ?>
|
|
|
273 |
<tr bgcolor="#<? echo $webs[bgcolor_links] ?>">
|
|
|
274 |
<td align="right" colspan="3">
|
|
|
275 |
<input type="submit" name="action" value="OK">
|
|
|
276 |
<input type="reset" name="Button" value="Zurücksetzen">
|
|
|
277 |
</td>
|
|
|
278 |
</tr>
|
|
|
279 |
</table>
|
|
|
280 |
</td>
|
|
|
281 |
</tr>
|
|
|
282 |
</table>
|
|
|
283 |
</form>
|
|
|
284 |
</body>
|