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

Diff of /fenglin/bbs/restore.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 by sysadm, Thu Mar 6 07:41:52 2025 UTC Revision 1.6 by sysadm, Sat Mar 29 01:23:59 2025 UTC
# Line 1  Line 1 
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  ?>  ?>
# Line 8  if (isset($_GET["id"])) Line 9  if (isset($_GET["id"]))
9  else  else
10          $id=0;          $id=0;
11    
12  $db_conn=include "./db_open.inc.php";  $rs=mysql_query("SELECT TID, SID, m_del FROM bbs WHERE AID = $id AND visible = 0");
   
 $rs=mysql_query("select TID,SID from bbs where".  
         " AID=$id and visible=0");  
13  if($row=mysql_fetch_array($rs))  if($row=mysql_fetch_array($rs))
14  {  {
15          $tid=$row["TID"];          $tid=$row["TID"];
# Line 19  if($row=mysql_fetch_array($rs)) Line 17  if($row=mysql_fetch_array($rs))
17  }  }
18  else  else
19  {  {
20          $tid=-1;          error_msg("没有找到文章!", false);
21          $sid=-1;          exit();
22  }  }
23  mysql_free_result($rs);  mysql_free_result($rs);
24    
25  if (!($_SESSION["BBS_priv"]->checkpriv($sid,S_POST) &&  if (!($_SESSION["BBS_priv"]->checkpriv($sid,S_POST | S_MAN_S)
26          ($_SESSION["BBS_priv"]->checkpriv($sid,S_MAN_S))))          && $row["m_del"]))
27  {  {
28          error_msg("您无权恢复此文章!",true);          error_msg("您无权恢复此文章!", true);
29          exit();          exit();
30  }  }
31    
32    if ($tid != 0)
33    {
34            $rs=mysql_query("SELECT AID FROM bbs WHERE AID = $tid AND visible = 1");
35            if(mysql_num_rows($rs) == 0)
36            {
37                    error_msg("需要先恢复主题!", true);
38                    exit();
39            }
40    }
41    
42  mysql_query("update bbs set visible=1,m_del=0 where AID=$id")  mysql_query("update bbs set visible = 1, m_del = 0 where AID = $id")
43          or die("Delete article error!");          or die("Delete article error!");
44    
45  //Add log  //Add log
46  article_op_log($id,$_SESSION["BBS_uid"],'S',Client_Address(),$db_conn)  article_op_log($id,$_SESSION["BBS_uid"],'S',client_addr(),$db_conn)
47          or die("Add log error!");          or die("Add log error!");
48    
49  //Set last reply date  //Set last reply date
# Line 49  mysql_close($db_conn); Line 57  mysql_close($db_conn);
57    
58  if ($tid==0)  if ($tid==0)
59  {  {
60          header ("Location: detail.php?id=$id");          header ("Location: view_article.php?id=$id");
61  }  }
62  else  else
63  {  {
64          header ("Location: detail.php?id=$tid#$id");          header ("Location: view_article.php?id=$tid#$id");
65  }  }
66  ?>  ?>


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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