collapse

* User Info

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

* Who's Online

  • Dot Guests: 61
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Nucky: :D
    January 08, 2016, 10:53:07 am
  • ♦ Ninja ZX-10RR ♦: Merry Christmas to everyone :D
    December 25, 2015, 06:42:17 pm
  • Mark Parker: Yeah thanks for this awesome thing
    November 15, 2015, 03:10:44 am
  • Yahmez: Thanks for making simple portal... Many thanks.
    October 06, 2015, 09:16:18 pm
  • ♦ Ninja ZX-10RR ♦: Thank you for your kind words Phåråoh!
    September 26, 2015, 08:47:29 pm
  • Phåråoh: Good to see admin is still on top of things.  Some people don't take your VOLUNTEER work for granted.  We GREATLY appreciate it, whether it's a small thing or a major issue.
    September 26, 2015, 07:49:44 pm
  • ♦ Ninja ZX-10RR ♦: Kindly wait for replies in each topic, venting in the shoutbox is not going to help, I'm afraid. We are all volunteers and we might not be able to be online 24/7. Thank you for your understanding.
    September 13, 2015, 10:14:49 am
  • Cyberkid: >:( :| :'( :( no admin to fix this stuff
    September 13, 2015, 08:54:19 am
  • rentner: sorry be wrong
    August 19, 2015, 07:56:53 am
  • rentner: beta 2.1
    August 19, 2015, 07:56:32 am
  • ♦ Ninja ZX-10RR ♦: Lol thanks for considering me that much
    August 15, 2015, 01:22:47 pm
  • David: Eliana!! WADDUP, GURL!!!  SiNaN... glad y'all are still around!
    August 15, 2015, 11:27:21 am
  • ♦ Ninja ZX-10RR ♦: Welcome back :)
    August 15, 2015, 11:24:52 am
  • David: I missed y'all!!
    August 15, 2015, 11:23:22 am
  • Eliana Tamerin: People with colored usernames are staff, please abide by their requests.
    August 13, 2015, 04:43:00 pm
  • ♦ Ninja ZX-10RR ♦: Once again, this topic is *NOT* for support, anyway. Thank you for your understanding.
    August 13, 2015, 03:37:51 pm
  • ♦ Ninja ZX-10RR ♦: Please refrain from using such language in the shoutbox. Also, try to read the documentation, it should tell you that and more. [link]
    August 13, 2015, 03:36:48 pm
  • psewolf: Where are the settings on the admin panel?
    August 13, 2015, 02:00:32 pm
  • psewolf: I'm not making a whole damn topic to ask where the settings are on the admin panel.
    August 13, 2015, 02:00:15 pm
  • ♦ Ninja ZX-10RR ♦: Please don't spam the shoutbox, post a topic instead. Thank you.
    August 13, 2015, 01:30:02 am

* Recent Posts

Re: Incorrect pagination in articles by emanuele
[Today at 03:59:45 pm]


Re: SimplePortal 2.3.6 Released! by Chen Zhen
[February 05, 2016, 11:33:12 pm]


Re: Incorrect pagination in articles by ramzesito
[February 05, 2016, 04:32:36 pm]


Re: Possible bug with member group permissions and SP blocks by Burke Knight
[February 05, 2016, 01:42:00 pm]


Re: SimplePortal 2.3.6 Released! by ♦ Ninja ZX-10RR ♦
[February 05, 2016, 12:45:12 pm]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

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

0 Members and 1 Guest are viewing this topic.

Offline andy

  • Support
  • *
  • Posts: 729
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: [Block] Advanced Who's Online
« Reply #120 on: April 06, 2012, 02:32:19 am »
Who is online mod from the SMF site might help.
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 113
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #121 on: April 06, 2012, 03:39:21 pm »
Who is online mod from the SMF site might help.
Not sure what mod you refer to.  I did a search there for "WHO IS ONLINE" and "WHOS ONLINE" and I don't see any particular mod... only mods on how to remove or add permissions to WHOS ONLINE (which is already in SMF I do believe).


Offline andy

  • Support
  • *
  • Posts: 729
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: [Block] Advanced Who's Online
« Reply #122 on: April 07, 2012, 06:11:21 am »
Ah sorry... sloppy with the name:
Users Online Today

http://custom.simplemachines.org/mods/index.php?mod=217

Try that and the block will work.
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 113
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #123 on: April 07, 2012, 10:25:32 am »
That worked like a charm!  Thanks!

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 113
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #124 on: April 08, 2012, 04:15:14 am »
Ah... one more thing.  I notice that this mod uses the USER NAME rather than DISPLAY NAME.  I have a number of users who have different DISPLAY NAMES than USER NAMES... any insight on how I could change the mod to display the DISPLAY NAMES rather than USER NAMES?

Also,  any idea if this mod will be updated?  I'd love to see a mode with Simple Portal w/avatars for both Users Online and Users Today... that would rock (though the current block is still pretty damn cool... thank you!)

EDIT: I found code on page 3 to do just this... but it also eliminates AVATARS unfortunately.   I've tried to combine the code but I'm not very good at this and failed miserably.

« Last Edit: April 09, 2012, 02:59:33 pm by FrizzleFried »

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #125 on: May 27, 2012, 05:56:12 pm »
G'day Blue,

Great Mod mate.

The only issue im having is a can't see some of the Avatars I get the little white box with the red cross in it.

Can this be fixed?
« Last Edit: May 27, 2012, 10:40:39 pm by Ozzy Mozzy »

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #126 on: May 27, 2012, 10:40:16 pm »
G'day Blue,

Great Mod mate.

The only issue im having is a can't see some of the Avatars I get the little white box with the red cross in it.

Can this be fixed?


Disregard this, i worked it out...

Offline FireDitto

  • Jr. Member
  • **
  • Posts: 88
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #127 on: June 09, 2012, 07:25:12 am »
FrizzleFried;

Use this; I simply changed the "m.member_name" to "m.real_name" in the two places it popped up. It now reads off the member's screen name, instead of their login name =)

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

/* SETUP HERE */
$mode = '2'; // 1 = SimplePortal Block with Avatars | 2 = Facebook like Block | 3 = SMF Forum like Block
// 4 = Online Today -> SimplePortal Block like | 5 = Online Today -> SMF Forum like Block
// 6 = SimplePortal Block with Avatar PLUS Online Today SMF Forum like

$namebellowavatar = false; // If you want to show username bellow avatar (ONLY IN MODE 2)
$scrollbar = true; // Show scrollbar
$scrollheight = '70px'; // Fixed Height before scrollbar appears (ONLY WORKS IF $scrollbar IS TRUE)
$width = '35px'; // Avatar Width
$height = '35px'; // Avatar Height
$default_avatar = 'URL HERE'; //URL To the default avatar

$show_guests = true; // Show guests count
$show_spiders = true; // Show spiders count
$show_hidden = true; // Show hidden count
$show_users = true; // Show users count
$show_visible_today = true; // Show visible users of today (ONLY IN MODE 4 AND 5)
$show_hidden_today = true; // Show hidden users of today (ONLY IN MODE 4 AND 5)
$text['OnlineToday'] = 'Users Online Today'; // Translate it to your language (ONLY IN MODE 6)

$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.real_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['real_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!

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 $txt['guests'], ': '. $stats['num_guests'] * $fake_online .'<br />';
}

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

if ($show_spiders && allowedTo('admin_forum'))
echo $txt['spiders'] . ': ' . $stats['num_spiders'] .'<br />';

echo 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 ' . ($scrollbar ? 'style="overflow: auto; height: ' . $scrollheight . ';">' : '>');

foreach ($members as $member) {
if (!empty($member['avatar'])){
echo '<img style="border: 1px solid silver; padding: 1px; margin-bottom:2px;" src="' . $member['avatar'] . '" width="' . $width . '" 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 .'" width="' . $width . '" alt="" height="' . $height . '" align="middle" title="' . $member['username'] . '" alt="' . $member['username'] . '" /> ' . $member['profile'] . '<br />';
}
}
echo '</div>';

} elseif ($mode == '2') {

if (!$namebellowavatar)
echo '<div>';

foreach ($members as $member) {

if ($namebellowavatar)
echo '<div style="float: left;">';

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'] . '" width="' . $width . '" 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 .'" width="' . $width . '" alt="" height="' . $height . '" align="middle" title="' . $member['username'] . '" alt="' . $member['username'] . '" />';
}

echo '</a>' . ($namebellowavatar ? '<br /><span style="text-align: center;">' . $member['profile'] . '</span></div>' : '');
}

if (!$namebellowavatar)
echo '</div>';

echo '<div ' . ($namebellowavatar ? 'style="clear: left;">' : '>') . '<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 $txt['guests'], ': '. $stats['num_guests'] * $fake_online .' | ';

if ($show_users)
echo allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '<a href="' . $scripturl . '?action=who">' : '', 'Users', allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '</a>: ' . $stats['num_users_online'] : '';
}

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

if ($show_spiders)
echo ' | ' . $txt['spiders'] . ': ' . $stats['num_spiders'];

echo '</div>';

} elseif ($mode == '3') {
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>';


} elseif ($mode == '4') {

echo '<div ' . ($scrollbar ? 'style="overflow: auto; height: ' . $scrollheight . ';">' : '>');

$context += getUsersOnlineTodayStats();

echo $txt['uot_total'], ': ', $context['num_users_online_today'], '<br />';

if ($show_visible_today)
echo $txt['uot_visible'], ': ', $context['num_users_online_today'] - $context['num_users_hidden_today'] .'<br />';

if ($show_hidden_today)
echo $txt['uot_hidden'], ': ', $context['num_users_hidden_today'] .'<br />';


echo sp_embed_image('dot') . ' ' . $txt['users'] . ':<br />

<ul class="sp_list"><li class="sp_list_indent">';

echo sp_embed_image('user') . ' ' . implode('</li><li class="sp_list_indent">' . sp_embed_image('user') . ' ' , $context['list_users_online_today']);

echo '</ul></div>';

} elseif ($mode == '5') {

$context += getUsersOnlineTodayStats();

echo '<span style="font-size:1.1em;">' . $context['num_users_online_today'], ' ' , $txt['uot_total'] , ' ' , $txt['users'] . '</span>';

if ($show_visible_today OR $show_hidden_today)
echo ' (';

if ($show_visible_today)
echo $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_users_hidden_today']);

if ($show_visible_today AND $show_hidden_today)
echo ', ';

if ($show_hidden_today)
echo $txt['uot_hidden'], ': ', $context['num_users_hidden_today'];

if ($show_visible_today OR $show_hidden_today)
echo ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && $context['viewing_allowed'])
{
echo
'<br />', implode(', ', $context['list_users_online_today']);
}

} else {

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 $txt['guests'], ': '. $stats['num_guests'] * $fake_online .'<br />';
}

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

if ($show_spiders && allowedTo('admin_forum'))
echo $txt['spiders'] . ': ' . $stats['num_spiders'] .'<br />';

echo 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 ' . ($scrollbar ? 'style="overflow: auto; height: ' . $scrollheight . ';">' : '>');

foreach ($members as $member) {
if (!empty($member['avatar'])){
echo '<img style="border: 1px solid silver; padding: 1px; margin-bottom:2px;" src="' . $member['avatar'] . '" width="' . $width . '" 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 .'" width="' . $width . '" alt="" height="' . $height . '" align="middle" title="' . $member['username'] . '" alt="' . $member['username'] . '" /> ' . $member['profile'] . '<br />';
}
}
echo '</div><hr />';

// Online Today

$context += getUsersOnlineTodayStats();

echo $text['OnlineToday'], ': ', $context['num_users_online_today'];

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && $context['viewing_allowed'])
{
echo
'<br />', implode(', ', $context['list_users_online_today']);
}
}


I do have a mild issue, though, with a lack of the default avatar not showing up. Anyway around this?

weerforum

  • Guest
Re: [Block] Advanced Who's Online
« Reply #128 on: July 18, 2012, 02:19:30 pm »
Is it possible to ad a sound when someone go online ?

Offline wazza

  • Newbie
  • Posts: 3
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #129 on: July 20, 2012, 11:39:55 pm »
Works great thank you  :thumbsup:

Offline exit

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2.0.2
  • SP Version: 2.3.4
Re: [Block] Advanced Who's Online
« Reply #130 on: July 26, 2012, 09:19:36 am »
How to limit the number of users?

Something like:

Quote
Users active in past minutes:
User1, User2, User3 and 102 others...

weerforum

  • Guest
Re: [Block] Advanced Who's Online
« Reply #131 on: October 30, 2012, 04:09:13 pm »
I want to show how many members are online in numbers also.
Now i see this.
Please help  ;D

weerforum

  • Guest
Re: [Block] Advanced Who's Online
« Reply #132 on: November 06, 2012, 03:44:06 pm »
Any help please  ;)

Offline Blue

  • Customizer
  • *
  • Posts: 378
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #133 on: November 11, 2012, 01:51:48 pm »
Any help please  ;)

Added in my things to do list :)

As soon as I can I'll post back the code ;)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline ProtoGT

  • Semi Newbie
  • *
  • Posts: 16
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #134 on: November 12, 2012, 04:07:12 am »
Is there a way to make it so we can select certain groups we want displayed?

weerforum

  • Guest
Re: [Block] Advanced Who's Online
« Reply #135 on: November 12, 2012, 05:14:18 am »
Any help please  ;)

Added in my things to do list :)

As soon as I can I'll post back the code ;)

Thanx Blue  ;D

Offline Blue

  • Customizer
  • *
  • Posts: 378
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #136 on: November 12, 2012, 02:37:35 pm »
Is there a way to make it so we can select certain groups we want displayed?

That's pretty simple. Do you see the value id_group in the SQL? You just have to define it to the id_group that you wanna show. Do you understand? :nervous-happy:
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline ProtoGT

  • Semi Newbie
  • *
  • Posts: 16
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: [Block] Advanced Who's Online
« Reply #137 on: November 12, 2012, 06:13:48 pm »
Is there a way to make it so we can select certain groups we want displayed?

That's pretty simple. Do you see the value id_group in the SQL? You just have to define it to the id_group that you wanna show. Do you understand? :nervous-happy:

Could you elaborate on how to define it?

weerforum

  • Guest
Re: [Block] Advanced Who's Online
« Reply #138 on: November 21, 2012, 09:26:34 am »
How to hide as admin ?

Offline Blue

  • Customizer
  • *
  • Posts: 378
  • Gender: Male
  • Block Maker? =P
Re: [Block] Advanced Who's Online
« Reply #139 on: November 26, 2012, 06:37:44 pm »
Could you elaborate on how to define it?

Yes, I'll post back with an example as soon as I finish updating this block :)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.