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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Tue Apr 1 04:17:10 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.3: +0 -6 lines
Refine

1 <?
2 //Log article operation into table bbs_article_log
3 function article_op_log($aid,$uid,$op_type,$ip_addr,$db_conn=null)
4 {
5 /*
6 Type Description
7 A Add article
8 D Delete article
9 S Restore article
10 L Lock article
11 U Unlock article
12 M Modify article
13 T Move article
14 E Set article as excerption
15 O Unset article as excerption
16 F Set article on top
17 V Unset article on top
18 R Recommend article
19 N Unrecommend article
20 Z Set article as trnasship
21 */
22 $ret = mysql_query("insert into bbs_article_op(AID,UID,type,op_dt,op_ip)".
23 " values($aid,$uid,'$op_type',now(),'$ip_addr')",$db_conn);
24
25 return $ret;
26 }
27
28 //Add/Subtract user exp
29 function user_exp_change($uid,$exp_change,$db_conn=null)
30 {
31 $ret = mysql_query("update user_pubinfo set exp=exp+$exp_change".
32 " where UID=".$uid);
33
34 return $ret;
35 }
36
37 //Display error message in a pop-up window
38 function error_msg($msg,$back=false,$close=false)
39 {
40 $ret = "<script language=\"JavaScript\">\n".
41 " alert(\"".str_replace("\n","\\\n",$msg)."\");\n".
42 ($back?" history.go(-1);\n":"").
43 ($close?" self.close();\n":"").
44 "</script>";
45
46 echo $ret;
47 }
48
49 ?>

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