MyBB Community Forums

Full Version: How To Echo Postbit User Information In Other Templates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Is it possible to show the postbit information in other templates, including username, avatar, and all the other info in the postbit?

For example, I would like to echo the entire postbit including {$post['usertitle']}, {$post['groupimage']}, {$post['useravatar']} and {$post['user_details']} in multiple different templates.
Hi,

It is possible to use this information in other templates. But the images will need to be enclosed in img tags and the registration date, reputation and warning points are all formatted properly in the code itself. So all you're basically getting is raw information from the DB. Regardless here are the variables you can use Smile

{$mybb->user['usertitle']}
<img src="{$mybb->usergroup['image']}"/>
<img src="{$mybb->user['avatar']}"/>
{$mybb->user['postnum']}
{$mybb->user['regdate']}
{$mybb->user['reputation']}
{$mybb->user['warningpoints']}
(2014-03-10, 11:33 PM)Polarbear541 Wrote: [ -> ]Hi,

It is possible to use this information in other templates. But the images will need to be enclosed in img tags and the registration date, reputation and warning points are all formatted properly in the code itself. So all you're basically getting is raw information from the DB. Regardless here are the variables you can use Smile

{$mybb->user['usertitle']}
<img src="{$mybb->usergroup['image']}"/>
<img src="{$mybb->user['avatar']}"/>
{$mybb->user['postnum']}
{$mybb->user['regdate']}
{$mybb->user['reputation']}
{$mybb->user['warningpoints']}

Hello,

Thank you for your help, but some things don't turn out correct. The regdate turns out like "1383734057" instead of "Nov 2013" and the warningpoints turns out like "0" instead of "0%" and nothing is a hyperlink, just text.

Is there a way to 'exactly' echo the current postbit in another template, with complete functionality (with links working)?
As I said the registration date, reputation and warning level are formatted within the code of showthread.php, member.php and everything else which actually displays this information.

Echoing the postbit out of the postbit templates and files isn't possible without either changing the core files or using a plugin. This is because the postbit uses information from the post (such as whether it is an announcement, preview or PM) to generate itself, if you are showing it outside of a post, it won't have this information Smile
(2014-03-11, 12:55 AM)Polarbear541 Wrote: [ -> ]As I said the registration date, reputation and warning level are formatted within the code of showthread.php, member.php and everything else which actually displays this information.

Echoing the postbit out of the postbit templates and files isn't possible without either changing the core files or using a plugin. This is because the postbit uses information from the post (such as whether it is an announcement, preview or PM) to generate itself, if you are showing it outside of a post, it won't have this information Smile

Would you know someone who is willing to show me the core file edits? I'm willing to pay whoever can do that for me.