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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations)
Wed Apr 23 04:51:55 2025 UTC (10 months, 3 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +0 -0 lines
FILE REMOVED
Rename common_lib.inc.php to article_op.inc.php

1 sysadm 1.1 <?
2     //Log article operation into table bbs_article_log
3 sysadm 1.5 function article_op_log(int $aid, int $uid, string $op_type, string $ip_addr, mysqli $db_conn = null) : mysqli_result | bool
4 sysadm 1.1 {
5     /*
6     Type Description
7     A Add article
8     D Delete article
9 sysadm 1.6 X Delete article by Admin
10 sysadm 1.1 S Restore article
11     L Lock article
12     U Unlock article
13     M Modify article
14     T Move article
15     E Set article as excerption
16     O Unset article as excerption
17     F Set article on top
18     V Unset article on top
19     Z Set article as trnasship
20     */
21 sysadm 1.5
22     $sql = "INSERT INTO bbs_article_op(AID, UID, type, op_dt, op_ip)
23     VALUES($aid, $uid, '$op_type', NOW(), '$ip_addr')";
24    
25     $ret = mysqli_query($db_conn, $sql);
26    
27 sysadm 1.1 return $ret;
28     }
29    
30     //Add/Subtract user exp
31 sysadm 1.5 function user_exp_change(int $uid, int $exp_change, mysqli $db_conn = null) : mysqli_result | bool
32 sysadm 1.1 {
33 sysadm 1.5 $sql = "UPDATE user_pubinfo SET exp = exp + $exp_change WHERE UID = $uid";
34    
35     $ret = mysqli_query($db_conn, $sql);
36 sysadm 1.1
37     return $ret;
38     }
39    
40     ?>

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