/[LeafOK_CVS]/fenglin/bbs/common_lib.inc.php
ViewVC logotype

Diff of /fenglin/bbs/common_lib.inc.php

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

Revision 1.3 by sysadm, Sat Mar 29 03:49:17 2025 UTC Revision 1.6 by sysadm, Sat Apr 5 15:19:16 2025 UTC
# Line 1  Line 1 
1  <?  <?
   
 //Function article_op_log()  
2  //Log article operation into table bbs_article_log  //Log article operation into table bbs_article_log
3  function article_op_log($aid,$uid,$op_type,$ip_addr,$db_conn=null)  function article_op_log(int $aid, int $uid, string $op_type, string $ip_addr, mysqli $db_conn = null) : mysqli_result | bool
4  {  {
5          /*          /*
6                  Type    Description                  Type    Description
7                  A               Add article                  A               Add article
8                  D               Delete article                  D               Delete article
9                    X               Delete article by Admin
10                  S               Restore article                  S               Restore article
11                  L               Lock article                  L               Lock article
12                  U               Unlock article                  U               Unlock article
# Line 21  function article_op_log($aid,$uid,$op_ty Line 20  function article_op_log($aid,$uid,$op_ty
20                  N               Unrecommend article                  N               Unrecommend article
21                  Z               Set article as trnasship                  Z               Set article as trnasship
22          */          */
23          $ret = mysql_query("insert into bbs_article_op(AID,UID,type,op_dt,op_ip)".  
24                  " values($aid,$uid,'$op_type',now(),'$ip_addr')",$db_conn);          $sql = "INSERT INTO bbs_article_op(AID, UID, type, op_dt, op_ip)
25                                    VALUES($aid, $uid, '$op_type', NOW(), '$ip_addr')";
26    
27            $ret = mysqli_query($db_conn, $sql);
28    
29          return $ret;          return $ret;
30  }  }
31    
   
 //Function user_exp_change()  
32  //Add/Subtract user exp  //Add/Subtract user exp
33  function user_exp_change($uid,$exp_change,$db_conn=null)  function user_exp_change(int $uid, int $exp_change, mysqli $db_conn = null) : mysqli_result | bool
34  {  {
35          $ret = mysql_query("update user_pubinfo set exp=exp+$exp_change".          $sql = "UPDATE user_pubinfo SET exp = exp + $exp_change WHERE UID = $uid";
36                  " where UID=".$uid);  
37            $ret = mysqli_query($db_conn, $sql);
38    
39          return $ret;          return $ret;
40  }  }
41    
   
 //Function error_msg()  
42  //Display error message in a pop-up window  //Display error message in a pop-up window
43  function error_msg($msg,$back=false,$close=false)  function error_msg($msg, $back=false, $close=false)
44  {  {
45          $ret = "<script language=\"JavaScript\">\n".          $ret = "<script language=\"JavaScript\">\n".
46                  "       alert(\"".str_replace("\n","\\\n",$msg)."\");\n".                  "       alert(\"".str_replace("\n","\\\n",$msg)."\");\n".


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

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