Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 钩子怎么没有数据输出呢?

[复制链接]
aidy520 发表于 2013-8-20 15:57:43 | 显示全部楼层 |阅读模式
jl文件夹下建立了一个jl.class.php文件,内容如下
  1. <?php
  2. if(!defined('IN_DISCUZ')) {
  3.         exit('Access Denied');
  4. }

  5. class plugin_jl_forum extends plugin_jl{
  6.         function viewthread_posttop() {
  7.                 //global $_G;
  8.                 //$aa=$_G['cache']['plugin']['jl']['text'];
  9.                 $cc='asdfasd';
  10.                 return $cc;
  11.         }
  12. }
  13. ?>
复制代码
已经在模块里添加了"页面嵌入-普通版",设置了。

viewthread_posttop()插件钩子在viewthread_node_body.htm这个页面。
1314学习网 发表于 2013-8-20 16:30:59 | 显示全部楼层
你继承的plugin_jl类在哪里
回复

使用道具 举报

 楼主| aidy520 发表于 2013-8-20 16:49:07 | 显示全部楼层
1314学习网 发表于 2013-8-20 16:30
你继承的plugin_jl类在哪里

plugin_jl类是空的。没有数据。。。。
回复

使用道具 举报

 楼主| aidy520 发表于 2013-8-20 16:49:45 | 显示全部楼层
1314学习网 发表于 2013-8-20 16:30
你继承的plugin_jl类在哪里
  1. <?php

  2. if(!defined('IN_DISCUZ')) {exit('Access Denied');}

  3. class plugin_jl {

  4. }

  5. class plugin_jl_forum extends plugin_jl {

  6.         function viewthread_posttop() {
  7.                 $aa='aaaaa';
  8.                 return array($aa);
  9.         }

  10. }
  11. ?>
复制代码
回复

使用道具 举报

1314学习网 发表于 2013-8-20 17:29:59 | 显示全部楼层
回复

使用道具 举报

 楼主| aidy520 发表于 2013-8-21 08:35:15 | 显示全部楼层

更新了没有效果,很奇怪的问题。。。。不知道哪里错了。
回复

使用道具 举报

hong340 发表于 2013-8-22 01:23:54 | 显示全部楼层
return $aa; 不是 array($aa)
回复

使用道具 举报

 楼主| aidy520 发表于 2013-8-22 22:28:32 | 显示全部楼层
hong340 发表于 2013-8-22 01:23
return $aa; 不是 array($aa)

问题解决了,返回的是一个数组,不是字符串。谢谢。
回复

使用道具 举报

凡人翻天 发表于 2013-8-25 21:27:35 | 显示全部楼层

哥们怎么才能设定在那个模板调用?
回复

使用道具 举报

 楼主| aidy520 发表于 2013-8-27 10:11:51 | 显示全部楼层
凡人翻天 发表于 2013-8-25 21:27
哥们怎么才能设定在那个模板调用?

include啊。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-22 00:52 , Processed in 0.198116 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表