Support ⇒ CPG-BB (forum) ⇒ [solved] Display Userfield in Forum? ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

[solved] Display Userfield in Forum? Reply to topic


Hi, I am trying to work out how to display a userfield in the forums currently, and failing miserably. 😢

We have 2 custom userfields in ForumsPro that I need to import into the current forums, bc2_tag and origin_id.

Currently they display a badge and links to stats for those games like this.

www.junglewraiths.net/...3351#43351

Try as I might, I can't get these to display in the current forums at all, so thought its time to hold the hand out for some help. Very Happy

Heres the ForumsPro code that works currently.

DisplayPosts.php (=viewtopic.php)

<?php $poster_bc2tag = ($poster_anonymous ? '' : $post['bc2_tag']); $poster_originid = ($poster_anonymous ? '' : $post['origin_id']); 'S_POSTER_BC2TAG' => $poster_bc2tag, 'S_POSTER_BC2TAG_HTML' => htmlprepare($poster_bc2tag), 'S_POSTER_ORIGINID' => $poster_originid, 'S_POSTER_ORIGINID_HTML' => htmlprepare($poster_originid), 'S_POSTER_INTERESTS' => $poster_interests, 'S_POSTER_INTERESTS_HTML' => htmlprepare

posts_lists.html (=view_topic_body.html

<!-- IF post.S_POSTER_BC2TAG --> <a href="/index.php?name=BFBC2_Stats&mode=view_profile&pid={post.S_POSTER_BC2TAG}" target="_blank"> <img src="http://g.bfbcs.com/24394/pc_{post.S_POSTER_BC2TAG}.png" border="0" alt="{post.S_POSTER_BC2TAG}'s BC2 Stats" title="{post.S_POSTER_BC2TAG}'s BC2 Stats" /> </a> <!-- ENDIF --> <br /> <!-- IF post.S_POSTER_ORIGINID --> <a href="http://bf3stats.com/stats_pc/{post.S_POSTER_ORIGINID}" target="_blank"> <img src="http://g.bf3stats.com/pc/561aSUeU/{post.S_POSTER_ORIGINID}.png" border="0" alt="{post.S_POSTER_ORIGINID}'s BF3 Stats" title="{post.S_POSTER_ORIGINID}'s BF3 Stats" /> </a> <!-- ENDIF -->


I'm getting there slowly, only this and the mutlirank hack left to go. Cool

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Replacing 'post.' with 'postrow.' should take you one step further.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


Really, so just add it all like that and change post to postrow?

I'm gonna die if its that easy!!!! Very late here now, will try it tomorrow night, thanks.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


ok got it thanks, will post the working code tomorrow.

jw.servegame.org/index...&t=114

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Heres what did the trick

viewtopic.php

$poster_bc2tag = ($poster_anonymous ? '' : $postrow[$i]['bc2_tag']); $poster_originid = ($poster_anonymous ? '' : $postrow[$i]['origin_id']); 'POSTER_BC2TAG' => $poster_bc2tag, 'POSTER_ORIGINID' => $poster_originid,

view_topic_body.html

<!-- IF postrow.POSTER_BC2TAG --> <a href="/index.php?name=BFBC2_Stats&mode=view_profile&pid={postrow.POSTER_BC2TAG}" target="_blank"> <img src="http://g.bfbcs.com/24394/pc_{postrow.POSTER_BC2TAG}.png" border="0" alt="{postrow.POSTER_BC2TAG}'s BC2 Stats" title="{postrow.POSTER_BC2TAG}'s BC2 Stats" /> </a> <!-- ENDIF --> <br /> <!-- IF postrow.POSTER_ORIGINID --> <a href="http://bf3stats.com/stats_pc/{postrow.POSTER_ORIGINID}" target="_blank"> <img src="http://g.bf3stats.com/pc/561aSUeU/{postrow.POSTER_ORIGINID}.png" border="0" alt="{postrow.POSTER_ORIGINID}'s BF3 Stats" title="{postrow.POSTER_ORIGINID}'s BF3 Stats" /> </a> <!-- ENDIF -->

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0

All times are UTC


Jump to: