collapse collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 116
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {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
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 PM

* Recent Posts

Where is the code for these elements, where are they stored? by danmsmith018f
[Yesterday at 04:23:44 PM]


Re: v 2.3.3 to v2.3.7 by ♦ Ninja ZX-10RR ♦
[December 11, 2018, 04:14:48 PM]


v 2.3.3 to v2.3.7 by rollingrock
[December 11, 2018, 09:36:20 AM]


[Block] Help with editing few lines on Simpleportal by Wallen
[December 09, 2018, 05:10:34 AM]


Re: LinkTree by Chen Zhen
[November 15, 2018, 02:24:51 PM]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: [Block] Advanced Who's Online  (Read 71118 times)

0 Members and 1 Guest are viewing this topic.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #20 on: August 10, 2011, 03:57:37 PM »
i'm not able to see the avatars of about 95% of my users... do u know why?

Try this:

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

/* SETUP HERE */
$mode '1'// 1 = SimplePortal Block with Avatars | 2 = Facebook like Block | 3 = SMF Forum like Block

$height '35px'// Avatar Height
$default_avatar 'URL HERE'//URL To the default avatar

$show_guests true// Show guests count
$show_spiders false// Show spiders count
$show_hidden true// Show hidden count
$show_users true// Show users count

$show_guests_users false// Show Guests and Users combined (SUM of the two)
$fake_online 1//Increase Guest number by multiplying for the value of fake_online

/**********************************************************************************/

// CODE FROM NOW ON! STOP HERE!
global $smcFunc$scripturl$sourcedir$modSettings$txt$settings$context;


$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' => $memberContext[$row_members['id_member']]['avatar']['href'],
  'hidden' => empty($row_members['show_online'])
   );
}
$smcFunc['db_free_result']($members_result);

$stats ssi_whosOnline('array');

// Output here we go!

if ($mode == '1') {

if ($show_guests_users) {
$number $stats['num_guests'] + $stats['num_users_online'];
$combined $number $fake_online;
echo sp_embed_image('dot'), ' Online: '$combined  .'<br />';
} else {
if ($show_guests)
echo sp_embed_image('dot'), ' '$txt['guests'], ': '$stats['num_guests'] * $fake_online .'<br />';
}

if ($show_hidden)
echo sp_embed_image('dot'), ' '$txt['hidden'] . ': ' $stats['num_users_hidden'] .'<br />';

if ($show_spiders && allowedTo('admin_forum'))
echo sp_embed_image('dot'), ' '$txt['spiders'] . ': ' $stats['num_spiders'] .'<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) {
if (!empty($member['avatar'])){
echo '<img style="border: 1px solid silver; padding: 1px; margin-bottom:2px;" src="' $member['avatar'] . '" height="' $height '" align="middle" title="' $member['username'] . '" alt="' $member['username'] . '" /> ' $member['profile'] . '<br />';
} else {
echo '<img style="border: 1px solid silver; padding: 1px; margin-bottom:2px;" src="' $default_avatar .'" alt="" height="' $height '" align="middle" title="' $member['username'] . '" alt="' $member['username'] . '" /> ' $member['profile'] . '<br />';
}
}
echo '</div>';

} elseif (
$mode == '2') {
echo '<div>';

foreach ($members as $member) {
echo '
<a href="' 
$member['link'] . '">';

if (!empty($member['avatar'])){
echo '<img style="border: 1px solid silver; padding: 1px; margin-top:1px;margin-left:1px;margin-bottom:1px;" src="' $member['avatar'] . '" height="' $height '" align="middle" title="' $member['username'] . '" alt="' $member['username'] . '" />';
} else {
echo '<img style="border: 1px solid silver; padding: 1px;  margin-top:1px;margin-left:1px;margin-bottom:1px;" src="' $default_avatar .'" alt="'$txt['default_avatar'], '" height="' $height '" align="middle" title="' $member['username'] . '" alt="' $member['username'] . '" />';
}

echo '</a>';
}
echo '</div><hr />';

if ($show_guests_users) {
$number $stats['num_guests'] + $stats['num_users_online'];
$combined $number $fake_online;
echo sp_embed_image('dot');

if (allowedTo('who_view') && !empty($modSettings['who_enabled']))
echo '<a href="' $scripturl '?action=who">';

echo ' Online: ';

if (allowedTo('who_view') && !empty($modSettings['who_enabled']))
echo '</a>';

echo $combined;

} else {
if ($show_guests)
echo sp_embed_image('dot'), ' '$txt['guests'], ': '$stats['num_guests'] * $fake_online .'&nbsp;|&nbsp;';

if ($show_users)
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_online'] : '';
}

if ($show_hidden)
echo '<br />' sp_embed_image('dot'), ' '$txt['hidden'] . ': ' $stats['num_users_hidden'];

if ($show_spiders && allowedTo('admin_forum'))
echo '&nbsp;|&nbsp;' sp_embed_image('dot'), ' '$txt['spiders'] . ': ' $stats['num_spiders'];

} else {
echo '<div>';

echo '<a style="font-size:1.1em;" href="' $scripturl '?action=who">';

if ($show_guests_users) {
$number $stats['num_guests'] + $stats['num_users_online'];
$combined $number $fake_online;
echo $combined  .' Online';
} else {
if ($show_guests)
echo $stats['num_guests'] * $fake_online ' ' $txt['guests'] . ', ';

if ($show_users)
echo $stats['num_users_online'] . ' ' $txt['users'];
}
if ($show_hidden)
echo ' (' $stats['num_users_hidden'] . ' ' $txt['hidden'] . ')';

if ($show_spiders && allowedTo('admin_forum'))
echo ' (' $stats['num_spiders'] . ' ' $txt['spiders'] . ')';

echo '</a><br /><span class="last smalltext">Users active in past minutes:</span><br />';

foreach ($members as $member) {
if ($stats['num_users_online'] == '1')
echo '<a href="' $member['link'] . '">' $member['profile'] . '</a> ';
else
echo '<a href="' $member['link'] . '">' $member['profile'] . '</a>, ';
}

echo '<hr /><span class="last smalltext">
'
$txt['most_online_today'], ': <strong>'comma_format($modSettings['mostOnlineToday']), '</strong>.
'
$txt['most_online_ever'], ': 'comma_format($modSettings['mostOnline']), ' ('timeformat($modSettings['mostDate']), ')
</span>'
;

echo '</div>';
}
?>
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Sapinho®

  • Full Member
  • ***
  • Posts: 168
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #21 on: August 10, 2011, 05:03:44 PM »
hi @blue why the avatar not shadow box color? is error in my config or not can do it? sorry i bad english

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #22 on: August 10, 2011, 05:39:43 PM »
hi @blue why the avatar not shadow box color? is error in my config or not can do it? sorry i bad english

It can be done. When its done I'll post back ;)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Sapinho®

  • Full Member
  • ***
  • Posts: 168
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #23 on: August 10, 2011, 11:22:10 PM »
ah XD ty i think i put config error.

your block are very nice

Offline Sapinho®

  • Full Member
  • ***
  • Posts: 168
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #24 on: August 12, 2011, 01:10:24 AM »
hi me again  :vampire:

Code: [Select]
echo '<img style="border: 1px solid silver; padding: 1px;  margin-top:1px;margin-left:1px;margin-bottom:1px;" src="' . $default_avatar .'" width="' . $width . '" alt="', $txt['default_avatar'], '" height="' . $height . '" align="middle" title="' . $member['username'] . '" alt="' . $member['username'] . '" />';
}

the value template launch error because

in the first post in the part of code, have one small error is the alt="', $txt['default_avatar'], '" only deleted this,

regadrs

Offline Zirc

  • Jr. Member
  • **
  • Posts: 53
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: [Block] Advanced Who's Online
« Reply #25 on: August 12, 2011, 02:24:06 PM »
hi me again  :vampire:

Code: [Select]
echo '<img style="border: 1px solid silver; padding: 1px;  margin-top:1px;margin-left:1px;margin-bottom:1px;" src="' . $default_avatar .'" width="' . $width . '" alt="', $txt['default_avatar'], '" height="' . $height . '" align="middle" title="' . $member['username'] . '" alt="' . $member['username'] . '" />';
}

the value template launch error because

in the first post in the part of code, have one small error is the alt="', $txt['default_avatar'], '" only deleted this,

regadrs

Yes I had to delete this as well since it was causing errors.

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #26 on: August 24, 2011, 07:28:45 AM »
Can you ad a scrollbar ?

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #27 on: August 24, 2011, 04:37:16 PM »
You have scrollbar in mode 4.

Do you want it in other mode?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #28 on: August 24, 2011, 04:40:43 PM »
You have scrollbar in mode 4.

Do you want it in other mode?
Yes Blue mode 4 and 5 don`t work at my site.
Thnx in advance.   :D

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #29 on: August 24, 2011, 04:55:11 PM »
They only work if you install Who's Online Today Mod ;)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #30 on: August 24, 2011, 04:57:55 PM »
They only work if you install Who's Online Today Mod ;)
Uhm i don`t want that Blue.
I don`t want that guest can see who are onlinle.
« Last Edit: August 24, 2011, 05:10:32 PM by wiecher »

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Female
    • My Kingdom
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #31 on: August 24, 2011, 06:29:43 PM »
Then put User online time threshold on zero. The guest's can't see nobody.

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #32 on: August 24, 2011, 06:31:54 PM »
Yes i installed that but i would love a scrollbar in mode 1 or 2.
Thnx.
Sorry for mi bad english i am dutch.

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Female
    • My Kingdom
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #33 on: August 24, 2011, 06:39:57 PM »
Yes i installed that but i would love a scrollbar in mode 1 or 2.
Thnx.
Sorry for mi bad english i am dutch.

The threshold ain't a mod. It's ready come with the forum.

Just log into your amine center and go down to Features and Options. When you get on that page. Just go down to the user online time threshold and put that on zero.

It's might do you good too.

I hope this help you some

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #34 on: August 24, 2011, 06:47:06 PM »
I still hope that there is a option to have a scrollbar in mode 1 or 2.
Thnx for helping me  :nervous-happy:

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Female
    • My Kingdom
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #35 on: August 24, 2011, 06:57:19 PM »
What browser are you using? That might be the problem

Your welcome!

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #36 on: August 24, 2011, 06:58:39 PM »
I am using Firefox mostley

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Female
    • My Kingdom
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #37 on: August 24, 2011, 07:02:29 PM »
Why try to get a diff browser like IE?

Of that aint the problem.

wiecher

  • Guest
Re: [Block] Advanced Who's Online
« Reply #38 on: August 24, 2011, 07:06:08 PM »
I just ask for making a scrollbar in mode 1 or 2.
The rest is working fine.
Mode 1 is perfect but is it stresting and growing.

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Female
    • My Kingdom
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: [Block] Advanced Who's Online
« Reply #39 on: August 24, 2011, 07:15:00 PM »
So the code is working for you now?

I'm glad.