This would be a sweet feature...
Just an idea,
-Xarcell
agreed. it should be call-able using an ssi function but i know nothing about that! :)
yep!
What should the buddies block do..? Show just your buddies?
Does the User block display buddies online?
Quote from: Bloc on October 26, 2005, 12:18:28 PM
What should the buddies block do..? Show just your buddies?
Username linked to profile?
PM Icon next to username?
Only a couple of ideas. Its not a feature I use, but a few members of my site do use it.
Unfortunately it seems that SMF's buddy list just stores the member IDs and nothing else. However, maybe something like this?
<?php
include_once('/path/to/forum/SSI.php');
if(count($context['member']['buddies']) != 0)
{
$query = db_query("SELECT ID_MEMBER, realName FROM {$db_prefix}members WHERE ID_MEMBER IN (" . implode(',', $context['member']['buddies']) . ")", __FILE__, __LINE__);
while($results = mysql_fetch_assoc($query))
{
$buddies[] = array('name' => $results['realName'], 'ID_MEMBER' => $results['ID_MEMBER']);
}
natcasesort($buddies);
echo '<div align="center"><b>Buddy List</b></div>';
foreach($buddies AS $buddy)
{
echo '<br /><a href="' , $scripturl, '?action=profile;sa=summary;u=', $buddy['ID_MEMBER'], '"><b>', $buddy['name'], '</b></a>';
}
}
?>
That will give you a list of links to all your buddies' profiles...
Well, during the summer months I can have up to 100 user's online at once. So I disabled the show user names, simiply because the list is too long. During school season, I may have 2-6 members on at once. See, so I keep toggling back and forth.
If I had a block to just display my buddies, it would alot easier for me to keep up with my user's/friends.
You try that code above Xarcell?
not yet, I've yet to install tp. Been busy, but I will get to it sometime today.
I've tried it, but no success unfortunately.
Am I right in just pasting the code into a php block and then correcting the path statement?
Actually all you would need is this on a php block since tp already makes the call for SSI.php
if(count($context['member']['buddies']) != 0)
{
$query = db_query("SELECT ID_MEMBER, realName FROM {$db_prefix}members WHERE ID_MEMBER IN (" . implode(',', $context['member']['buddies']) . ")", __FILE__, __LINE__);
while($results = mysql_fetch_assoc($query))
{
$buddies[] = array('name' => $results['realName'], 'ID_MEMBER' => $results['ID_MEMBER']);
}
natcasesort($buddies);
echo '<div align="center"><b>Buddy List</b></div>';
foreach($buddies AS $buddy)
{
echo '<br /><a href="' , $scripturl, '?action=profile;sa=summary;u=', $buddy['ID_MEMBER'], '"><b>', $buddy['name'], '</b></a>';
}
}
Cheers - worked a treat!
Quote from: redeye on October 27, 2005, 10:57:18 PM
Cheers - worked a treat!
Oh dear, thought it had worked.
Shows the Buddy block but not buddies who are online.