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