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

Annotation of /fenglin/bbs/restore.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Sat Mar 1 08:43:29 2025 UTC (12 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.1: +1 -1 lines
Convert GB2312 to UTF-8

1 sysadm 1.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 sysadm 1.2 error_msg("您无权恢复此文章!",true);
31 sysadm 1.1 exit();
32     }
33    
34     mysql_query("update bbs set visible=1,m_del=0,cached=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 cached=0,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     ?>

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