·设为首页收藏本站📧邮箱修改🎁免费下载专区📒收藏夹📱AI全功能
返回列表 发布新帖

discuz x3.4 x3.5常用插件嵌入点参照表——其他

[复制链接]
362 1
发表于 2021-1-17 16:49:38 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
discuz x3.4 x3.5常用插件嵌入点参照表——其他:

排行榜(ranklist/)

side_left.htm

  • string ranklist_nav_extra

    搜索(search/)

    album.htm

    • string album_top
    • string album_bottom

      blog.htm

      • string blog_top
      • string blog_bottom

        footer.htm

        • string global_footer
        • string global_footerlink

          forum.htm

          • string forum_top
          • string forum_bottom

            group.htm

            • string group_top
            • string group_bottom

              header.htm

              • string global_usernav_extra1
              • string global_usernav_extra2

                portal.htm

                • string portal_top
                • string portal_bottom

                  应用(userapp/)

                  userapp_app.htm

                  • string userapp_app_top
                  • string userapp_app_bottom

                    userapp_index.htm

                    • string userapp_index_top
                    • string userapp_index_bottom
                    • userapp_menu_list.htm
                    • string userapp_menu_top
                    • string userapp_menu_middle
                    • string userapp_menu_bottom

                      手机全局(mobile/common/)

                      footer.htm

                      • string global_footer_mobile

                        header.htm

                        • string global_header_mobile

                          手机社区(mobile/forum/)

                          discuz.htm

                          • string index_top_mobile
                          • string index_middle_mobile
                          • string index_bottom_mobile

                            forumdisplay.htm

                            • string forumdisplay_top_mobile
                            • array forumdisplay_thread_mobile
                            • string forumdisplay_bottom_mobile

                              viewthread.htm

                              • string viewthread_top_mobile
                              • array viewthread_posttop_mobile
                              • array viewthread_postbottom_mobile
                              • string viewthread_bottom_mobile
我要说一句 收起回复
一花一世界,一叶一追寻。一曲一场叹,一生为一人。

评论1

AI智能体Lv.7 发表于 2025-3-21 06:57:22 | 查看全部
在Discuz X3.4和X3.5版本中,插件嵌入点是开发者用来在特定位置插入自定义代码或功能的钩子。以下是一些常用的插件嵌入点及其对应的模板文件和变量:

  • 排行榜(ranklist/)

  • side_left.htm
  • string ranklist_nav_extra


  • 搜索(search/)

  • album.htm
  • string album_top
  • string album_bottom
  • blog.htm
  • string blog_top
  • string blog_bottom


  • 全局页脚(footer.htm)

  • string global_footer
  • string global_footerlink


  • 论坛页面(forum.htm)

  • string forum_top
  • string forum_bottom


  • 群组页面(group.htm)

  • string group_top
  • string group_bottom


  • 全局页眉(header.htm)

  • string global_usernav_extra1
  • string global_usernav_extra2


  • 门户页面(portal.htm)

  • string portal_top
  • string portal_bottom


  • 应用(userapp/)

  • userapp_app.htm
  • string userapp_app_top
  • string userapp_app_bottom
  • userapp_index.htm
  • string userapp_index_top
  • string userapp_index_bottom
  • userapp_menu_list.htm
  • string userapp_menu_top
  • string userapp_menu_middle
  • string userapp_menu_bottom


  • 手机全局(mobile/common/)

  • footer.htm
  • string global_footer_mobile
  • header.htm
  • string global_header_mobile


  • 手机社区(mobile/forum/)

  • discuz.htm
  • string index_top_mobile
  • string index_middle_mobile
  • string index_bottom_mobile
  • forumdisplay.htm
  • string forumdisplay_top_mobile
  • array forumdisplay_thread_mobile
  • string forumdisplay_bottom_mobile
  • viewthread.htm
  • string viewthread_top_mobile
  • array viewthread_posttop_mobile
  • array viewthread_postbottom_mobile
  • string viewthread_bottom_mobile


这些嵌入点允许开发者在页面的不同位置插入自定义内容或功能。例如,如果你想在论坛页面的顶部添加一个自定义的横幅广告,你可以使用string forum_top嵌入点。

如何使用这些嵌入点?
  • 创建插件:首先,你需要在source/plugin/目录下创建一个新的插件目录。
  • 定义嵌入点:在插件的plugin.php文件中,使用hook函数来定义嵌入点。例如:

  
  1. function plugin_myplugin_hook_forum_top() {
  2.        echo '<div class="my-custom-banner">这是我的自定义横幅广告</div>';
  3.    }
复制代码
  • 注册嵌入点:在插件的plugin.php文件中,使用hookscript函数注册嵌入点:

  
  1. $plugins['hookscript'] = array(
  2.        'forum_top' => 'plugin_myplugin_hook_forum_top',
  3.    );
复制代码


通过这种方式,你可以在Discuz的不同页面中插入自定义的内容或功能,而不需要直接修改模板文件。这样可以确保在升级Discuz时,你的自定义内容不会丢失。

如果你有更多关于Discuz插件开发的问题,欢迎继续提问!
-- 本回答由 人工智能 AI智能体 生成,内容仅供参考,请仔细甄别。
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

最新热评 加载中...
AI智能体
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 ) 知道创宇云防御

您的IP:216.73.216.247(美国),GMT+8, 2026-10-30 03:15 , Processed in 0.281808 second(s), 52 queries , Gzip On, Redis On.

Powered by Discuz! X5.1 Licensed

© 2001-2026 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表