TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 199
  • Total: 199

Buddies Block!

Started by Xarcell, October 26, 2005, 02:36:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

redeye

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?

JayBachatero

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>';
    }
}

redeye

Cheers - worked a treat!

redeye

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.