insert.php
来自「极限网络智能办公系统 - Office Automation 2008 官方10」· PHP 代码 · 共 141 行
PHP
141 行
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/utility_sms1.php" );
echo "\r\n<html>\r\n<head>\r\n<title></title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
$query = "SELECT * from BBS_BOARD where BOARD_ID='".$BOARD_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$POST_TIME = $ROW['POST_TIME'];
$FILTER_TEXT = $ROW['FILTER_TEXT'];
}
$USER_POST_TIME = "USER_POST_TIME".$BOARD_ID;
$__POST_TIME = time( ) - $$USER_POST_TIME;
if ( $__POST_TIME < $POST_TIME )
{
message( "", "发帖间隔时间过短,请您等".$POST_TIME."秒后再发" );
button_back( );
exit( );
}
$$USER_POST_TIME = time( );
$explode = explode( "|", $FILTER_TEXT );
$CONTENT = str_replace( $explode, "****", $CONTENT );
session_register( "USER_POST_TIME".$BOARD_ID );
$CUR_TIME = date( "Y-m-d H:i:s", time( ) );
if ( $AUTHOR_NAME == "2" )
{
$query = "SELECT ANONYMITY_FLAG from BBS_BOARD where BOARD_ID='".$BOARD_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$ANONYMITY_FLAG = $ROW['ANONYMITY_FLAG'];
if ( $ANONYMITY_FLAG == 1 )
{
$query = "SELECT USER_NAME from USER where USER_NAME='".$NICK_NAME."'";
$cursor = exequery( $connection, $query );
if ( ( $ROW = mysql_fetch_array( $cursor ) ) && $ROW['USER_NAME'] != $USER_NAME )
{
message( "", "不允许使用OA内部用户名作为匿名" );
button_back( );
exit( );
}
}
}
}
if ( $REPLY == "1" )
{
$query = "update BBS_COMMENT set REPLY_CONT=REPLY_CONT+1,SUBMIT_TIME='".$CUR_TIME."' where COMMENT_ID={$COMMENT_ID}";
exequery( $connection, $query );
}
$AUTHOR_NAME_TMEP = $AUTHOR_NAME;
if ( $AUTHOR_NAME == "1" )
{
$AUTHOR_NAME = $USER_NAME;
}
else
{
$AUTHOR_NAME = $NICK_NAME;
}
if ( $BBS_SIGNATURE == "on" )
{
$query = "SELECT * from USER where USER_ID='".$LOGIN_USER_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$BBS_SIGNATURE = addslashes( $ROW['BBS_SIGNATURE'] );
if ( $BBS_SIGNATURE != "" )
{
$CONTENT .= "<br><br>------------------ 以下是个人签名 -------------------<br>".str_replace( "\n", "<br>", $BBS_SIGNATURE );
}
}
}
$query = "update USER set BBS_COUNTER=BBS_COUNTER+1 where USER_ID='".$LOGIN_USER_ID."'";
exequery( $connection, $query );
if ( $ATTACHMENT != "" )
{
$ATTACHMENT_ID = upload( $ATTACHMENT, $ATTACHMENT_NAME );
$ATTACHMENT_ID .= ",";
$ATTACHMENT_NAME .= "*";
}
$ATTACHMENT_ID .= copy_sel_attach( $ATTACH_NAME, $ATTACH_DIR, $DISK_ID );
$ATTACHMENT_NAME .= $ATTACH_NAME;
if ( $REPLY == "1" )
{
$PARENT = $COMMENT_ID;
}
else
{
$PARENT = 0;
}
$query = "insert into BBS_COMMENT(BOARD_ID, USER_ID, AUTHOR_NAME, SUBJECT, CONTENT, ATTACHMENT_ID, ATTACHMENT_NAME, SUBMIT_TIME, REPLY_CONT, READ_CONT,PARENT,OLD_SUBMIT_TIME) values ( '".$BOARD_ID."', '{$LOGIN_USER_ID}', '{$AUTHOR_NAME}', '{$SUBJECT}', '{$CONTENT}', '{$ATTACHMENT_ID}', '{$ATTACHMENT_NAME}', '{$CUR_TIME}', 0, 0,'{$PARENT}','{$CUR_TIME}')";
exequery( $connection, $query );
$query1 = "select * from BBS_COMMENT where BOARD_ID=".$BOARD_ID." and USER_ID='{$LOGIN_USER_ID}' and AUTHOR_NAME='{$AUTHOR_NAME}' and SUBJECT='{$SUBJECT}' and CONTENT='{$CONTENT}' and ATTACHMENT_ID='{$ATTACHMENT_ID}' and ATTACHMENT_NAME='{$ATTACHMENT_NAME}' and SUBMIT_TIME='{$CUR_TIME}' and REPLY_CONT=0 and READ_CONT=0";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$COMMENT_ID_NEW = $ROW1['COMMENT_ID'];
}
$query = "select * from SYS_PARA where PARA_NAME='SMS_REMIND'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PARA_VALUE = $ROW['PARA_VALUE'];
}
$SMS_REMIND1 = substr( $PARA_VALUE, 0, strpos( $PARA_VALUE, "|" ) );
$SMS2_REMIND1 = substr( $PARA_VALUE, strpos( $PARA_VALUE, "|" ) + 1 );
if ( $REPLY == "1" )
{
$query2 = "select * from BBS_COMMENT where COMMENT_ID=".$COMMENT_ID;
$cursor2 = exequery( $connection, $query2 );
if ( $ROW2 = mysql_fetch_array( $cursor2 ) )
{
$USER_ID = $ROW2['USER_ID'];
$SUBJECT = $ROW2['SUBJECT'];
}
if ( $SMS_REMIND == "on" && $LOGIN_USER_ID != $USER_ID && find_id( $SMS_REMIND1, 18 ) && $AUTHOR_NAME_TMEP == "1" )
{
send_sms( "", $LOGIN_USER_ID, $USER_ID, 18, $SUBJECT."得到回复,请查看!" );
}
if ( $SMS2_REMIND == "on" && $LOGIN_USER_ID != $USER_ID && find_id( $SMS2_REMIND1, 18 ) && $AUTHOR_NAME_TMEP == "1" )
{
send_mobile_sms_user( "", $LOGIN_USER_ID, $USER_ID, $SUBJECT."得到回复,请查看!", 18 );
}
}
if ( $OP == "0" )
{
header( "location: edit.php?BOARD_ID=".$BOARD_ID."&PAGE_START={$PAGE_START}&COMMENT_ID={$COMMENT_ID_NEW}" );
}
else if ( $REPLY == "1" )
{
header( "location: comment.php?BOARD_ID=".$BOARD_ID."&COMMENT_ID={$COMMENT_ID}&PAGE_START={$PAGE_START}" );
}
else
{
header( "location: board.php?BOARD_ID=".$BOARD_ID."&PAGE_START={$PAGE_START}" );
}
echo "\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?