mychannel_edit.htm
15.7 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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>更改内容模型</title>
<style type="text/css">
<!--
body { background-image: url(images/allbg.gif); }
.STYLE2 { color: #666666; }
-->
</style>
<script language="javascript">
<!--
function Nav() {
if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
else return "OT";
}
function $Obj(objname) {
return document.getElementById(objname);
}
function ShowHide2(objname) {
var obj = $Obj(objname);
if(obj.style.display != 'block'){ obj.style.display = 'block' }
else{ obj.style.display = 'none'; }
}
//删除
function DelNote(gourl) {
if(!window.confirm("你确认要删除这个字段么!")){ return false; }
location.href=gourl;
}
function ShowObj(objname) {
var obj = document.getElementById(objname);
if(Nav()=='IE') {obj.style.display = "block";obj.style.display = "block";}
else obj.style.display = "table";
}
function HideObj(objname) {
var obj = document.getElementById(objname);
obj.style.display = "none";
}
function ShowItem1() {
ShowObj('head1'); ShowObj('needset');
HideObj('head2'); HideObj('adset');
}
function ShowItem2() {
ShowObj('head2'); ShowObj('adset');
HideObj('head1'); HideObj('needset');
}
-->
</script>
<link href="css/base.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="8">
<form name="form1" action="mychannel_edit.php" method="post">
<input type='hidden' name='id' value='<?php echo $id?>'>
<input type='hidden' name='dopost' value='save'>
<input type='hidden' name='issystem' value='<?php echo $row['issystem']; ?>'>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" style="margin-bottom:8px;">
<tr>
<td height="28" colspan="2" background="images/tbg.gif" style="padding-left:10px;">
<a href="mychannel_main.php"><b>内容模型管理</b></a>
<b> > 更改内容模型:</b>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" id="head1" cellpadding="0" align="center" style="display:block">
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="84" height="24" align="center" background="images/itemnote1.gif"> 基本设置 </td>
<td width="84" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>字段管理</u></a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" id="head2" cellpadding="0" style="display:none" align="center">
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="84" height="24" align="center" background="images/itemnote2.gif" bgcolor="#F2F7DF"><a href="#" onClick="ShowItem1()"><u>基本设置</u></a> </td>
<td width="84" align="center" background="images/itemnote1.gif">字段管理 </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="98%" id='needset' border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#cfcfcf" style="display:block">
<?php
if($row['issystem'] == 1)
{
?>
<tr>
<td colspan="2" bgcolor="#FFFFFF" style="color:red"> 您目前所展开的是系统模型,系统模型一般对发布程序和管理程序已经固化,如果您胡乱更改系统模型将会导致使用这种内容类型的频道可能崩溃。 </td>
</tr>
<?php
}
?>
<tr>
<td bgcolor="#FFFFFF"><b>模型性质</b><br />
<span class="STYLE2" id="help5">如果为<u>系统模型</u>将禁止删除,此选项不可更改,对于独立模型,系统强制创建字段aid、栏目ID、发布时间、文档标题。</span></td>
<td bgcolor="#FFFFFF">
<?php
if($row['issystem']==0) echo "自动模型";
else if($row['issystem']==1) echo "系统模型";
else if($row['issystem']==-1) echo "独立模型";
?>
</td>
</tr>
<tr>
<td width="35%" bgcolor="#FFFFFF"><b>频道ID</b><br />
<span class="STYLE2" id='help1'>数字,创建后不可更改,并具有唯一性。</span></td>
<td width="65%" bgcolor="#FFFFFF">
<?php echo $row['id']; ?> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>名字标识</b><br />
<span class="STYLE2" id="help2">与文档的模板相关连,建议由英文、数字或下划线组成,因为部份Unix系统无法识别中文文件,频道默认文档模板是 “default/article_名字标识.htm”,列表模板、封面模板类推。 </span></td>
<td bgcolor="#FFFFFF">
<?php echo $row['nid']; ?> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>频道名称</b><br />
<span class="STYLE2" id="help3">频道的中文名称,在后台管理,前台发布等均使用此名字。</span></td>
<td bgcolor="#FFFFFF"><input name="typename" type="text" id="typename" value="<?php echo $row['typename']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>附加表</b><br />
<span class="STYLE2" id="help4">频道除主表以外其它自定义类型数据存放数据的表,如果您不使用主表关连的各种特性(推荐、会员权限等),也可以使用完全以附加表作为存储数据。</span></td>
<td bgcolor="#FFFFFF"><input name="addtable" type="text" id="addtable" value="<?php echo $row['addtable']; ?>" class="pubinputs" />
( #@__ 是表示数据表前缀)</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>是否支持会员投稿</strong></td>
<td bgcolor="#FFFFFF">
<input name="issend" type="radio" class="np" value="0"<?php if($row['issend']==0) echo " checked='1' "; ?> />
不支持
<input type="radio" name="issend" class="np" value="1"<?php if($row['issend']==1) echo " checked='1' "; ?> />
支持 </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>会员许可投稿级别</strong></td>
<td bgcolor="#FFFFFF">
<select name="sendrank" id="sendrank" style="width:120px">
<option value='0'>游客</option>
<?php
$urank = $cuserLogin->getUserRank();
$dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank' And rank>=10");
$dsql->Execute();
while($row2 = $dsql->GetObject())
{
if($row2->rank==$row['sendrank']) echo " <option value='".$row2->rank."' selected>".$row2->membername."</option>\r\n";
else echo " <option value='".$row2->rank."'>".$row2->membername."</option>\r\n";
}
?>
</select> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>许可投稿会员组</strong></td>
<td bgcolor="#FFFFFF">
<?php
$dsql->SetQuery("Select * from `#@__member_model`");
$dsql->Execute();
while($row3 = $dsql->GetObject())
{
echo "<input name='usertype' class='np' type='radio' value=".$row3->name." />".$row3->name."\r\n";
}
?>
<input name="usertype" class="np" type="radio" value=""<?php if($row['usertype']=='') echo " checked='1' ";?> />
不限 </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>会员稿件默认状态</strong></td>
<td bgcolor="#FFFFFF">
<input name="arcsta" class="np" type="radio" value="-1"<?php if($row['arcsta']==-1) echo " checked='1' ";?>>
未审核
<input name="arcsta" class="np" type="radio" value="0"<?php if($row['arcsta']==0) echo " checked='1' ";?>>
已审核(自动生成HTML)
<input name="arcsta" class="np" type="radio" value="1"<?php if($row['arcsta']==1) echo " checked='1' ";?>>
已审核(仅使用动态文档)</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>档案发布程序</strong></td>
<td bgcolor="#FFFFFF"><input name="addcon" type="text" id="addcon" value="<?php echo $row['addcon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>档案修改程序</strong></td>
<td bgcolor="#FFFFFF"><input name="editcon" type="text" id="editcon" value="<?php echo $row['editcon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>档案管理程序</strong></td>
<td bgcolor="#FFFFFF"><input name="mancon" type="text" id="mancon" value="<?php echo $row['mancon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>前台会员发布程序</strong></td>
<td bgcolor="#FFFFFF"><input name="useraddcon" type="text" id="useraddcon" value="<?php echo $row['useraddcon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>前台会员修改程序</strong></td>
<td bgcolor="#FFFFFF"><input name="usereditcon" type="text" id="usereditcon" value="<?php echo $row['usereditcon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>前台会员管理程序</strong></td>
<td bgcolor="#FFFFFF"><input name="usermancon" type="text" id="usermancon" value="<?php echo $row['usermancon']; ?>" class="pubinputs" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>列表附加字段</strong><br />
<span class="STYLE2" id="help6">用","分开,可以在列表模板{dede:list}{/dede:list}中用[field:name /]调用</span></td>
<td bgcolor="#FFFFFF">
<input name="listfields" type="text" id="listfields" size="50" value="<?php echo $row['listfields']; ?>" class="pubinputs" style="width:80%;" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>投稿标题使用名称</b></td>
<td bgcolor="#FFFFFF">
<input name="titlename" type="text" id="titlename" value="<?php echo $row['titlename']; ?>" class="pubinputs" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<strong>投稿是否使用摘要</strong>
<br/>
<span class="STYLE2">如果不使用主表(独立模型),缩略图设置同。</span>
</td>
<td bgcolor="#FFFFFF">
<input name="needdes" type="radio" class="np" value="1"<?php if($row['needdes']==1) echo " checked='1'"; ?> />
使用
<input name="needdes" type="radio" class="np" value="0"<?php if($row['needdes']==0) echo " checked='1'"; ?> />
不使用 </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><strong>投稿是否使用缩图</strong></td>
<td bgcolor="#FFFFFF">
<input name="needpic" type="radio" class="np" value="1"<?php if($row['needpic']==1) echo " checked='1'"; ?> />
使用
<input name="needpic" type="radio" class="np" value="0"<?php if($row['needpic']==0) echo " checked='1'"; ?> />
不使用 </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>默认栏目ID</b><br />
<span class="STYLE2" id="help8">与投稿是唯一性结合可以用模型设计自定义表单</span> </td>
<td bgcolor="#FFFFFF">
<input name="dfcid" type="text" id="dfcid" value="<?php echo $row['dfcid']; ?>" class="pubinputs" style="width:80px" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><b>投稿具有唯一性</b><br />
<span class="STYLE2" id="help9">如果投稿是唯一的(会员只能在这个模型对应的栏目中发布单篇文档),其作用相当于自定义表单</span> </td>
<td bgcolor="#FFFFFF">
<input name="onlyone" type="radio" class="np" value="1" <?php if($row['onlyone']==1) echo " checked='1'"; ?> />
是
<input name="onlyone" type="radio" class="np" value="0" <?php if($row['onlyone']==0) echo " checked='1'"; ?> />
不是 </td>
</tr>
</table>
<table width="98%" id='adset' border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" style='display:none'>
<tr>
<td height="28" bgcolor="#ffffff"><strong>模型字段配置(可视化模式)</strong></td>
<td bgcolor="#ffffff">
<input name="fset" type="button" id="fset" value="添加新字段" onClick="location.href='mychannel_field_add.php?id=<?php echo $id; ?>'" class="coolbg np" /> </td>
</tr>
<tr>
<td colspan='2' bgcolor="#FFFFFF" style="padding:6px">
<table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" style="background:#cfcfcf;">
<tr align="center" bgcolor="#FBFCE2" height="24">
<td width="28%">表单提示文字</td>
<td width="18%">数据字段名</td>
<td width="20%">数据类型</td>
<td width="18%">表单类型</td>
<td>维护</td>
</tr>
<?php
if($row['issystem']==-1)
{
?>
<tr bgcolor="#ffffff" height="24">
<td colspan='5'>aid 和 typeid 是强制使用字段,这里不列出。</td>
</tr>
<?php
}
else
{
?>
<tr bgcolor="#ffffff" height="24">
<td colspan='5'>下面列出的字段是附加表的字段,除此外,它还包含主表dede_archives的所有字段</td>
</tr>
<?php
}
$ds = file(DEDEADMIN."/inc/fieldtype.txt");
foreach($ds as $d){
$dds = explode(',',trim($d));
$fieldtypes[$dds[0]] = $dds[1];
}
$fieldset = $row['fieldset'];
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
if(is_array($dtp->CTags)){
foreach($dtp->CTags as $ctag)
{
?> <tr align="center" bgcolor="#FFFFFF" height="26" align="center" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="24">
<td>
<?php
$itname = $ctag->GetAtt('itemname');
if($itname=='') echo "没指定";
else echo $itname;
?> </td>
<td>
<?php echo $ctag->GetTagName(); ?> </td>
<td>
<?php
$ft = $ctag->GetAtt('type');
if(isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
else echo "系统专用类型";
?> </td>
<td>
<?php
$ft = $ctag->GetAtt('autofield');
if($ft=='' || $ft==0) {
echo "固化字段";
}
else {
echo "自动表单";
}
?>
</td>
<td>
<?php
if($ft==1)
{
?>
<a href='mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&issystem=<?php echo $row['issystem']; ?>'><img src='images/gtk-edit.png' alt='更改' title='更改' /></a>
<?php if($row['issystem']!=1){ ?>
| <a href='#' onClick='javascript:DelNote("mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&action=delete");'><img src='images/gtk-del.png' alt='删除' title='删除' /></a>
<?php } ?>
<?php
}
else
{
echo "禁止修改";
}
?>
</td>
</tr>
<?php
}}
?>
</table>
</td>
</tr>
<tr>
<td height="24" width="35%" bgcolor="#FFFFFF">
<strong>模型字段配置(文本模式) </strong><br />
修改配置文本可调整字段顺序,但不会更改字段属性!
</td>
<td width="65%" bgcolor="#FFFFFF">
<textarea name="fieldset" style="width:99%;height:300px" rows="10" id="fieldset"><?php echo $row['fieldset']; ?></textarea>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" id='' style='margin-top:6px'>
<tr bgcolor="#F9FCEF">
<td height="36" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="26%"> </td>
<td width="15%"><input name="imageField" class="np" type="image" src="images/button_ok.gif" width="60" height="22" border="0" /></td>
<td width="59%"><img src="images/button_back.gif" width="60" height="22" onClick="location='mychannel_main.php';" style="cursor:pointer" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?php
if(!empty($openfield))
{
echo "<script language='javascript'>ShowItem2();</script>";
}
?>
</body>
</html>