MyBB Community Forums

Full Version: Name and location displayed in postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'll try to explain this the best I can. Here is what I'm looking to do.

I have added 2 custom profile details: Firstname and Location.

In postbit, I would it to show Firstname from Location.

eg: Benjamin from United Kingdom

Of course if the user has NOT entered these details, then this will NOT show. It doesn't matter if the user has only entered location.

eg: from United Kingdom

And nor does it matter if user only enters Firstname.

eg: Benjamin

But of course I wouldn't want it to show "Benjamin from"

Would be great if someone could point me in the right direction on how to go about this.

Many thanks in advance!
Install Template Conditionals and use this in your postbit template:

<if $post['fidX'] then>
	{$post['fidX']}
</if>

<if $post['fidY'] then>
	from {$post['fidY']}
</if>

Where X and Y are the IDs of the first name and location custom profile fields, respectively.
Thanks Fabio, it worked great but the only issue I'm facing is the following message on my integrated homepage.

Quote:Fatal error: Cannot redeclare class phptpl_templates in /home/neochatc/public_html/boards/inc/plugins/phptpl.php(70) : eval()'d code on line 26

Nevermind, fixed it! Smile
Can you post the code you have used?
Which one polarbear?
(2012-07-21, 07:20 PM)Knerba Wrote: [ -> ]Which one polarbear?

Don't worry you seem to have fixed it Toungue Must've missed that part of the post ^_^.
Hijacking thread for abit ...
I was using this in postbit_author_user
Quote: {$lang->postbit_posts} {$post['postnum']}<br />
%%TYL_NUMTHANKEDLIKED%%<br />
{$lang->postbit_joined} {$post['userregdate']}
{$post['replink']}{$post['warninglevel']}
<if $post['fid1'] then>
{$post['fid1']}
</if>

Got error code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /forum/inc/functions_post.php(399) : eval()'d code on line 6

A little help here?

EDIT: Nevermind, forgot to install conditional plugin ... Fixed ! Big Grin Thanks