脚本格式<?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 |
作者最近主题
相关贴子
- anleye4.0商业版房产网如何安装和修改
- 网友学习研究交流分享资源:DZ学习研究交流【七豆】交友 1.2
- [1314]首页版块N格 V1.2.0 商业版 DZ学习研究交流
- it618积分商城 v4.5,版权走位问题
- 【西瓜】微社区美化 6.20150215
- it618团购商城 v1.4--------下载地址
- 【西瓜】同城商圈 49.20181015 【西瓜】同城优惠 22.20181014 更新谢谢
- 请问一下这个什么能有?
- it618自助广告系统 v2.6 DZ学习研究交流插件问题!!!
- 迪恩网络小米加强版 小米加强旗舰版GBK DZ学习研究交流
- 多配色城市门户-D6 商业版
- 求购手机版伪静态seo插件
- 婚庆、婚纱摄影门户频道
- [DX2.5] 恩斯道城市门户-D7 商业版1.1资源链接没有了
- V+ 手机模板 商业版GBK--------下载地址
- DZ学习研究交流 城市门户|生活论坛 商业版 GBK完整最新(2018.10.18更新)
- DZAPP系列套装安装使用全套说明教程及数据调用DIY扩展等-------下载地址
- Discuz X3.3 X3.2论坛用户组到期后不自动切换解决方案
- WordPress响应式自媒体资讯博客主题
- Discuz X3.2只是测试版,谁用谁后悔~