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

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

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂