/[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.7 - (hide annotations)
Sun Apr 13 05:06:58 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.6: +0 -2 lines
Remove set_recommend feature

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     //Display error message in a pop-up window
41 sysadm 1.5 function error_msg($msg, $back=false, $close=false)
42 sysadm 1.1 {
43     $ret = "<script language=\"JavaScript\">\n".
44 sysadm 1.2 " alert(\"".str_replace("\n","\\\n",$msg)."\");\n".
45 sysadm 1.1 ($back?" history.go(-1);\n":"").
46     ($close?" self.close();\n":"").
47     "</script>";
48    
49     echo $ret;
50     }
51    
52     ?>

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