-
Notifications
You must be signed in to change notification settings - Fork 2
/
bbsfwd.php
95 lines (85 loc) · 2.79 KB
/
bbsfwd.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
<?php
require("www2-funcs.php");
login_init();
bbs_session_modify_user_mode(BBS_MODE_READING);
assert_login();
if( !isset($_GET["board"]) && !isset($_POST["board"]))
html_error_quit("错误的讨论区");
if( isset($_GET["board"]) )
$board = $_GET["board"];
else
$board = $_POST["board"];
$brdarr = array();
$brdnum = bbs_getboard($board, $brdarr);
if ($brdnum == 0){
html_error_quit("错误的讨论区");
}
$usernum = $currentuser["index"];
if (bbs_checkreadperm($usernum, $brdnum) == 0){
html_error_quit("错误的讨论区");
}
if( !isset($_GET["id"]) && !isset($_POST["id"]))
html_error_quit("错误的文章号");
if( isset($_GET["id"]) )
$id = $_GET["id"];
else
$id = $_POST["id"];
$articles = array ();
$num = bbs_get_records_from_id($brdarr["NAME"], $id, $dir_modes["NORMAL"] , $articles);
if($num == 0)
html_error_quit("错误的文章号");
$brd_encode = urlencode($board);
bbs_board_nav_header($brdarr, "文章转寄");
if (!isset($_GET["do"])){
?>
<form action="bbsfwd.php?do" method="post" class="medium"/>
<input type="hidden" name="board" value="<?php echo $brdarr["NAME"];?>"/>
<input type="hidden" name="id" value="<?php echo $id;?>"/>
<fieldset>
<legend>转寄文章:<?php echo $articles[1]["OWNER"];?> 的 <a href="bbscon.php?bid=<?php echo $brdnum; ?>&id=<?php echo $id; ?>"><?php echo htmlspecialchars($articles[1]["TITLE"]); ?></a></legend>
<div class="inputs">
<label>把文章转寄给 (请输入对方的id或email地址):</label>
<input type="text" name="target" size="40" maxlength="69" id="sselect" value="<?php echo $currentuser["email"];?>"><br/>
<input type="checkbox" name="big5" id="big5" value="1"/><label for="big5" class="clickable">使用BIG5码</label>
<input type="checkbox" name="noansi" id="noansi" value="1" checked /><label for="noansi" class="clickable">过滤ANSI控制符</label>
<?php
if ($articles[1]["ATTACHPOS"]) {
?>
<input type="checkbox" name="noattach" id="noattach" value="1"/><label for="noattach" class="clickable">不包含附件</label>
<?php
}
?>
</div>
</fieldset>
<div class="oper"><input type="submit" value="确定转寄"></div>
</form>
<?php
} else {
if( isset($_POST["target"]) )
$target = $_POST["target"];
else
$target = "";
if($target == "")
html_error_quit("请指定对象");
if( isset($_POST["big5"]) )
$big5 = $_POST["big5"];
else
$big5=0;
settype($big5, "integer");
if( isset($_POST["noansi"]) )
$noansi = $_POST["noansi"];
else
$noansi=0;
settype($noansi, "integer");
if( isset($_POST["noattach"]) )
$noattach = $_POST["noattach"];
else
$noattach=0;
settype($noattach, "integer");
$ret = bbs_doforward($brdarr["NAME"], $articles[1]["FILENAME"], $articles[1]["TITLE"], $target, $big5, $noansi, $noattach);
if($ret < 0)
html_error_quit("系统错误:".$ret);
html_success_quit("文章已转寄给" . $target);
}
page_footer();
?>