TinyPortal

Development => Feedback => Topic started by: Xarcell on October 26, 2005, 02:36:27 AM

Title: Buddies Block!
Post by: Xarcell on October 26, 2005, 02:36:27 AM
This would be a sweet feature...

Just an idea,

-Xarcell
Title: Re: Buddies Block!
Post by: Moocat on October 26, 2005, 03:05:50 AM
agreed. it should be call-able using an ssi function but i know nothing about that! :)
Title: Re: Buddies Block!
Post by: Xarcell on October 26, 2005, 03:15:32 AM
yep!
Title: Re: Buddies Block!
Post by: bloc on October 26, 2005, 12:18:28 PM
What should the buddies block do..? Show just your buddies?
Title: Re: Buddies Block!
Post by: Nokonium on October 26, 2005, 01:22:31 PM
Does the User block display buddies online?
Title: Re: Buddies Block!
Post by: gerrymo on October 26, 2005, 01:33:27 PM
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.
Title: Re: Buddies Block!
Post by: Oldiesmann on October 26, 2005, 04:43:19 PM
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...
Title: Re: Buddies Block!
Post by: Xarcell on October 26, 2005, 06:02:10 PM
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.
Title: Re: Buddies Block!
Post by: IchBin on October 27, 2005, 12:49:29 PM
You try that code above Xarcell?
Title: Re: Buddies Block!
Post by: Xarcell on October 27, 2005, 04:41:17 PM
not yet, I've yet to install tp. Been busy, but I will get to it sometime today.
Title: Re: Buddies Block!
Post by: redeye on October 27, 2005, 06:30:47 PM
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?
Title: Re: Buddies Block!
Post by: JayBachatero on October 27, 2005, 10:13:47 PM
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>';
    }
}
Title: Re: Buddies Block!
Post by: redeye on October 27, 2005, 10:57:18 PM
Cheers - worked a treat!
Title: Re: Buddies Block!
Post by: redeye on October 28, 2005, 12:56:11 PM
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.