MyBB Community Forums
Name and location displayed in postbit - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Name and location displayed in postbit (/thread-122921.html)



Name and location displayed in postbit - Knerba - 2012-07-20

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!


RE: Name and location displayed in postbit - faviouz - 2012-07-20

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.


RE: Name and location displayed in postbit - Knerba - 2012-07-20

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


RE: Name and location displayed in postbit - Polarbear541 - 2012-07-20

Can you post the code you have used?


RE: Name and location displayed in postbit - Knerba - 2012-07-21

Which one polarbear?


RE: Name and location displayed in postbit - Polarbear541 - 2012-07-21

(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 ^_^.


RE: Name and location displayed in postbit - SeeD - 2012-10-17

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