/[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.5 by sysadm, Fri Mar 28 05:55:16 2025 UTC Revision 1.6 by sysadm, Sat Mar 29 01:23:59 2025 UTC
# Line 9  if (isset($_GET["id"])) Line 9  if (isset($_GET["id"]))
9  else  else
10          $id=0;          $id=0;
11    
12  $rs=mysql_query("select TID,SID from bbs where".  $rs=mysql_query("SELECT TID, SID, m_del FROM bbs WHERE AID = $id AND visible = 0");
         " 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 18  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
# Line 52  if ($tid==0) Line 61  if ($tid==0)
61  }  }
62  else  else
63  {  {
64          header ("Location: view_article?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