脚本格式<?php//全局嵌入点类(必须存在)class plugin_identifier { function HookId_1() { ...... return ...; } function HookId_2() { ...... return ...; } ......//脚本嵌入点类class plugin_identifier_CURSCRIPT extends plugin_identifier { function HookId_1() { ...... return ...; } function HookId_2() { ...... return ...; } ......}?>
插件嵌入点列表
- plugin_
- identifier
- CURSCRIPT
- HookId
函数名 | 调用位置 | 声明位置 | 第一个参数含义 |
HookId() | 所有模块执行前被调用 | 脚本嵌入点类 |
|
HookId_output() | 模块执行完毕,模板输出前被调用 | 脚本嵌入点类 | array('template' => 当前要输出的模版,'message' => showmessage 的信息内容,'values' => showmessage 的信息变量,)
|
global_HookId() | 模块执行完毕,模板输出前被调用 | 全局嵌入点类 |
|
HookId_message() | showmessage() 执行时调用 | 脚本嵌入点类 | array('param' => showmessage() 函数的参数数组,)
|
ad_adId() | 相应的广告位中调用函数名为广告位脚本 ID如:ad_headerbanner()
| 全局嵌入点类脚本嵌入点类
| array('params' => 广告位参数,'content' => 当前广告位原本将要显示的内容,)
|
common() | 所有模块执行前被调用 | 全局嵌入点类 |
|
discuzcode() | discuzcode() 函数执行时调用用于在帖子内容解析时嵌入自己的功能,函数中 $_G['discuzcodemessage'] 变量为待解析的字串
| 全局嵌入点类 | array('param' => caller 函数的参数数组,'caller' => caller 函数,此嵌入点被哪个函数调用'discuzcode' 被 discuzcode() 调用'messagecutstr' 被 messagecutstr() 调用)
|
deletethread() | deletethread() 函数执行时调用用于在主题删除前后嵌入自己的功能,此函数将在 deletethread() 中被调用 2 次,函数中 $_G['deletethreadtids'] 变量为待处理的 TID 数组
| 全局嵌入点类 | array('param' => deletethread() 函数的参数数组,'step' => 删除的步骤'check' 检测步骤'delete' 删除步骤)
|
deletepost() | deletepost() 函数执行时调用用于在帖子删除前后嵌入自己的功能,此函数将在 deletepost() 中被调用 2 次,函数中 $_G['deletepostids'] 变量为待处理的 ID 数组
| 全局嵌入点类 | array('param' => deletepost() 函数的参数数组,'step' => 删除的步骤'check' 检测步骤'delete' 删除步骤)
|
avatar()(X2.5 新增)
| avatar() 函数执行时调用用于在头像调用时嵌入自己的功能,函数中 $_G['hookavatar'] 变量为新头像返回值
| 全局嵌入点类 | array('param' => avatar() 函数的参数数组
) |
要查看所有的预定义嵌入点,请打开 config/config_global.php 文件,将文件结尾添加的设计者模式值改成“2”,然后更新缓存即可。在页面源码中查找"<hook>"可搜索到嵌入点。(详细内容可参阅的《插件嵌入点列表》)
$_config['plugindeveloper'] = 2;预定义的嵌入点会在页面预置好的位置输出函数返回的内容。函数返回值类型如果是 array 且是空值的,必须输出一个空数组,如:
return array();函数名并不限于以上列表,您可以自定义,只要符合以下规则,函数就会在适当的地方被调用。
function CURMODULE_USERDEFINE[_output]()CURMODULE 指明了此函数在哪个模块执行,可通过常量 CURMODULE 得到当前页面的 CURMODULE 值。 USERDEFINE 可自定义,如果函数名以“_output”结尾则会在模板输出前调用,否则会在模块执行前调用。如:attachment_test() 函数会在论坛的下载附件的时候执行。“_output”结尾的函数的第一个参数为数组,含义为 array('template' => 要输出的模板名, 'message' => showmessage 的文字) 如:以下函数将在登录的时候输出调试文字
function logging_test_output($a) { print_r($a); print_r($_POST);}plugin_identifier 类中的其它函数为了便于阅读建议以“_”开头,如:
<?phpclass plugin_sample { function _updatecache() { ...... return ...; }}class plugin_sample_forum extends plugin_sample { function viewthread_posttop() { ...... return ...; } ......}?>
插件嵌入点列表
- 全局(common/)
extcredits.htm string spacecp_credit_extra faq.htm string faq_extra footer.htm string global_footer string global_footerlink header.htm string global_cpnav_top (X2.5) string global_cpnav_extra1 string global_cpnav_extra2 string global_usernav_extra1 string global_usernav_extra2 string global_usernav_extra3 string global_usernav_extra4 (X2.5) string global_nav_extra (X2.5) string global_header userabout.htm array global_userabout_top string userapp_menu_top string userapp_menu_middle array global_userabout_bottom- 论坛(forum/)
- 群组(group/)
- 家园(home/)
- 注册/登录(member/)
- 门户(portal/)
- 排行榜(ranklist/)
- 搜索(search/)
- 应用(userapp/)
- 手机全局(mobile/common/)
- 手机论坛(mobile/forum/)
- 论坛(forum/)
收藏的用户(0)
X
正在加载信息~
评论
发新帖
主题数 8 |
帖子数 3 |
精华数 0 |
注册排名 1 |
作者最近主题
相关贴子
- 网盘伪装本地附件 1.1.4--------下载地址
- 【西瓜】同城拼团 11.20181127 DZ学习研究交流(站长窝魔方解密全网首发)
- Modown模板兔v4.11免授权版+资源付费下载插件【已测试】
- 子木CMS微信登录 小云APP打通版 1.7 DZ学习研究交流(求开放下载)
- [亮剑]精仿360问答 商业版DZ学习研究交流下载地址失效
- 请问为什么我的用户组变回了审核中!
- 人气火到爆 手机电脑人气 2.2--------下载地址
- 链接不存在
- 申请权限下发
- 站长窝 亮剑招聘的首页DIY文件是GBK我转了UTF8还是乱码
- 捐助这个授权,有什么奖励呢?(管理员来看)
- DZ学习研究交流的佳蓝!微信公众平台 万能版
- DZ学习研究交流的[1314]SEO超级PING V3.4.0商业版 专业开源[1314]
- 怎么获取贡献
- 犀牛门户帖子列表左侧导航
- 360问答自动采集 V10.01.05 自动采集 - DZ学习研究交流 · 插件 专业开源[1314]
- 关注微信注册吸粉 V1.0 价值69.9元
- DZ学习研究交流DZ插件禾今微信投票8.0
- 【亮剑】拼车系统 完整商业版1.3.6--------下载地址
- 体验会员没法登陆.一登陆就自动到这页面,反反复复在这页