MyBB Community Forums

Full Version: Custom profile fields in posts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
At the minute my forum just shows posts and joined information on posts and I want to show Custom Profile Fields here.

I read that you have to replace X with the field ID which you can find in the Admin CP Custom Profile Field management page using this PHP Code: $post[fidX] but I have no idea where in my template I add/edit this. I understand it's the postbit template I edit, just not where.

Here's the code I'm looking at

{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
	<tbody>
		<tr>
			<td class="tcat">
				<div class="float_left smalltext">
					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
				</div>
				{$post['posturl']}
			</td>
		</tr>

		<tr>
			<td class="trow1 {$unapproved_shade}">
				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
					<tr>
						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
							{$post['useravatar']}
						</td>
						<td class="post_author">
							<span class="largetext">{$post['profilelink']}</span> {$post['onlinestatus']}<br />
							<span class="smalltext">
								{$post['usertitle']}<br />
								{$post['userstars']}
								{$post['groupimage']}
							</span>
						</td>
						<td class="smalltext post_author_info" width="165">
							{$post['user_details']}
						</td>
					</tr>
				</table>
			</td>
		</tr>

		<tr>
			<td class="trow2 post_content {$unapproved_shade}">
				<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

				<div class="post_body" id="pid_{$post['pid']}">
					{$post['message']}
				</div>
				{$post['attachments']}
				{$post['signature']}

				<div class="post_meta" id="post_meta_{$post['pid']}">
				{$post['iplogged']}
				</div>
			</td>
		</tr>

		<tr>
			<td class="trow1 post_buttons {$unapproved_shade}">
				<div class="author_buttons float_left">
					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
				</div>
				<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
				</div>
			</td>
		</tr>
	</tbody>
</table>

I'd also like to show groups on posts if anyone knows how to do that too.
How do I display custom profile fields next to posts such as near the user title. I have searched but the only advice was to add a code to the Post Bit template and not where, etc.
Doesn't matter where it is, wherever you want to put it, in any of the postbit* templates should be fine. {$post['usertitle']} is in the postbit and postbit_classic template so if you want it near there, put it after that.
No one answered, you left and never came back; You could have bumped your thread:

(2010-07-07, 06:56 PM)Jack1 Wrote: [ -> ]...I understand it's the postbit template I edit, just not where....

Where?
1) Put it anywhere
2) See what happens
3) Repeat #1 and #2 Toungue