insertfile.php
11.5 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<?php
define('EmpireCMSAdmin','1');
require('../../../../class/connect.php');
require("../../../../class/db_sql.php");
require("../../../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=3;
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
$filename=ehtmlspecialchars($_GET['filename']);
$ecms=ehtmlspecialchars($_GET['ecms']);
if($ecms=="pic")
{
$title="插入圖片";
}
elseif($ecms=="flash")
{
$title="插入FLASH";
}
elseif($ecms=="rm")
{
$title="插入視頻文件";
}
else
{
$title="插入附件";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=$title?></title>
<link href="../../../../data/images/css.css" rel="stylesheet" type="text/css">
<head>
</head>
<body>
<?
if($ecms=="pic")
{
?>
<script src="../../../../data/js/pagejs.js"></script>
<script>
function SetPicOk(ecms){
var height=document.insertpic.height.value;
var width=document.insertpic.width.value;
var border=document.insertpic.border.value;
var picsay=document.insertpic.picsay.value;
var addjs=0,imgstr="";
imgstr="<img src='<?=$filename?>'";
if(document.insertpic.addjs.checked)
{
addjs=1;
imgstr+=" onload=\"autosimg(this);\" onmousewheel=\"return zoomimg(this);\"";
}
if(!(height==""||height==0))
{
imgstr+=" height="+height;
}
if(!(width==""||width==0))
{
imgstr+=" width="+width;
}
imgstr+=" border="+border;
imgstr="<a href=\"<?=$filename?>\" target=_blank title=\"點擊查看原圖\">"+imgstr+"></a>";
if(picsay!="")
{
imgstr+="<br><span style='line-height=18pt'>"+picsay+"</span>";
}
imgstr='<center>'+imgstr+'</center>';
if(ecms==0)
{
window.viewpic.innerHTML=imgstr;
}
else
{
window.returnValue=imgstr;
window.close();
}
}
</script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
<form name="insertpic" method="post" action="">
<tr class="header">
<td height="23">插入圖片設置</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">寬度
<input name="width" type=text id="width" value="0" size="4">
× 高度
<input name="height" type=text id="height" value="0" size="4">
邊框
<input name="border" type="text" id="border" value="0" size="4"> <input name="addjs" type="checkbox" id="addjs3" value="1">
自動縮放 </td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">圖片下面顯示文字
<input name="picsay" type="text" id="picsay" size="30"></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> <input type="button" name="Submit" value="插入圖片" onclick="SetPicOk(1);">
<input type="button" name="Submit3" value="預覽圖片" onclick="SetPicOk(0);">
<input type="button" name="Submit2" value="取消" onclick="window.close();"></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td id="viewpic"></td></tr>
</table>
</td>
</tr>
</form>
</table>
<?
}
elseif($ecms=="flash")
{
?>
<script>
function SetPicOk(ecms){
var height=document.insertpic.height.value;
var width=document.insertpic.width.value;
var picsay=document.insertpic.picsay.value;
var imgstr="";
if(height==""||height=="0"||width==""||width=="0")
{
alert("請輸入高度與寬度");
return false;
}
imgstr="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\"<?=$filename?>\"><param name=\"quality\" value=\"high\"><embed src=\"<?=$filename?>\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\"></embed></object>";
if(picsay!="")
{
imgstr+="<br><span style='line-height=18pt'>"+picsay+"</span>";
}
imgstr='<center>'+imgstr+'</center>';
if(ecms==0)
{
window.viewpic.innerHTML=imgstr;
}
else
{
window.returnValue=imgstr;
window.close();
}
}
</script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
<form name="insertpic" method="post" action="">
<tr class="header">
<td height="23">插入FLASH設置</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">寬度
<input name="width" type=text id="width" value="480" size="6">
× 高度
<input name="height" type=text id="height" value="360" size="6">
</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">FLASH下面顯示文字
<input name="picsay" type="text" id="picsay" size="30"></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> <input type="button" name="Submit" value="插入FLASH" onclick="SetPicOk(1);">
<input type="button" name="Submit3" value="預覽效果" onclick="SetPicOk(0);">
<input type="button" name="Submit2" value="取消" onclick="window.close();"></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td id="viewpic"></td></tr>
</table>
</td>
</tr>
</form>
</table>
<?
}
elseif($ecms=="rm")
{
?>
<script>
function SetPicOk(ecms){
var height=document.insertpic.height.value;
var width=document.insertpic.width.value;
var toplay=document.insertpic.toplay.value;
var playmod=document.insertpic.playmod.value;
var picsay=document.insertpic.picsay.value;
var imgstr="";
var autostart;
if(height==""||height==0||width==""||width==0)
{
alert("請輸入高度與寬度");
return false;
}
autostart="true";
if(playmod==1)
{
autostart="false";
}
if(toplay==0)
{
imgstr="<object align=middle classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" class=\"OBJECT\" id=\"MediaPlayer\" width=\""+width+"\" height=\""+height+"\"><PARAM NAME=\"AUTOSTART\" VALUE=\""+autostart+"\"><param name=\"ShowStatusBar\" value=\"-1\"><param name=\"Filename\" value=\"<?=$filename?>\"><embed type=\"application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" flename=\"mp\" src=\"<?=$filename?>\" width=\""+width+"\" height=\""+height+"\"></embed></object>";
}
else
{
imgstr="<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" HEIGHT=\""+height+"\" ID=\"Player\" WIDTH=\""+width+"\" VIEWASTEXT><param NAME=\"_ExtentX\" VALUE=\"12726\"><param NAME=\"_ExtentY\" VALUE=\"8520\"><param NAME=\"AUTOSTART\" VALUE=\""+autostart+"\"><param NAME=\"SHUFFLE\" VALUE=\"0\"><param NAME=\"PREFETCH\" VALUE=\"0\"><param NAME=\"NOLABELS\" VALUE=0><param NAME=CONTROLS VALUE=ImageWindow><param NAME=CONSOLE VALUE=_master><param NAME=LOOP VALUE=0><param NAME=NUMLOOP VALUE=0><param NAME=CENTER VALUE=0><param NAME=MAINTAINASPECT VALUE=\"<?=$filename?>\"><param NAME=BACKGROUNDCOLOR VALUE=\"#000000\"></object><br><object CLASSID=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" HEIGHT=32 ID=\"Player\" WIDTH=\""+width+"\" VIEWASTEXT><param NAME=_ExtentX VALUE=18256><param NAME=_ExtentY VALUE=794><param NAME=AUTOSTART VALUE=\""+autostart+"\"><param NAME=SHUFFLE VALUE=0><param NAME=PREFETCH VALUE=0><param NAME=NOLABELS VALUE=0><param NAME=CONTROLS VALUE=controlpanel><param NAME=CONSOLE VALUE=_master><param NAME=LOOP VALUE=0><param NAME=NUMLOOP VALUE=0><param NAME=CENTER VALUE=0><param NAME=MAINTAINASPECT VALUE=0><param NAME=BACKGROUNDCOLOR VALUE=\"#000000\"><param NAME=SRC VALUE=\"<?=$filename?>\"></object>";
}
if(picsay!="")
{
imgstr+="<br><span style='line-height=18pt'>"+picsay+"</span>";
}
imgstr='<center>'+imgstr+'</center>';
if(ecms==0)
{
window.viewpic.innerHTML=imgstr;
}
else
{
window.returnValue=imgstr;
window.close();
}
}
</script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
<form name="insertpic" method="post" action="">
<tr class="header">
<td height="23">插入多媒體文件設置</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">使用播放器
<select name="toplay" id="toplay">
<option value="0">Media Player</option>
<option value="1">Real Player</option>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">寬度
<input name="width" type=text id="width" value="480" size="6">
× 高度
<input name="height" type=text id="height" value="360" size="6"> </td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">播放模式
<select name="playmod" id="playmod">
<option value="0">自動播放</option>
<option value="1">手動播放</option>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">播放器下面顯示文字
<input name="picsay" type="text" id="picsay" size="30"></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> <input type="button" name="Submit" value="插入多媒體文件" onclick="SetPicOk(1);">
<input type="button" name="Submit3" value="預覽效果" onclick="SetPicOk(0);">
<input type="button" name="Submit2" value="取消" onclick="window.close();"></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF"> <table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="viewpic"></td>
</tr>
</table></td>
</tr>
</form>
</table>
<?
}
else
{
$fileid=(int)$_GET['fileid'];
$fname=ehtmlspecialchars($_GET['fname']);
$filesize=ehtmlspecialchars($_GET['filesize']);
$filetype=ehtmlspecialchars($_GET['filetype']);
?>
<script>
function SetPicOk(ecms){
var picsay=document.insertpic.picsay.value;
var imgstr="";
if(picsay=="")
{
picsay="<?=$fname?>";
}
imgstr="<div style='padding:6px'><fieldset><legend>"+picsay+"</legend><table cellpadding=0 cellspacing=0 border=0><tr><td><img src='<?=$public_r[newsurl]?>e/data/images/downfile.jpg' alt='文件類型: <?=$filetype?>' border=0 style='vertical-align:baseline'></td><td><a href='<?=$filename?>' title='"+picsay+"' target='_blank'><?=$fname?></a> (<?=$filesize?>)</td></tr></table></fieldset></div>";
if(ecms==0)
{
window.viewpic.innerHTML=imgstr;
}
else
{
window.returnValue=imgstr;
window.close();
}
}
</script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
<form name="insertpic" method="post" action="">
<tr class="header">
<td height="23">插入附件設置</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">附件名稱
<input name="picsay" type="text" id="picsay" size="30"></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> <input type="button" name="Submit" value="插入附件" onclick="SetPicOk(1);">
<input type="button" name="Submit3" value="預覽效果" onclick="SetPicOk(0);">
<input type="button" name="Submit2" value="取消" onclick="window.close();"></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF"> <table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="viewpic"></td>
</tr>
</table></td>
</tr>
</form>
</table>
<?
}
?>
</body>
</html>