MyBB Community Forums

Full Version: Instant Messaging [info] in Post bit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there!

How can i put the Instant Messaging info in postbit?
No One!
Only "bump" threads after 24 hours of no response please.

Open up the postbit template and find the code that looks like this:
$post[usertitle]<br />
$post[userstars]
$post[groupimage]<br />
$post[useravatar]<br />
$lang->postbit_posts $post[postnum]<br />
$lang->postbit_group $usergroup[title]<br />
$lang->postbit_joined $post[userregdate]
Now simply add the code:
MSN: $post[msn]<br />
to this section.

For example, you could put it under the avatar and the code would look like this:
$post[usertitle]<br />
$post[userstars]
$post[groupimage]<br />
$post[useravatar]<br />
[b]MSN: $post[msn]<br />[/b]
$lang->postbit_posts $post[postnum]<br />
$lang->postbit_group $usergroup[title]<br />
$lang->postbit_joined $post[userregdate]

If you want other IM info, then use the following code:
AIM: $post[aim]
Yahoo: $post[yahoo]
ICQ: $post[icq]
First of all get the icons you want.

open ./inc/functions_post.php

find

eval("\$post['button_profile'] = \"".$templates->get("postbit_profile")."\";"); 

above it add

	if($post['aim'] != "")
		{
			$aim_icon = "<a href=\"member.php?action=profile&uid=".$post['uid']."\"><img src=\"images/aim.gif\" border=\"0\" /></a>";
		}
		if($post['icq'] != "" && $post['icq'] !=0)
		{
			$icq_icon = "<a href=\"member.php?action=profile&uid=".$post['uid']."\"><img src=\"images/icq.gif\" border=\"0\" /></a>";
		}
		if($post['yahoo'] != "")
		{
			$yahoo_icon = "<a href=\"mailto:".$post['yahoo']."\"><img src=\"images/yahoo.gif\" border=\"0\" /></a>";
		}
		if($post['msn'] != "")
		{
			$msn_icon = "<a href=\"mailto:".$post['msn']."\"><img src=\"images/msn.gif\" border=\"0\" /></a>";
		} 

You need to have the IM images the same name mentioned in the code, msn.gif, yahoo.gif etc.. uploaded to ./images

now in the postbit template

just add

<br />$aim_icon
$yahoo_icon
$msn_icon
$icq_icon

below

$lang->postbit_status $post[onlinestatus]$post[replink]<br />

regards
You should use the following instead, otherwise with posts following a user who has an AIM/MSN etc ID where the poster doesn't have one, it will use the previous users'.

    $aim_icon = $msn_icon = $yahoo_icon = $msn_icon = '';
    if($post['aim'] != "")
        {
            $aim_icon = "<a href=\"member.php?action=profile&uid=".$post['uid']."\"><img src=\"images/aim.gif\" border=\"0\" /></a>";
        }
        if($post['icq'] != "" && $post['icq'] !=0)
        {
            $icq_icon = "<a href=\"member.php?action=profile&uid=".$post['uid']."\"><img src=\"images/icq.gif\" border=\"0\" /></a>";
        }
        if($post['yahoo'] != "")
        {
            $yahoo_icon = "<a href=\"mailto:".$post['yahoo']."\"><img src=\"images/yahoo.gif\" border=\"0\" /></a>";
        }
        if($post['msn'] != "")
        {
            $msn_icon = "<a href=\"mailto:".$post['msn']."\"><img src=\"images/msn.gif\" border=\"0\" /></a>";
        } 
hmm never happend when i tested it :/
see u