/[LeafOK_CVS]/fenglin/bbs/restore.php
ViewVC logotype

Contents of /fenglin/bbs/restore.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Fri Mar 28 05:55:16 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.4: +2 -3 lines
Refine

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

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1