📄 re_news.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
if ( !isset( $TYPE ) )
{
$TYPE = "0";
}
$ITEMS_IN_PAGE = 10;
if ( !isset( $start ) )
{
$start = 0;
}
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\r\n</head>\r\n<script>\r\nfunction CheckForm()\r\n{\r\n if(document.form1.CONTENT.value==\"\")\r\n { alert(\"评论的内容不能为空!\");\r\n return (false);\r\n }\r\n\r\n if(document.all(\"AUTHOR_NAME\").length >1 && document.all(\"AUTHOR_NAME\").item(1).checked && document.form1.NICK_NAME.value==\"\")\r\n { alert(\"昵称不能为空!\");\r\n return (false);\r\n }\r\n\r\n return (true);\r\n}\r\n</script>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
$query = "SELECT SUBJECT,ANONYMITY_YN,FORMAT from NEWS where NEWS_ID='".$NEWS_ID."' and PUBLISH='1' and (TO_ID='ALL_DEPT' or find_in_set('{$LOGIN_DEPT_ID}',TO_ID)".dept_other_sql( "TO_ID" ).( " or find_in_set('".$LOGIN_USER_PRIV."',PRIV_ID)" ).priv_other_sql( "PRIV_ID" ).( " or find_in_set('".$LOGIN_USER_ID."',USER_ID))" );
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$SUBJECT = $ROW['SUBJECT'];
$FORMAT = $ROW['FORMAT'];
$ANONYMITY_YN = $ROW['ANONYMITY_YN'];
}
else
{
message( "错误", "此新闻无评论" );
exit( );
}
if ( $ANONYMITY_YN == "2" )
{
message( "", "此新闻禁止评论" );
exit( );
}
if ( $FORMAT != "2" )
{
$strTemp = "read_news.php";
}
else
{
$strTemp = "url_address.php";
}
$query = "SELECT USER_NAME,NICK_NAME from USER where USER_ID='".$LOGIN_USER_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$LOGIN_NICK_NAME = $ROW['NICK_NAME'];
}
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>\r\n <tr height=\"40\">\r\n <td align=center><span class=\"big3\">原文 </span><a href=\"";
echo $strTemp;
echo "?NEWS_ID=";
echo $NEWS_ID;
echo "\" style=\"TEXT-DECORATION:underline\"><span class=\"big3\">";
echo $SUBJECT;
echo "</span></a></span></td>\r\n </tr>\r\n</table>\r\n\r\n";
$query = "SELECT count(*) from NEWS_COMMENT where NEWS_ID='".$NEWS_ID."'";
$cursor = exequery( $connection, $query );
$COMMENT_COUNT = 0;
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$COMMENT_COUNT = $ROW[0];
}
if ( $COMMENT_COUNT == 0 )
{
message( "", "暂无评论" );
echo "<form action=\"submit.php\" method=\"post\" name=\"form1\" onSubmit=\"return CheckForm();\">\r\n <table class=\"TableBlock\" width=\"95%\" align=\"center\">\r\n <tr>\r\n <td class=\"TableHeader\" colspan=\"2\">\r\n <img src=\"/images/green_arrow.gif\"> 发表评论:\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" class=\"TableData\">内容:</td>\r\n <td class=\"TableData\">\r\n <textarea cols=\"57\" name=\"CONTENT\" rows=\"5\" class=\"BigInput\" wrap=\"on\"></textarea>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" class=\"TableData\">署名:</td>\r\n <td class=\"TableData\">\r\n <input type=\"radio\" name=\"AUTHOR_NAME\" value=\"USER_ID\" ";
if ( $ANONYMITY_YN == "0" )
{
echo "checked";
}
echo ">\r\n <input type=\"text\" name=\"USER_NAME\" size=\"10\" maxlength=\"25\" class=\"BigStatic\" value=\"";
echo $LOGIN_USER_NAME;
echo "\" readonly>\r\n";
if ( $ANONYMITY_YN == "1" )
{
echo " <input type=\"radio\" name=\"AUTHOR_NAME\" value=\"NICK_NAME\" checked>昵称\r\n <input type=\"text\" name=\"NICK_NAME\" size=\"10\" maxlength=\"25\" class=\"BigInput\" value=\"";
echo $NICK_NAME;
echo "\">\r\n";
}
echo " </td>\r\n </tr>\r\n <tr align=\"center\" class=\"TableControl\">\r\n <td nowrap colspan=\"2\">\r\n <input type=\"hidden\" value=\"";
echo $NEWS_ID;
echo "\" name=\"NEWS_ID\">\r\n <input type=\"hidden\" value=\"";
echo $MANAGE;
echo "\" name=\"MANAGE\">\r\n <input type=\"submit\" value=\"发表\" class=\"BigButton\"> \r\n <input type=\"button\" value=\"关闭\" class=\"BigButton\" onClick=\"javascript:window.close();\">\r\n </td>\r\n </tr>\r\n </table>\r\n</form>\r\n";
exit( );
}
echo "<table width=95% border=0 cellspacing=0 cellpadding=2 align=\"center\" class=\"small1\">\r\n <tr>\r\n <td> 相关评论 ";
echo $COMMENT_COUNT;
echo " 条</td>\r\n <td align=\"right\">";
echo page_bar( $start, $COMMENT_COUNT, $ITEMS_IN_PAGE );
echo "</td>\r\n </tr>\r\n</table>\r\n\r\n <table border=\"0\" width=\"95%\" cellpadding=\"2\" cellspacing=\"0\" align=\"center\" bgcolor=\"#1C599F\" class=\"small\">\r\n\r\n";
$COUNT = 0;
$query = "SELECT * from NEWS_COMMENT where NEWS_ID=".$NEWS_ID." order by RE_TIME desc limit {$start},{$ITEMS_IN_PAGE}";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$COUNT;
$COMMENT_ID = $ROW['COMMENT_ID'];
$PARENT_ID = $ROW['PARENT_ID'];
$CONTENT = $ROW['CONTENT'];
$RE_TIME = $ROW['RE_TIME'];
$USER_ID = $ROW['USER_ID'];
$NICK_NAME = $ROW['NICK_NAME'];
$CONTENT = htmlspecialchars( $CONTENT );
$CONTENT = str_replace( "\n", "<br>", $CONTENT );
$USER_NAME = "";
if ( $NICK_NAME == "" )
{
$query = "SELECT USER_NAME,DEPT_ID from USER where USER_ID='".$USER_ID."'";
$cursor1 = exequery( $connection, $query );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$DEPT_ID = $ROW1['DEPT_ID'];
$DEPT_NAME = dept_long_name( $DEPT_ID );
$USER_NAME = "<u title=\"部门:".$DEPT_NAME."\" style=\"cursor:hand\">".$ROW1['USER_NAME']."</u>";
}
}
else
{
$USER_NAME = $NICK_NAME;
}
$query = "SELECT CONTENT from NEWS_COMMENT where COMMENT_ID='".$PARENT_ID."'";
$cursor1 = exequery( $connection, $query );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$CONTENT1 = $ROW1['CONTENT'];
$CONTENT1 = str_replace( "<", "<", $CONTENT1 );
$CONTENT1 = str_replace( ">", ">", $CONTENT1 );
$CONTENT1 = stripslashes( $CONTENT1 );
$CONTENT1 = str_replace( "\n", "<br>", $CONTENT1 );
}
$query = "SELECT count(*) from NEWS_COMMENT where PARENT_ID='".$COMMENT_ID."'";
$cursor1 = exequery( $connection, $query );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$RELAY_COUNT = $ROW1[0];
}
echo " <tr height=\"1\">\r\n <td bgcolor=black></td>\r\n </tr>\r\n <tr>\r\n <td class=\"TableHeader\">\r\n ";
echo $USER_NAME;
echo " 发表时间:";
echo $RE_TIME;
echo " </td>\r\n </tr>\r\n <tr height=\"40\">\r\n <td class=\"TableData\">\r\n ";
echo $CONTENT;
if ( $PARENT_ID != 0 )
{
echo " <br><hr width=\"95%\">\r\n <b>[原贴]</b><br>\r\n ";
echo $CONTENT1;
}
echo " </td>\r\n </tr>\r\n <tr>\r\n <td class=\"TableControl\" align=\"right\">\r\n <a href=\"relay.php?COMMENT_ID=";
echo $COMMENT_ID;
echo "&NEWS_ID=";
echo $NEWS_ID;
echo "&start=";
echo $start;
echo "&MANAGE=";
echo $MANAGE;
echo "\" style=\"text-decoration:underline\">回复本贴</a> \r\n";
if ( find_id( $LOGIN_FUNC_STR, "105" ) || $USER_ID == $LOGIN_USER_ID )
{
echo " <a href=\"delete.php?COMMENT_ID=";
echo $COMMENT_ID;
echo "&NEWS_ID=";
echo $NEWS_ID;
echo "&start=";
echo $start;
echo "&MANAGE=";
echo $MANAGE;
echo "\" style=\"text-decoration:underline\">删除</a> \r\n";
}
echo " 回复数:";
echo $RELAY_COUNT;
echo " \r\n </td>\r\n </tr>\r\n";
}
echo "\r\n </table>\r\n\r\n<form action=\"submit.php\" method=\"post\" name=\"form1\" onSubmit=\"return CheckForm();\">\r\n <table class=\"TableBlock\" width=\"95%\" align=\"center\">\r\n <tr>\r\n <td class=\"TableHeader\" colspan=\"2\">\r\n <img src=\"/images/green_arrow.gif\"> 发表评论:\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" class=\"TableData\">内容:</td>\r\n <td class=\"TableData\">\r\n <textarea cols=\"57\" name=\"CONTENT\" rows=\"5\" class=\"BigInput\" wrap=\"on\"></textarea>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" class=\"TableData\">署名:</td>\r\n <td class=\"TableData\">\r\n <input type=\"radio\" name=\"AUTHOR_NAME\" value=\"USER_ID\" ";
if ( $ANONYMITY_YN == "0" )
{
echo "checked";
}
echo ">\r\n <input type=\"text\" name=\"USER_NAME\" size=\"10\" maxlength=\"25\" class=\"BigStatic\" value=\"";
echo $LOGIN_USER_NAME;
echo "\" readonly>\r\n";
if ( $ANONYMITY_YN == "1" )
{
echo " <input type=\"radio\" name=\"AUTHOR_NAME\" value=\"NICK_NAME\" checked>昵称\r\n <input type=\"text\" name=\"NICK_NAME\" size=\"10\" maxlength=\"25\" class=\"BigInput\" value=\"";
echo $LOGIN_NICK_NAME;
echo "\">\r\n";
}
echo " </td>\r\n </tr>\r\n <tr align=\"center\" class=\"TableControl\">\r\n <td nowrap colspan=\"2\">\r\n <input type=\"hidden\" value=\"";
echo $NEWS_ID;
echo "\" name=\"NEWS_ID\">\r\n <input type=\"hidden\" value=\"";
echo $MANAGE;
echo "\" name=\"MANAGE\">\r\n <input type=\"submit\" value=\"发表\" class=\"BigButton\"> \r\n <input type=\"button\" value=\"关闭\" class=\"BigButton\" onClick=\"javascript:window.close();\">\r\n </td>\r\n </tr>\r\n </table>\r\n</form>\r\n</body>\r\n\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -