/[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.1 by sysadm, Fri Sep 17 14:57:03 2004 UTC Revision 1.5 by sysadm, Fri Mar 28 05:55:16 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    
 $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))
# Line 27  mysql_free_result($rs); Line 26  mysql_free_result($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    
# Line 49  mysql_close($db_conn); Line 48  mysql_close($db_conn);
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  ?>  ?>


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

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