| 6 |
require_once "../lib/lml.inc.php"; |
require_once "../lib/lml.inc.php"; |
| 7 |
require_once "./check_sub.inc.php"; |
require_once "./check_sub.inc.php"; |
| 8 |
require_once "../lib/str_process.inc.php"; |
require_once "../lib/str_process.inc.php"; |
| 9 |
?> |
|
|
<? |
|
| 10 |
force_login(); |
force_login(); |
| 11 |
|
|
| 12 |
$id = (isset($_POST["id"]) ? intval($_POST["id"]) : 0); |
$id = (isset($_POST["id"]) ? intval($_POST["id"]) : 0); |
| 362 |
} |
} |
| 363 |
} |
} |
| 364 |
|
|
| 365 |
//Process upload attachment |
// Get upload quota and used space |
| 366 |
$atta_id_list = "-1"; |
$atta_id_list = "-1"; |
| 367 |
$attachment_count = (isset($_FILES['attachment']['error']) ? count($_FILES['attachment']['error']) : 0); |
$attachment_count = (isset($_FILES['attachment']['error']) ? count($_FILES['attachment']['error']) : 0); |
| 368 |
|
if ($attachment_count > $BBS_upload_count_limit) |
|
if ($attachment_count >= $BBS_upload_count_limit) |
|
| 369 |
{ |
{ |
| 370 |
$result_set["return"]["code"] = -1; |
$result_set["return"]["code"] = -1; |
| 371 |
array_push($result_set["return"]["errorFields"], array( |
array_push($result_set["return"]["errorFields"], array( |
| 622 |
while ($row = mysqli_fetch_array($rs)) |
while ($row = mysqli_fetch_array($rs)) |
| 623 |
{ |
{ |
| 624 |
//Send notification message |
//Send notification message |
|
|
|
| 625 |
$msg_content = "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的主题文章,快来". |
$msg_content = "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的主题文章,快来". |
| 626 |
"[article " . $tid . "#" . $aid . "]看看[/article]《" . $r_title . "》吧!\n"; |
"[article $aid]看看[/article]《" . $r_title . "》吧!\n"; |
| 627 |
|
|
| 628 |
$sql = "INSERT INTO bbs_msg(fromUID, toUID, content, send_dt, send_ip) |
$sql = "INSERT INTO bbs_msg(fromUID, toUID, content, send_dt, send_ip) |
| 629 |
VALUES($BBS_sys_uid, " . $row["UID"] . ", '" . |
VALUES($BBS_sys_uid, " . $row["UID"] . ", '" . |
| 643 |
|
|
| 644 |
mysqli_free_result($rs); |
mysqli_free_result($rs); |
| 645 |
} |
} |
| 646 |
else |
else // Post new article |
| 647 |
{ |
{ |
| 648 |
$tid = $aid; |
$tid = $aid; |
| 649 |
} |
} |
| 680 |
} |
} |
| 681 |
} |
} |
| 682 |
|
|
| 683 |
|
// Link content to article |
| 684 |
$sql = "UPDATE bbs_content SET AID = $aid WHERE CID = $cid"; |
$sql = "UPDATE bbs_content SET AID = $aid WHERE CID = $cid"; |
| 685 |
|
|
| 686 |
$rs = mysqli_query($db_conn, $sql); |
$rs = mysqli_query($db_conn, $sql); |
| 693 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 694 |
} |
} |
| 695 |
|
|
| 696 |
|
// Link attachments to article |
| 697 |
$sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN ($atta_id_list)"; |
$sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN ($atta_id_list)"; |
| 698 |
|
|
| 699 |
$rs = mysqli_query($db_conn, $sql); |
$rs = mysqli_query($db_conn, $sql); |
| 706 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 707 |
} |
} |
| 708 |
|
|
| 709 |
//Add log |
// Add log |
| 710 |
$rs = article_op_log($aid, $_SESSION["BBS_uid"], ($id == 0 ? "A" : "M"), client_addr(), $db_conn); |
$rs = article_op_log($aid, $_SESSION["BBS_uid"], ($id == 0 ? "A" : "M"), client_addr(), $db_conn); |
| 711 |
if ($rs == false) |
if ($rs == false) |
| 712 |
{ |
{ |