doukeng1922 2009-09-17 14:36
浏览 81
已采纳

如何将自定义字段传递给钩子(Invision Power Board [ipb] / PHP)

A long shot but here's hoping someone has some experience coding PHP hooks for Invisions Power Board forum.

I'm attempting to code a status addition and the PHP works fine on it's own, it's the passing of the IPB's reference to my hook that is the issue.

I.E. You setup a custom field in your forum for MSN Username, then from within a skin / template hook you pass the custom field to the hook and then use your PHP code to check on the status.

Here is the IPB skin code I am hooking into on Global->userInfoPane...

        <if test="authorcfields:|:$author['custom_fields'] != """>
                <foreach loop="customFieldsOuter:$author['custom_fields'] as $group => $data">
                        <foreach loop="customFields:$author['custom_fields'][ $group ] as $field">
                                <if test="$field != ''">
                                        <li>
                                                {$field}
                                        </li>
                                </if>
                        </foreach>
                </foreach>
        </if>

Although I could easily add my own skin hook here.

i.e.

<if test="myHookHere:|:1===1"></if>

Literally all I need is a single custom field entry from here passed to my hook. If I query every member when the hook is run then that will result in many extra sql queries per page view. All I want to do is pass that specific custom field to the hook...

i.e. myHookHere( $customfield['msn_username'] )

Is this possible? How do you reference the customfield? Can I execute pure PHP from here?

Appreciate anyone that can help! I tried the official invision forums but not had much luck.

  • 写回答

1条回答 默认 最新

  • dongwei4444 2010-03-08 18:32
    关注

    You might want to watch this thread over at IPB.. im having somewhat of a similiar question.. Im trying to style the $field title and $field value seperately.. this might help you as far as getting just the $field value information..

    link is: http://community.invisionpower.com/topic/306236-customize-custom-fields-view/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行