-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbbsmpath.php
166 lines (154 loc) · 3.5 KB
/
bbsmpath.php
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
<?php
/**
* This file control import_path .
* action: todo: add, del, ...
* author: stiger
*/
require("funcs.php");
login_init();
if ($loginok !=1 )
html_nologin();
else
{
html_init("gb2312");
$showform = 0;
$actionret = 0;
if(isset($_GET["action"])){
$action = $_GET["action"];
if(!strcmp($action,"add")){
if(isset($_GET["num"]))
$num = $_GET["num"];
else
$showform = 1;
if(isset($_GET["path"]))
$path = $_GET["path"];
else
$showform = 1;
if(isset($_GET["title"]))
$title = $_GET["title"];
if($showform == 0){
settype($num,"integer");
if($num < 0 || $num > 39)
html_error_quit("参数错误1");
if(isset($_GET["title"]))
$actionret = bbs_add_import_path($path,$title,$num);
else
$actionret = bbs_add_import_path($path,$num);
if($actionret > 0) $actionret = 1;
else $actionret = -1;
}
}
else if(!strcmp($action,"edit")){
if(isset($_GET["num"]))
$num = $_GET["num"];
else
html_error_quit("参数错误2");
settype($num,"integer");
if($num < 0 || $num > 39)
html_error_quit("参数错误3");
$showform = 1;
}
else if(!strcmp($action,"select")){
$showform = 2;
}
}
else
$action = "show";
$pathret = bbs_get_import_path();
if( $pathret == FALSE )
html_error_quit("没有设置思路");
?>
<body>
<center><p><?php echo BBS_FULL_NAME; ?> -- [丝路控制] [用户: <?php echo $currentuser["userid"];?>]</p>
<hr class="default"/>
<?php
if($showform == 1){
if(!strcmp($action,"edit")){
$path = $pathret[$num]["PATH"];
$title = $pathret[$num]["TITLE"];
}
?>
<form action="bbsmpath.php" method="get">
路径:<input type="text" size="30" name="path" value="<?php echo $path;?>">
丝路名:<input type="text" size="30" name="title" value="<?php echo $title?>">
序号:<select name="num" class="input" style="WIDTH: 40px">
<?php
for($i = 0; $i < 40; $i++){
?>
<option <?php if($i == $num) echo "selected";?> value=<?php echo $i;?>><?php echo $i;?>
<?php
}
?>
</option></select>
<input type="hidden" name="action" value="add">
<input type="submit" value="添加">
</form>
<hr class="default"/>
<?php
}else if($showform == 2){
?>
<script language=javascript>
function clickclose(){
opener.document.forms["form1"].elements["num"].value = document.forms["selectImPath"].elements["num"].value ;
return window.close();
}
</script>
<form name="selectImPath" method="post" action="">
请选择丝路序号:<select name="num" class="input" style="WIDTH: 40px">
<?php
for($i = 0; $i < 40; $i++){
?>
<option <?php if($i == 0) echo "selected";?> value=<?php echo $i;?>><?php echo $i;?>
<?php
}
?>
</option></select>
<input type="button" width="60" value="选择" onclick="return clickclose()">
</form>
<hr class="default"/>
<?php
}else if($actionret != 0){
if($actionret == 1 ){
?>
序号:<?php echo $num;?> 丝路增加成功
<?php
}else if($actionret == -1){
?>
序号:<?php echo $num;?> 丝路增加失败
<?php
}
?>
<hr class="default"/>
<?php
}
?>
<table width="613">
<tr><td> </td><td>序号</td><td>丝路名</td><td>路径</td></tr>
<?php
for($i = 0; $i < 40; $i ++){
?>
<tr><td>
<?php
if( $showform != 2 ){
?>
<a href="bbsmpath.php?action=edit&num=<?php echo $i;?>">修改</a>
<?php
}
?>
</td><td>
<?php echo $i;?>
</td><td>
<?php echo $pathret[$i]["TITLE"];?>
</td><td>
<?php if($pathret[$i]["TITLE"][0]) echo $pathret[$i]["PATH"];?>
</td></tr>
<?php
}
?>
</table>
<hr class="default"/>
[<a href="javascript:history.go(-1)">返回上一页</a>]
<?php
html_normal_quit();
}
?>