douwei3172 2012-04-27 17:26
浏览 71
已采纳

phpbb3如何让自定义配置文件字段显示在用户发布的帖子上?

I have this code: But it dosn't work.

from viewtopic_body.html

<!-- BEGIN custom_fields -->
    <!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "ingame_name" -->
        <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
    <!-- ENDIF -->
<!-- END custom_fields -->

My custom field name is called "ingame_username" and is set to display everywhere possible in the options, ive deleted the cache after making changes and still doesn't show.

How do I display is with the code structure above and how can I call it in other parts of the template?

Theres very limited documentation about this.

  • 写回答

1条回答 默认 最新

  • ds15812330851 2012-05-04 21:30
    关注

    I agree it is not very straight forward, since there are a few options you need to check under ACP, and you also have to edit your template. Here are the steps:

    1. Go to "ACP > Users and Groups (tab) > Custom Profile Fields (link) > Click on the settings icon" rename your custom field from "ingame_username" to "ingameusername", since the under score will cause issues.
    2. On that same page make sure that the "Display on viewtopic screen" option is checked for the field in question.
    3. Go to "ACP > General (tab) > Server Configuration (section) > Load Settings (link)", and make sure that the "Display custom Profile fields on topic pages" radio option is checked.
    4. Find the line in "viewtopic_body.html" that contains:

      {postrow.POSTER_FROM}

    Underneath it, add the following line (line 184 in phpbb 3.0.10):

    <!-- IF postrow.custom_fields.PROFILE_INGAMEUSERNAME_NAME --><dd><strong>{postrow.custom_fields.PROFILE_INGAMEUSERNAME_NAME}:</strong> {postrow.custom_fields.PROFILE_INGAMEUSERNAME_VALUE}</dd><!-- ENDIF -->
    

    That's it! You will now see the custom field and it's value on the Viewtopic Page.

    enter image description here

    Pete

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

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向