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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Tue Apr 29 11:55:32 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -2 lines
Remove redundant PHP closing tag

1 sysadm 1.1 <?php
2     //Log article operation into table bbs_article_log
3     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
7     A Add article
8     D Delete article
9     X Delete article by Admin
10     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    
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     return $ret;
28     }
29    
30     //Add/Subtract user exp
31     function user_exp_change(int $uid, int $exp_change, mysqli $db_conn = null) : mysqli_result | bool
32     {
33     $sql = "UPDATE user_pubinfo SET exp = exp + $exp_change WHERE UID = $uid";
34    
35     $ret = mysqli_query($db_conn, $sql);
36    
37     return $ret;
38     }

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