| 1 |
<?
|
| 2 |
require_once "./common_lib.inc.php";
|
| 3 |
require_once "./session_init.inc.php";
|
| 4 |
?>
|
| 5 |
<?
|
| 6 |
if (isset($_GET["id"]))
|
| 7 |
$id=intval($_GET["id"]);
|
| 8 |
else
|
| 9 |
$id=0;
|
| 10 |
|
| 11 |
$db_conn=include "./db_open.inc.php";
|
| 12 |
|
| 13 |
$rs=mysql_query("select TID,SID from bbs where".
|
| 14 |
" AID=$id and visible=0");
|
| 15 |
if($row=mysql_fetch_array($rs))
|
| 16 |
{
|
| 17 |
$tid=$row["TID"];
|
| 18 |
$sid=$row["SID"];
|
| 19 |
}
|
| 20 |
else
|
| 21 |
{
|
| 22 |
$tid=-1;
|
| 23 |
$sid=-1;
|
| 24 |
}
|
| 25 |
mysql_free_result($rs);
|
| 26 |
|
| 27 |
if (!($_SESSION["BBS_priv"]->checkpriv($sid,S_POST) &&
|
| 28 |
($_SESSION["BBS_priv"]->checkpriv($sid,S_MAN_S))))
|
| 29 |
{
|
| 30 |
error_msg("您无权恢复此文章!",true);
|
| 31 |
exit();
|
| 32 |
}
|
| 33 |
|
| 34 |
mysql_query("update bbs set visible=1,m_del=0 where AID=$id")
|
| 35 |
or die("Delete article error!");
|
| 36 |
|
| 37 |
//Add log
|
| 38 |
article_op_log($id,$_SESSION["BBS_uid"],'S',Client_Address(),$db_conn)
|
| 39 |
or die("Add log error!");
|
| 40 |
|
| 41 |
//Set last reply date
|
| 42 |
if ($tid!=0)
|
| 43 |
{
|
| 44 |
mysql_query("update bbs set reply_count=reply_count+1 where aid=$tid")
|
| 45 |
or die("Update article error!");
|
| 46 |
}
|
| 47 |
|
| 48 |
mysql_close($db_conn);
|
| 49 |
|
| 50 |
if ($tid==0)
|
| 51 |
{
|
| 52 |
header ("Location: detail.php?id=$id");
|
| 53 |
}
|
| 54 |
else
|
| 55 |
{
|
| 56 |
header ("Location: detail.php?id=$tid#$id");
|
| 57 |
}
|
| 58 |
?>
|