【UCHome二次开发】cp_mtag.php

【完善中…】

UCHome中群组的显示页为space_mtag.php,群组的管理页为cp_mtag.php。

下面为cp_mtag.php的代码解析。

该文件包括五部分(一段代码和四个函数),如下:

1.line1~line545 一段直接执行的代码

while循环(line15~28):从profiled(群组分类信息表)中读取数据,把值赋给$_SGLOBAL['profield'][$value['fieldid']]

if(line31~231) :$_GET['op'] == ‘manage’ 群主——成员管理($subop=members),批量设置($subop=base)群成员——邀请好友($subop=invite) elseif(line231~243) :$_GET['op'] == ‘join’ 加入该群组

elseif(line243~263) :$_GET['op'] == ‘out’ 退出该群组

elseif(line263~287) :$_GET['op'] == ‘mtaginvite’ 群组邀请

elseif(line287~386) :$_GET['op'] == ‘inviteconfirm’ 确认邀请

elseif(line386~438):$_GET['op'] == ‘apply’ 申请群主

else(line438~542) :创建群组。

其中的几个函数:

checkperm(‘allowmtag’)——检查权限,在function_common.php中line513.注意,这里的实参即是allowmtag,传过去以后形参$permtype=allowmtag.

ckspacelog()——检查空间日志,在function_common.php中line2149.

ckrealname(‘thread’)——实名认证,在function_cp.php中line830.

ckvideophoto(‘thread’)—— 在function_cp.php中line841.

cknewuser($return=0)—— 在function_cp.php中line903.

submitcheck(‘textsubmit’)——判断提交是否正确,在function_common.php中line265.

line544 include template(“cp_mtag”); 包含模板

2.line546~line643 function mtag_join($type, $key, $fieldid=0)

此函数完成增加群组功能

3.line 646~line664 function mtag_out($mtag, $uids)

4.line667~line709 function mtag_managemember($mtag, $uids, $newgrade)

5.line711~line736 function note_apply($sqlarr)

【参考资料】 [1]http://www.cnblogs.com/xiaochaohuashengmi/archive/2010/05/27/1745629.html?login=1

No Comments.

Leave a Reply

(required)

(required)

:alien: :angel: :angry: :blink: :blush: :cheerful: :cool: :cwy: :devil: :dizzy: :ermm: :face: :getlost: :biggrin: :happy: :heart: :kissing: :lol: :ninja: :pinch: :pouty: :sad: :shocked: :sick: :sideways: :silly: :sleeping: :smile: :tongue: :unsure: :w00t: :wassat: :whistle: :wink: :wub: