Vbulletin插件开发教程 [英] Vbulletin plugin development tutorial
问题描述
我搜索了教程,但是没有找到任何有用的教程.我想创建一个简单的插件,将"123"添加到论坛每页的标题.
I searched for tutorials but i didn't found any useful tutorial. I want to create simple plugin which add "123" to header of every pages of forum.
我试图进入管理面板->创建新插件.但是我不知道我需要在标题中显示"123"的钩子.
I tried to go to admin panel -> create new plugin. But i don't know what hook i need to display "123" in header.
非常感谢您的帮助.
推荐答案
假定vBulletin 4及更高版本:
Assuming vBulletin 4 and above:
创建产品
- 登录到您的AdminCP
- 转到插件和放大器;产品->管理产品
- 点击添加/导入产品
- 在以下屏幕上,在添加新产品"部分中输入您的产品名称,等等(您可以将产品URL"和产品检查URL"留空)
向产品添加插件
- 转到插件和放大器;产品->添加新插件
- 选择您的产品
- 要在每个页面的标题中添加一些内容,请选择global_bootstrap_init_complete挂钩位置
-
在PHP代码中输入以下内容:
- Goto Plugins & Products -> Add New Plugin
- Select your Product
- To add something to the header on every page select the global_bootstrap_init_complete hook location
In PHP code enter the following:
$ template_hook ['mycustommesage'] ='hello world';
$template_hook['mycustommesage'] = 'hello world';
更新标题模板以包含插件输出
- 在ACP中,转到样式&模板->样式管理器
- 选择要编辑的样式,然后选择编辑模板
- 打开标题模板
-
要在任何地方显示插件输出,请添加:
- In ACP goto Styles & Templates -> Style Manager
- Select the style you want to edit and select edit templates
- Open the header template
Whereever you want you plugin output to appear add:
{vb:raw template_hook.mycustommesage}
{vb:raw template_hook.mycustommesage}
这篇关于Vbulletin插件开发教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!