Advertisement:

Author Topic: Online User's avatars rotation  (Read 93234 times)

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Online User's avatars rotation
« on: July 10, 2004, 03:39:46 AM »
Here's a thought for a possible mod.

At the top of the default theme the "user info" section shows our own avatar. That's great, but I already know who I am and I already know that I'm online in teh forum.
How about if it showed the avatars of the other members online instead of our own avatar, rotating through the online list with each click in the same way as the "news box" changes the text?

[edit] changed topic title [/edit]
« Last Edit: September 29, 2004, 02:28:25 AM by A.M.A »
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline Vinoth

  • Full Member
  • ***
  • Posts: 569
  • Gender: Male
  • Hackers Are Not Crackers
Re: Who's online avatars
« Reply #1 on: July 10, 2004, 03:56:31 AM »
hmmmmm

idea is nice, but we have one below which shows users online/

so it is just waste of time for developers,
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Who's online avatars
« Reply #2 on: July 10, 2004, 05:16:02 AM »
 ::) In your opinion.

Well the users online only shows in Board Index only, doesn't it, therefore you only know who's online when you are there, not when you are in the middle of a board actually posting (which is where I happen to spend most on my time, not gazing at Board Index)

Reading this, look down. I don't see who's online ! If you do then I must be doing something wrong.

On Yabbse we were able to include who's online in the forum just under the news section using the 'User Browsing' mod kindly provided by Spaceman Spiff , It might be nice to take that one stage further for SMF :)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline damo1065

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Male
    • TheGaff
Re: Who's online avatars
« Reply #3 on: July 11, 2004, 07:20:46 PM »
There was a feature like this on the Yabb Forums down the bottom right of the forumboard. I actually thought this was cool - it had the last 5 people online and their avatars.

Nice feature - would be cool! ;D
Wy not visit my site... The Gaff'll be bored to be honest, unless you're from Cork in Ireland

Offline emrys

  • Semi-Newbie
  • *
  • Posts: 98
  • Gender: Male
Re: Who's online avatars
« Reply #4 on: July 11, 2004, 07:46:00 PM »
Ok do you mean with thier names on the Board Index stats area?

Offline Lord_Novice

  • Semi-Newbie
  • *
  • Posts: 51
  • Gender: Male
    • Pocket Heroes
Re: Who's online avatars
« Reply #5 on: July 31, 2004, 02:06:26 AM »
I like seeing my avatar at the top...
So i know wich avatar im using and if im online or not =P
and cuz i like my avatars, so looking at them doesnt kill me...
And even if it did, i wouldnt be able to complain anymore ;)
Não subestime os Superaprendizes

Pocket Heroes recruta Superaprendizes

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #6 on: August 03, 2004, 06:49:23 AM »
LOL, I just got done doing this on my site, although this is displayed on the side menu bar instead of where Users Online is, and it displays all users that have logged in since midnight (local board time).  Check it out.  I may be able to modify it to fit your needs.

Offline damo1065

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Male
    • TheGaff
Re: Who's online avatars
« Reply #7 on: August 03, 2004, 09:40:50 PM »
LOL, I just got done doing this on my site, although this is displayed on the side menu bar instead of where Users Online is, and it displays all users that have logged in since midnight (local board time).  Check it out.  I may be able to modify it to fit your needs.

Yeah that's what I'm talking about!!! It's sweet - it's like a YaBB forum before which had the last 5 people to have visited...their avatars down the bottom - very nice what you've done!
Wy not visit my site... The Gaff'll be bored to be honest, unless you're from Cork in Ireland

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #8 on: August 03, 2004, 09:57:10 PM »
Just let me know exactly (what to display, where, order, ...) what you need, and I'll see what I can do for you.  ;)

Offline damo1065

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Male
    • TheGaff
Re: Who's online avatars
« Reply #9 on: August 11, 2004, 11:31:22 AM »
Just let me know exactly (what to display, where, order, ...) what you need, and I'll see what I can do for you.  ;)

I 'd like to display the last 5 members with their avatars that have visited the forums. Down the bottom of the forum page.....between forum stats and mebers online. And when they visited.

 :D
Wy not visit my site... The Gaff'll be bored to be honest, unless you're from Cork in Ireland

Offline babylonking

  • SMF Friend
  • Full Member
  • *
  • Posts: 664
  • Gender: Male
  • Proudly Canadian
    • Assyrian Chaldean Online Community
Re: Who's online avatars
« Reply #10 on: August 11, 2004, 11:42:26 AM »
Hi Senkusha

Can you share the code here!

Thanks  :)

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #11 on: August 11, 2004, 11:49:13 AM »
Sure!  Just to be specific, do you want the five most recent online members or just the five most recent members?

Offline babylonking

  • SMF Friend
  • Full Member
  • *
  • Posts: 664
  • Gender: Male
  • Proudly Canadian
    • Assyrian Chaldean Online Community
Re: Who's online avatars
« Reply #12 on: August 11, 2004, 11:52:06 AM »
Sure!  Just to be specific, do you want the five most recent online members or just the five most recent members?

the most recent online should be fine  :)

Offline Vinoth

  • Full Member
  • ***
  • Posts: 569
  • Gender: Male
  • Hackers Are Not Crackers
Re: Who's online avatars
« Reply #13 on: August 11, 2004, 12:06:08 PM »
ah senuska

i need users online in 24 hrs, can u share the code for this one.

Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #14 on: August 11, 2004, 12:15:30 PM »
ah senuska

i need users online in 24 hrs, can u share the code for this one.

How, and where would you like this to display?

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #15 on: August 11, 2004, 12:55:09 PM »
Sure!  Just to be specific, do you want the five most recent online members or just the five most recent members?

the most recent online should be fine  :)

Here is the code to add the avatars to the listing. Note this code is for all Online members:

Open BoardIndex.php and find:
Code: [Select]
// 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, mg.groupName
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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))", __FILE__, __LINE__);

$context['users_online'] = array();
$context['list_users_online'] = array();
$context['online_groups'] = array();
$context['num_guests'] = 0;
$context['num_users_hidden'] = 0;
while ($row = mysql_fetch_assoc($result))
{
if (!isset($row['realName']))
{
$context['num_guests']++;
continue;
}
elseif (empty($row['showOnline']))
{
$context['num_users_hidden']++;
continue;
}

Replace it with the following code:
Code: [Select]
// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline, mem.avatar,
mg.onlineColor, mg.ID_GROUP, mg.groupName
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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))", __FILE__, __LINE__);


$context['users_online'] = array();
$context['list_users_online'] = array();
$context['online_groups'] = array();
$context['num_guests'] = 0;
$context['num_users_hidden'] = 0;
while ($row = mysql_fetch_assoc($result))
{
if (!isset($row['realName']))
{
$context['num_guests']++;
continue;
}
elseif (empty($row['showOnline']))
{
$context['num_users_hidden']++;
continue;
}
// The user Avatar...
if ($row['avatar'] == '')
$link = '&nbsp;<br>';
elseif (strtoupper(substr($row['avatar'],0,7)) == 'HTTP://')
$link = '<img src="' . $row['avatar'] . '" height="40"><br>';
else
$link = '<img src="' . $modSettings['avatar_url'] . '/' . $row['avatar'] . '" height="40"><br>';

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


And delete the following (repeated lines at the bottom now):
Code: [Select]
// 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>';

Now if you want to limit this query to only five members, change this:
Code: [Select]
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline, mem.avatar,
mg.onlineColor, mg.ID_GROUP, mg.groupName
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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))", __FILE__, __LINE__);

to this:
Code: [Select]
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline, mem.avatar,
mg.onlineColor, mg.ID_GROUP, mg.groupName
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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP)) LIMIT 5", __FILE__, __LINE__);

That should do the trick for you.  Make sure you make a backup copy of the BoardIndex.php file!  I have tested this on my board, but since I only had myself active at the time, I can not gauntee that it works.

Let me know if you have any problems.

Offline babylonking

  • SMF Friend
  • Full Member
  • *
  • Posts: 664
  • Gender: Male
  • Proudly Canadian
    • Assyrian Chaldean Online Community
Re: Who's online avatars
« Reply #16 on: August 11, 2004, 01:31:42 PM »
Can this be done with SSI cuz i want to add this code in my main web site page?

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #17 on: August 11, 2004, 01:35:10 PM »
Let me look into that.  I'm sure anything is possible with SSI, but I really haven't explored it too much.

How would you like the avatar, members displayed?  Any other information to be displayed?

Offline babylonking

  • SMF Friend
  • Full Member
  • *
  • Posts: 664
  • Gender: Male
  • Proudly Canadian
    • Assyrian Chaldean Online Community
Re: Who's online avatars
« Reply #18 on: August 11, 2004, 01:41:31 PM »
Let me look into that.  I'm sure anything is possible with SSI, but I really haven't explored it too much.

How would you like the avatar, members displayed?  Any other information to be displayed?

just the members name & Posts  ;)

Thanks again  :)

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Who's online avatars
« Reply #19 on: August 11, 2004, 03:06:38 PM »
Okay so you want something like this:

Each member listed, next to the number of total or posts for the day? (If I can compute that), and all these members have been active at least once during the past 24 hours?  Using SSI.

Quote
Member1 (202)
Member2 (54)
Member3 (9)
Member4 (1,234)
...