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: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 690
  • Total: 690

Users online

Started by haktanir, February 21, 2006, 09:29:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mcardo99

Thank you so much!!! =)

Atomiq25

it pisses me of that when i use this code shows other stuff like how many are guests and buddies

is there any way i can just show ONLINE members?

IchBin

There are a few of the online members ones. I have a couple of them that show avatars and member name of members online. What exactly are you looking for? Just names?

Atomiq25

name and avatar

with option of scrolling or not

--

and a way to show avatars on buddy list

i'm using this code:

Quote

global $scripturl, $db_prefix, $user_info, $txt;
        echo '<center><img src="URL-OF-FORUM/TITTLE-IMAGE.png" border="0" /><p>';
// Load the users online right now.
$result = db_query("
   SELECT
      lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
      mg.onlineColor, mg.ID_GROUP
   FROM {$db_prefix}log_online AS lo
      LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
      LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))", __FILE__, __LINE__);

$return['users'] = array();
$return['buddies'] = 0;
$show_buddies = !empty($user_info['buddies']);

while ($row = mysql_fetch_assoc($result))
{
        if (in_array($row['ID_MEMBER'], $user_info['buddies']) && (!empty($row['showOnline']) || allowedTo('moderate_forum')))
   {
      $return['buddies']++;
      // Some basic color coding...
      if (!empty($row['onlineColor']))
         $link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
      else
         $link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

      $return['users'][$row['logTime'] . $row['memberName']] = array(
         'id' => $row['ID_MEMBER'],
         'username' => $row['memberName'],
         'name' => $row['realName'],
         'group' => $row['ID_GROUP'],
         'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
         'link' => $link,
         'hidden' => empty($row['showOnline']),
         'is_last' => false,
      );
   }
}
mysql_free_result($result);

if (!empty($return['users']))
{
   krsort($return['users']);
   $userlist = array_keys($return['users']);
   $return['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
        foreach ($return['users'] as $user)
           echo $user['hidden'] ? '' . $user['link'] . '' : $user['link'], $user['is_last'] ? '' : ', ';
}
else
        echo '<span class="smalltext" >None of your friends are online.</span>';
       
       echo '
<p><li><a href="http://URL-OF-FORUM/index.php?action=profile;sa=editBuddies" ><span class="smalltext" >Edit buddies</span></a></li><li><a href="http://URL-OF-FORUM/index.php?action=mlist;sa=search" ><span class="smalltext" >Find your buddies</span></a></li>
';

echo '<img src="http://URL-OF-FORUM/TITTLE-IMAGE.png" border="0" /><p>';

ssi_whosOnline();

echo '</center>';


i'm using smf 1.1.11 and tp 1.0 beta 4



IchBin

You should put a request in the requests board if you're looking for something specific.

Atomiq25


This website is proudly hosted on Crocweb Cloud Website Hosting.