collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 447
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Whos online with avatar?  (Read 6232 times)

0 Members and 1 Guest are viewing this topic.

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Whos online with avatar?
« on: June 30, 2011, 07:07:23 AM »


Is this possible please?

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #1 on: July 02, 2011, 07:48:28 AM »
I take it this can not be done in the latest release? :'(

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Whos online with avatar?
« Reply #2 on: July 02, 2011, 11:57:38 AM »
Something like this?

If it works for you, I can make it like facebook instead of being a vertical list of avatar/user.

Code: [Select]
<?php
/*
Block: Who's Online with Avatar
Author: Blue @ Simple Portal.net
*/

// Let's grab some database results...
global $smcFunc$scripturl$sourcedir$modSettings$txt;


$members_result $smcFunc['db_query']('''
SELECT l.id_member, m.member_name, m.show_online, m.avatar, g.online_color, g.id_group, g.group_name
FROM {db_prefix}log_online AS l
LEFT JOIN {db_prefix}members AS m ON (m.id_member = l.id_member)
LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN m.id_group = 0 THEN m.id_post_group ELSE m.id_group END)
WHERE l.id_member > 0'
);
$members = array();
while ($row_members $smcFunc['db_fetch_assoc']($members_result))
{

      global 
$memberContext;
      
loadMemberData($row_members['id_member']);
      
loadMemberContext($row_members['id_member']);


   $members[] = array(
  'id' => $row_members['id_member'],
  'username' => '<a style="color: ' $row_members['online_color'] . ';" title="' $row_members['group_name'] . '" href="' $scripturl '?action=profile;u=' $row_members['id_member'] . '">' $row_members['member_name'] . '</a>',
  'avatar' => $row_members['avatar'] == '' $memberContext[$row_members['id_member']]['avatar']['href'] : (stristr($row_members['avatar'], 'http://') ? $row_members['avatar'] : $modSettings['avatar_url'] . '/' $row_members['avatar']),
  'hidden' => empty($row_members['show_online'])
   );
}
$smcFunc['db_free_result']($members_result);

$stats ssi_whosOnline('array');

// Output here we go!
echo sp_embed_image('dot'), ' '$txt['guests'], ': '$stats['num_guests'] .'<br />';

echo sp_embed_image('dot'), ' 'allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '<a href="' $scripturl '?action=who">' ''$txt['online_users'], allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '</a>' ''':
<br /><div>'
;

foreach ($members as $member)
echo '<img style="margin-bottom: 2px;" src="' $member['avatar'] . '" width="30px" height="30px" align="middle" />&nbsp;' $member['username'] . '<br />';

echo '</div>';
?>
« Last Edit: July 03, 2011, 10:03:39 AM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #3 on: July 08, 2011, 04:07:57 PM »
Works a treat, thanks a lot..

Can i have the facebook code to see which i prefer please?
« Last Edit: July 08, 2011, 04:15:17 PM by zapiy »

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Whos online with avatar?
« Reply #4 on: July 08, 2011, 10:35:36 PM »
Advanced Who's Online is going to be my next block so this code is in beta since the layout is going to get better but have a look and tell me what you think. Images attached.

Code: [Select]
<?php
/*
Block: Who's Online with Avatar
Author: Blue @ Simple Portal.net
Version: 0.1beta
*/

// Let's grab some database results...
global $smcFunc$scripturl$sourcedir$modSettings$txt;


$members_result $smcFunc['db_query']('''
SELECT l.id_member, m.member_name, m.show_online, m.avatar, g.online_color, g.id_group, g.group_name
FROM {db_prefix}log_online AS l
LEFT JOIN {db_prefix}members AS m ON (m.id_member = l.id_member)
LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN m.id_group = 0 THEN m.id_post_group ELSE m.id_group END)
WHERE l.id_member > 0'
);
$members = array();
while ($row_members $smcFunc['db_fetch_assoc']($members_result))
{

      global 
$memberContext;
      
loadMemberData($row_members['id_member']);
      
loadMemberContext($row_members['id_member']);


   $members[] = array(
  'id' => $row_members['id_member'],
  'username' => $row_members['member_name'],
  'profile' => '<a style="color: ' $row_members['online_color'] . ';" title="' $row_members['group_name'] . '" href="' $scripturl '?action=profile;u=' $row_members['id_member'] . '">' $row_members['member_name'] . '</a>',
  'link' => $scripturl '?action=profile;u=' $row_members['id_member'],
  'avatar' => $row_members['avatar'] == '' $memberContext[$row_members['id_member']]['avatar']['href'] : (stristr($row_members['avatar'], 'http://') ? $row_members['avatar'] : $modSettings['avatar_url'] . '/' $row_members['avatar']),
  'hidden' => empty($row_members['show_online'])
   );
}
$smcFunc['db_free_result']($members_result);

$stats ssi_whosOnline('array');

// Output here we go!

echo '<div>';

foreach ($members as $member) {
echo '
<a href="' 
$member['link'] . '">
<img style="margin-top:2px;margin-left:2px;margin-bottom:2px;" src="' 
$member['avatar'] . '" width="35px" height="35px" align="middle" title="' $member['username'] . '" alt="' $member['username'] . '" />
</a>'
;
}
echo '</div><hr />';

echo sp_embed_image('dot'), ' '$txt['guests'], ': '$stats['num_guests'] .'&nbsp;|&nbsp;';
echo sp_embed_image('dot'), ' 'allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '<a href="' $scripturl '?action=who">' '''Users'allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '</a>:&nbsp;' $stats['num_users'] : '';


?>
« Last Edit: July 08, 2011, 10:40:02 PM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline kimyaci

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
    • Forumigo8navigation
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #5 on: July 15, 2011, 05:46:20 PM »
if the avatar is not selected. No avatar, how shows? Thanks.
SMF 2.0.7 HabboArtv1, Default Themes.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #6 on: July 15, 2011, 06:09:24 PM »
if the avatar is not selected. No avatar, how shows? Thanks.

So an avatar always shows and the users have no selected avatar I would try and install the default avatar mod.

Blue this looks rather good for those whom don't like long lists of names.

How would the spiders and hidden users be included?
« Last Edit: July 15, 2011, 06:14:22 PM by Brack1 »
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Whos online with avatar?
« Reply #7 on: July 15, 2011, 06:47:48 PM »
if the avatar is not selected. No avatar, how shows? Thanks.

It doesn't show but this is 0.1beta. I'm going to make it perfect through out this week. July 20 I'll post the 1.0 version.

How would the spiders and hidden users be included?

This feature will be included in 1.0 version ;)
« Last Edit: July 15, 2011, 06:54:57 PM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #8 on: July 15, 2011, 06:56:02 PM »
Careful I might ask for Users in Chat and Arcade too.

 >:-D
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 51
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #9 on: July 15, 2011, 06:58:26 PM »
This is a great block Blue.

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #10 on: July 16, 2011, 11:43:52 AM »
Another great BB (= Blues`s Block) !

Is there a way, to make it compatible with the "User-Online-Today"-Mod?
« Last Edit: July 16, 2011, 05:17:19 PM by Divecall »

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Whos online with avatar?
« Reply #11 on: July 16, 2011, 04:47:45 PM »
Careful I might ask for Users in Chat and Arcade too.

 >:-D

Ahahah! Maybe for 1.1. We never know :P

Another great BB (= Bues`s Block) !

Is there a way, to make it compatible with the "User-Online-Today"-Mod?

1º Thank You :P
2º Maybe for 1.1 too. First I need to perfect the code. After that, I'll start to add features :)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 51
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Whos online with avatar?
« Reply #12 on: July 19, 2011, 08:57:53 PM »
I look forward to your release of this block Blue  :D

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Whos online with avatar?
« Reply #13 on: July 20, 2011, 03:16:03 PM »
I'm going to see if I can finish it today. If not I'll post it tomorrow.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.