SimplePortal

Customization => Blocks and Modifications => Topic started by: Blue on July 21, 2011, 06:00:19 PM

Title: [Block] Advanced Who's Online
Post by: Blue on July 21, 2011, 06:00:19 PM
Advanced Who's Online Block
[Made by Blue][I hope you like it =D]

Description: A block that shows who is online in 3 different ways totally customizable

SETUP INSIDE:
+ 5 Modes of Display: Simple Portal Who's Online with Avatar | Facebook like who's online | SMF forum like who's online | Online Today Simple Portal Who's Online (needs ONLINE TODAY MOD to work) | Online Today SMF forum like who's online (needs ONLINE TODAY MOD to work)
+ Set width and height of the avatar
+ Set URL of Default Avatar (if a user doesn't have one)
+ Show/Hide Guests, Users, Spiders and Hidden Users
+ Show Guests and Users combined as Online (e.g. Online: 7 people)
+ Increase Guest number by multiplying for the value of fake_online string

Author Notes:
I think that the default who's online block from simple portal is fine but some users need something better so I created this block.

Suggestions are welcome.

NEW VERSION:
1.1 -> Added Who's Online Today
1.2 -> Added Scrollbar to mode 4
1.3 -> Bug fix
1.4 -> Added mode 6; Added Scrollbar in mode 1; Added Usernames bellow avatar in mode 2

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

/* SETUP HERE */
$mode '1'; // 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 true// 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 false// 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.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!

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 ' 
. ($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 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'];

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 sp_embed_image('dot'), ' '$txt['uot_total'], ': '$context['num_users_online_today'], '<br />';

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

if ($show_hidden_today)
echo sp_embed_image('dot'), ' '$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 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 ' 
. ($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 sp_embed_image('dot'), ' '$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']);
}
}

?>
Title: Re: [Block] Advanced Who's Online
Post by: Yngwiedis on July 21, 2011, 06:31:57 PM
Can we keep the avatar proportions somehow ?
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 21, 2011, 06:47:41 PM
Yes, here:

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' => $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 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') . ' Online: ' $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>';
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: Yngwiedis on July 21, 2011, 06:51:55 PM
This is ok.

But in Facebook like mode there is no "who is online" link...
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 21, 2011, 06:57:20 PM
Yes, there is ;) Click in "Users"
Title: Re: [Block] Advanced Who's Online
Post by: S@ffz on July 21, 2011, 07:03:55 PM
yet another great Block thank you Blue  :D
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 21, 2011, 07:04:45 PM
yet another great Block thank you Blue  :D

eheh! Thank you saffz :)
Title: Re: [Block] Advanced Who's Online
Post by: Yngwiedis on July 21, 2011, 07:11:39 PM
Yes, there is ;) Click in "Users"

The word "Users" is no displayed in the block when i put it in Facebook like mode...
Title: Re: [Block] Advanced Who's Online
Post by: Divecall on July 21, 2011, 07:25:17 PM
I know, you are working hard, but -LATER- think about support for the "User Online Today" Mod...

 :-[ ;)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 21, 2011, 07:25:58 PM
You are right. I forgot to add the link when guest and users are combined.

Here:
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' => $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 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>';
}
?>

I know, you are working hard, but -LATER- think about support for the "User Online Today" Mod...

 :-[ ;)

It's going to be in 1.1 version ;)
Title: Re: [Block] Advanced Who's Online
Post by: Yngwiedis on July 21, 2011, 07:39:08 PM
You are right. I forgot to add the link when guest and users are combined.


Its ok now :)

Thank you very very much.
Title: Re: [Block] Advanced Who's Online
Post by: rocknroller on July 22, 2011, 12:05:47 PM
awesome :D
Title: Re: [Block] Advanced Who's Online
Post by: RaulVK on July 24, 2011, 12:15:48 PM
You could add a box-shadow in mode 2?. Depending on the user group it is, change color.

Sample: (http://img705.imageshack.us/img705/8291/sinttulo1iu.jpg)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 24, 2011, 09:02:10 PM
I know, you are working hard, but -LATER- think about support for the "User Online Today" Mod...

 :-[ ;)

Done :) Version 1.1 Uploaded

You could add a box-shadow in mode 2?. Depending on the user group it is, change color.

Sample: (http://img705.imageshack.us/img705/8291/sinttulo1iu.jpg)

It's going to be possible in version 1.2 ;)
Title: Re: [Block] Advanced Who's Online
Post by: Divecall on July 25, 2011, 03:47:04 PM
@Blue: Thank you, worked like a charm...

It is possible to show the "user online today" with a scroll-bar (not the complete list)?

The code for the shadow you can find here:
http://www.skinmod.eu/index.php?topic=1028.0
Title: Re: [Block] Advanced Who's Online
Post by: RaulVK on July 26, 2011, 08:08:56 PM
You could add a box-shadow in mode 2?. Depending on the user group it is, change color.

Sample: (http://img705.imageshack.us/img705/8291/sinttulo1iu.jpg)

It's going to be possible in version 1.2 ;)

Thanksss!!!!! :nervous-happy:
Title: Re: [Block] Advanced Who's Online
Post by: Blue on July 31, 2011, 01:09:39 PM
It is possible to show the "user online today" with a scroll-bar (not the complete list)?

It's done Divecall ;)

Version 1.2 released.
Title: Re: [Block] Advanced Who's Online
Post by: Divecall on August 01, 2011, 07:34:12 PM
Thank you, Sir!
Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 02, 2011, 07:35:20 PM
Glad you liked :)
Title: Re: [Block] Advanced Who's Online
Post by: raffo on August 10, 2011, 03:39:32 AM
i'm not able to see the avatars of about 95% of my users... do u know why?
Title: Re: [Block] Advanced Who's Online
Post by: Blue 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>';
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: Sapinho® 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
Title: Re: [Block] Advanced Who's Online
Post by: Blue 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 ;)
Title: Re: [Block] Advanced Who's Online
Post by: Sapinho® on August 10, 2011, 11:22:10 PM
ah XD ty i think i put config error.

your block are very nice
Title: Re: [Block] Advanced Who's Online
Post by: Sapinho® 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
Title: Re: [Block] Advanced Who's Online
Post by: Zirc 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.
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on August 24, 2011, 07:28:45 AM
Can you ad a scrollbar ?
Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 24, 2011, 04:37:16 PM
You have scrollbar in mode 4.

Do you want it in other mode?
Title: Re: [Block] Advanced Who's Online
Post by: wiecher 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
Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 24, 2011, 04:55:11 PM
They only work if you install Who's Online Today Mod ;)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher 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.
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on August 24, 2011, 06:29:43 PM
Then put User online time threshold on zero. The guest's can't see nobody.
Title: Re: [Block] Advanced Who's Online
Post by: wiecher 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.
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen 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
Title: Re: [Block] Advanced Who's Online
Post by: wiecher 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:
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on August 24, 2011, 06:57:19 PM
What browser are you using? That might be the problem

Your welcome!
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on August 24, 2011, 06:58:39 PM
I am using Firefox mostley
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on August 24, 2011, 07:02:29 PM
Why try to get a diff browser like IE?

Of that aint the problem.
Title: Re: [Block] Advanced Who's Online
Post by: wiecher 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.
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on August 24, 2011, 07:15:00 PM
So the code is working for you now?

I'm glad.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 24, 2011, 07:33:01 PM
Here:

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

/* SETUP HERE */
$mode '1'; // 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

$scrollheight '100px';
$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 false// 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)


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

echo 
'<div 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') {
echo 
'<div style="overflow: auto; height: ' $scrollheight ';">';

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'] . '" 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="'$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'];

} 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 style="overflow: auto; height: ' $scrollheight ';">';

$context += getUsersOnlineTodayStats();

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

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

if ($show_hidden_today)
echo sp_embed_image('dot'), ' '$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>';

} else {

$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']);
}
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: RaulVK on August 25, 2011, 04:50:58 AM
Instead height: ' . $scrollheight . ',  replace by max-height: ' . $scrollheight . '  Right?


Translated by Google


Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 25, 2011, 11:20:40 PM
Yes, you can do that ;)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on August 29, 2011, 06:15:30 PM
Works perfect.
Is it possible to hide usernames for guest ?
Title: Re: [Block] Advanced Who's Online
Post by: Blue on August 29, 2011, 06:20:55 PM
You want guests to see the stats but not the usernames?
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on August 29, 2011, 06:21:57 PM
You want guests to see the stats but not the usernames?
Yes please  ;D :D ;D

I have this block.

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 '20px'// 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 false// Show hidden count
$show_users true// Show users count

$show_guests_users false// Show Guests and Users combined (SUM of the two)
$fake_online 17//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>';
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: Divecall on August 30, 2011, 12:17:04 PM
@Blue,

since i'm using your block-code i have my error log full with "undefined index: default_avatar"...

it is a language problem?
Title: Re: [Block] Advanced Who's Online
Post by: Sapinho® on August 30, 2011, 02:05:43 PM
not are, is a error of finger, search in the code of @blue this

Code: [Select]
alt="', $txt['default_avatar'], '"

and deleted, this is the problem,

this not make problem because the property is forward
Code: [Select]
title="' . $member['username'] . '" alt="' . $member['username'] . '"
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 01, 2011, 03:06:48 AM
Blue,

Can you do a code for the online's without the avatar and using display name's? If the member does have a display to show. If not it's will show their username.

When I use this code it's show up my user name not my display name.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 01, 2011, 05:38:23 PM
Yes please  ;D :D ;D

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 '20px'// 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 false// Show hidden count
$show_users true// Show users count

$show_guests_users false// Show Guests and Users combined (SUM of the two)
$fake_online 17//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>'
;

if (
$context['user']['is_guest'])
{
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>';

if (
$context['user']['is_guest'])
{

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>';
}
?>

Blue,

Can you do a code for the online's without the avatar and using display name's? If the member does have a display to show. If not it's will show their username.

When I use this code it's show up my user name not my display name.

Do you want me to modify the MODE 1 to show dusplay name instead of username? :)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 01, 2011, 05:43:37 PM
Thnx Blue that is what i like  ;D
But i would onely show guest and no members.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 01, 2011, 05:59:11 PM
Did not understand you. Can you explain better?
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 01, 2011, 06:03:31 PM
Did not understand you. Can you explain better?
Okay Bleu i see this.
But i want onely see gasten online,
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 01, 2011, 08:28:46 PM
Like 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 '20px'// 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 false// Show hidden count
$show_users true// Show users count

$show_guests_users false// Show Guests and Users combined (SUM of the two)
$fake_online 17//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 />';

if (
$context['user']['is_guest'])
{

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

if (
$context['user']['is_guest'])
{

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>';
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 02, 2011, 05:12:36 AM
No not yet Blue.
See my attachment please.
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 02, 2011, 10:35:47 PM
Blue,

Can you do a code for the online's without the avatar and using display name's? If the member does have a display to show. If not it's will show their username.

When I use this code it's show up my user name not my display name.

Do you want me to modify the MODE 1 to show dusplay name instead of username? :)

Yes, Please if you can. If the member's don't have a display name it's will show their username's. Can you do one without any photo's in the code?
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 02, 2011, 10:45:43 PM
Here I was trying to say.  I mean if the person only using their display using if they don't it can have the username.  I was searching for a code like the screen shoot I took. And I would like to have it like that. But no avater to show at all.

(http://i15.photobucket.com/albums/a363/HorseLover84/66666.png)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 03, 2011, 04:08:08 PM
Ok, I'm gonna do it  :D
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 03, 2011, 04:22:53 PM
Thank you Blue! :)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 05, 2011, 11:51:05 AM
No not yet Blue.

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

/* SETUP HERE */
$mode '1'; // 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

$scrollheight '100px';
$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 false// 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)


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

if (
$context['user']['is_logged'])
{

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'] . '" 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') {
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'] . '" 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="'$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'];

} 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 style="overflow: auto; height: ' $scrollheight ';">';

$context += getUsersOnlineTodayStats();

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

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

if ($show_hidden_today)
echo sp_embed_image('dot'), ' '$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>';

} else {

$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']);
}
}
?>

Here I was trying to say.  I mean if the person only using their display using if they don't it can have the username.  I was searching for a code like the screen shoot I took. And I would like to have it like that. But no avater to show at all.

Here it is Shadow Queen:
Code: [Select]
<?php
/*
Block: Who's Online with Avatar
Author: Blue @ Simple Portal.net
Version: 1.2gold
*/

/* SETUP HERE */
$mode '1'; // 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

$scrollheight '100px';
$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 false// 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)


$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.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['member_name'],
  'realname' => $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>',   
  'profile_real' => '<a style="color: ' $row_members['online_color'] . ';" title="' $row_members['group_name'] . '" href="' $scripturl '?action=profile;u=' $row_members['id_member'] . '">' $row_members['real_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 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 ($member['username'] == $member['realname']){
echo '&nbsp;&nbsp;' sp_embed_image('user') . '&nbsp;' $member['profile'] . '<br />';
} else {
echo '&nbsp;&nbsp;' sp_embed_image('user') . '&nbsp;' $member['profile_real'] . '<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'] . '" 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="'$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'];

} 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 style="overflow: auto; height: ' $scrollheight ';">';

$context += getUsersOnlineTodayStats();

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

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

if ($show_hidden_today)
echo sp_embed_image('dot'), ' '$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>';

} else {

$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']);
}
}
?>
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 05, 2011, 03:09:52 PM
I wondering if I can change this

Code: [Select]
$show_spiders = false; // Show spiders count
to

Code: [Select]
$show_spiders = true; // Show spiders count
Can I do that?
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 05, 2011, 03:24:44 PM
Yes you can. It there for that reason :)
Title: Re: [Block] Advanced Who's Online
Post by: Shadow Queen on September 05, 2011, 03:26:30 PM
Thank you!

Yes, Because I would like to know how many spiders is on the forum. :)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 09, 2011, 03:02:43 PM
No not yet Blue.
See my attachment please.

Blue I just want the guests do not see members only guests
I mean just the guest count.

Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 09, 2011, 04:36:53 PM
I know, i know. The last code I've submited does exactly that, doesnt it?
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 09, 2011, 04:37:59 PM
I know, i know. The last code I've submited does exactly that, doesnt it?
No sorry man not here.
Solved blue thnx man.
 ;D ;D ;D
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 09, 2011, 05:59:59 PM
All of my group names contain html like the following:

Code: [Select]
<b><font color="#FFFFFF">Administrator</font></b>
This means that when i select any option with this block that isn't option 2 it completely messes the online list up, just look at the image below.

Appreciate any help on this :)

EDIT: Also names display without capitals and in smallfont, is there a way to make the name appear EXACTLY like it should? :P
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on September 09, 2011, 06:12:30 PM
Blue can you make gasten
like gasten en leden online ?

Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 09, 2011, 10:21:07 PM
All of my group names contain html like the following:

Code: [Select]
<b><font color="#FFFFFF">Administrator</font></b>
This means that when i select any option with this block that isn't option 2 it completely messes the online list up, just look at the image below.

Appreciate any help on this :)

EDIT: Also names display without capitals and in smallfont, is there a way to make the name appear EXACTLY like it should? :P

Those HTML tags are decrapted. You should use

Code: [Select]
<span style="color: #FFFFFF; font-weight: bold;">
Try if it works ;)

Names display exactly as it is in the database. So, it displays exactly like it should. In my test forum it displays the right way :-X
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 10, 2011, 03:10:45 AM
I still have the same issue with span.
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 10, 2011, 10:15:31 AM
sorry for my interference, due to i am quite new,
which file should i modify in order to fix this?
or should i download a mod for that?

i am in RC2.3 and SP 2.3.2


thanks
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 10, 2011, 11:26:12 AM
I still have the same issue with span.

Let me see what I can do ;)

sorry for my interference, due to i am quite new,
which file should i modify in order to fix this?
or should i download a mod for that?

i am in RC2.3 and SP 2.3.2


thanks

You have to insert the code in a php block in the Blocks Interface of SimplePortal.
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 10, 2011, 11:40:27 AM
Quote from: Blue link=topic=9269.msg50329#msg50329



 in a php block in the Blocks Interface of SimplePortal.
[/quote


which is???  :ill: :ill:
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 10, 2011, 02:13:40 PM
Quote from: Blue link=topic=9269.msg50329#msg50329



 in a php block in the Blocks Interface of SimplePortal.
[/quote


which is???  :ill: :ill:

If you have SMF 2x then you will have a block type called "Custom php" if you have 1x i don't think you have it? I may be wrong.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 10, 2011, 03:31:14 PM
This block only works on SMF 2.0 :whistle:

You should upgrade ;)
Title: Re: [Block] Advanced Who's Online
Post by: ccbtimewiz on September 11, 2011, 01:25:10 AM
SMF 1.1 version:

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

/* SETUP HERE */
$mode '1'; // 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

$scrollheight '100px';
$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 false// 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)


$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 $db_prefix$scripturl$sourcedir$modSettings$txt$settings$context;


$members_result db_query("
SELECT l.ID_MEMBER, m.memberName, m.showOnline, m.avatar, g.onlineColor, g.ID_GROUP, g.groupName
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'"
__FILE____LINE__);

$members = array();
while ($row_members 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['memberName'],
  'profile' => '<a style="color: ' $row_members['online_color'] . ';" title="' $row_members['groupName'] . '" href="' $scripturl '?action=profile;u=' $row_members['ID_MEMBER'] . '">' $row_members['memberName'] . '</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 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'] . '" 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')
{
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'] . '" 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>';
}
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'];

}
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 style="overflow: auto; height: ' $scrollheight ';">';

$context += getUsersOnlineTodayStats();

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

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

if ($show_hidden_today)
echo sp_embed_image('dot'), ' '$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>';

} else {

$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']);
}
}
?>

Title: Re: [Block] Advanced Who's Online
Post by: ccbtimewiz on September 11, 2011, 01:32:50 AM
^ You may want to update the text strings in that SMF 1.1 port, I completely forgot.
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 11, 2011, 05:32:13 AM
Quote from: Blue link=topic=9269.msg50329#msg50329



 in a php block in the Blocks Interface of SimplePortal.
[/quote


which is???  :ill: :ill:

If you have SMF 2x then you will have a block type called "Custom php" if you have 1x i don't think you have it? I may be wrong.



i have SMF 2.0 RC3,
eventhough there is no file like custom.php....
did i miss something?
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 11, 2011, 07:01:56 PM
Is there a way to display the facebook like mod version like;

Avatar
Name

That would look pretty cool too :)
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 13, 2011, 06:08:51 AM
can please somebody tell me the php file?
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 13, 2011, 06:09:51 AM
can please somebody tell me the php file?

It's not a file it's a block type. You go to;

Admin > Simpleportal > Blocks > Add Block > Block type: Custom PHP
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 13, 2011, 10:32:10 AM
okkkkkkkk i am stupid......  :angel: :angel: :angel:
i did not read it when blue, mention it!


sorry abt that....
Title: Re: [Block] Advanced Who's Online
Post by: visualuser on September 13, 2011, 10:37:06 AM
let me ask something,

is it possible to work "who is online" block,
as it the default one plus avatars?

Like mine which i have these three parts?


the second square is users that are online right now,
the third square is users that online today....
Title: Re: [Block] Advanced Who's Online
Post by: Zirc on September 13, 2011, 05:27:04 PM
can please somebody tell me the php file?

This code goes into a custom php block for Simpleportal.. there is no php file to edit.  Go to Admin -> Simpleportal -> Add Block -> Custom PHP.  Paste this code into the space provided and set all the options like you would for doing any other type of block.
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 15, 2011, 06:27:53 AM
Still waiting on the fix for my forum blue :)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 15, 2011, 05:58:02 PM
It's not a fix, its a feature ;)

Tomorrow I have an exam so I need to study. In the weekend I'll do it.
Title: Re: [Block] Advanced Who's Online
Post by: Nick on September 16, 2011, 05:28:56 AM
Okay thanks :)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on September 23, 2011, 08:15:29 PM
let me ask something,

is it possible to work "who is online" block,
as it the default one plus avatars?

Like mine which i have these three parts?


the second square is users that are online right now,
the third square is users that online today....

Yes, it is. Version 1.4 will have that option ;)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on October 08, 2011, 03:21:40 PM
Is it possible to make onely that block refesch ???
Title: Re: [Block] Advanced Who's Online
Post by: Nick on October 20, 2011, 07:09:44 AM
Any updates on this Blue? it's been over a month :)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on October 20, 2011, 09:05:16 AM
I find myself caught up in a lot of university work lately and the time that I've left I'm using to test Simple Portal Beta and run my website so sorry for not being able to update the block yet. :dead:

I will try to do it this week ;)
Title: Re: [Block] Advanced Who's Online
Post by: pixeleyes on November 17, 2011, 11:41:26 AM
Nice block indeed.

How it could be possible that hidden members avatar

don't show in block?
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on November 27, 2011, 08:54:17 AM
Any update Blue ?
For SP 2.3.4
$fake_online = 1; //Increase Guest number by multiplying for the value of fake_online
Doesn`t work anymore.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on November 27, 2011, 12:10:45 PM
This week I'll update all my mods :)
Title: Re: [Block] Advanced Who's Online
Post by: Blue on November 30, 2011, 05:09:11 PM
Any update Blue ?
For SP 2.3.4
$fake_online = 1; //Increase Guest number by multiplying for the value of fake_online
Doesn`t work anymore.

What mode are you using? fake_online works fine in my test forum.
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on November 30, 2011, 05:19:20 PM
Any update Blue ?
For SP 2.3.4
$fake_online = 1; //Increase Guest number by multiplying for the value of fake_online
Doesn`t work anymore.

What mode are you using? fake_online works fine in my test forum.
Sorry Blue it works still fine.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on November 30, 2011, 05:29:56 PM
Ok eheh :)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on November 30, 2011, 05:31:00 PM
Ok eheh :)
Don`t shoot me please  >:-D
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on December 02, 2011, 04:51:21 AM
Is it possible to make a scrolbar?
Because it stretches out now.
And maybe can it made with a autorefresh just for that block ?
Title: Re: [Block] Advanced Who's Online
Post by: Nick on December 04, 2011, 07:55:43 PM
I have been waiting for my feature for almost 3 months now Blue :)

It's not urgent of course but they fix would be great please :D
Title: Re: [Block] Advanced Who's Online
Post by: Blue on December 05, 2011, 05:36:50 AM
And you will have soon enough  :-[ :D
Title: Re: [Block] Advanced Who's Online
Post by: Lucien on December 09, 2011, 09:51:29 AM
It's a great block!
But when people use different usernames on my forum, the original username is shown. Even to guests..
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on December 13, 2011, 03:01:12 PM
Is it possible to make a scrolbar?
Because it stretches out now.
And maybe can it made with a autorefresh just for that block ?

Any news Blue ?
Title: Re: [Block] Advanced Who's Online
Post by: Blue on December 14, 2011, 09:18:41 AM
Yes, it is possible to make a scrollbar and it will be done in the next version that I'm slowly working on and finishing it.

Autorefresh could be achieved by javascript. I'm no pro in that language but I'll see what I can do.
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on December 14, 2011, 09:20:31 AM
Yes, it is possible to make a scrollbar and it will be done in the next version that I'm slowly working on and finishing it.

Autorefresh could be achieved by javascript. I'm no pro in that language but I'll see what I can do.
Thnx Blue  ;)
Title: Re: [Block] Advanced Who's Online
Post by: Nick on December 15, 2011, 10:12:31 AM
All of my group names contain html like the following:

Code: [Select]
<b><font color="#FFFFFF">Administrator</font></b>
This means that when i select any option with this block that isn't option 2 it completely messes the online list up, just look at the image below.

Appreciate any help on this :)

Title: Re: [Block] Advanced Who's Online
Post by: wiecher on December 29, 2011, 03:53:17 PM
 ;D  :D :D
Title: Re: [Block] Advanced Who's Online
Post by: Blue on December 30, 2011, 12:21:44 AM
I did not forget guys :P My free time is limited nowadays :( don't need to bump the topic :P
Title: Re: [Block] Advanced Who's Online
Post by: Blue on January 03, 2012, 02:58:38 PM
Version 1.4 released :D

+ Added mode 6 (who's online plus online today)
+ Added Scrollbar in mode 1
+ Added Username bellow avatar in mode 2

It's not urgent of course but they fix would be great please :D

Nick, <font> in deprecated. Try with <span style="color: #ffffff;"> and see if it works ;)
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on January 03, 2012, 04:34:21 PM
Thanx Blue and a happy newyear  ;D
Title: Re: [Block] Advanced Who's Online
Post by: wiecher on January 03, 2012, 06:19:16 PM
Is  it possible to make it auto refresh  ;D
Title: Re: [Block] Advanced Who's Online
Post by: BaghdadGhost on January 03, 2012, 11:45:45 PM
thank you so much
Title: Re: [Block] Advanced Who's Online
Post by: tomeh on January 09, 2012, 11:55:13 AM
Well if it was such a thing in the options of the SP for the other
Title: Re: [Block] Advanced Who's Online
Post by: Blue on January 09, 2012, 12:11:25 PM
Although its not included in the SP Package you can use a php block and add the code :)
Title: Re: [Block] Advanced Who's Online
Post by: simply sibyl on February 12, 2012, 06:16:39 PM
I love this.. super job.   Is it possible (using mode 3) to make it so it displays the members display name instead of the username?
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on February 14, 2012, 02:39:33 PM
Is  it possible to make it auto refresh
Title: Re: [Block] Advanced Who's Online
Post by: Jam0r on March 01, 2012, 07:13:56 AM
I may have found a bug slightly.

I have some custom fields which are displayed when viewing a threads posts under the Icons section.

With the Advanced Whos Online activated they disappear from view completely, only reappearing when the block is deactivated?
Title: Re: [Block] Advanced Who's Online
Post by: wille on April 02, 2012, 05:40:21 PM
Nice mod! I wonder if there's a block for showing user activity like in ?action=who view...
Title: Re: [Block] Advanced Who's Online
Post by: ccbtimewiz on April 03, 2012, 05:11:18 PM
Code: [Select]
loadMemberData($row_members['id_member']);
      loadMemberContext($row_members['id_member']);

This is extremely slow if you're going to call both these functions per member. Try loading an array before-hand of IDs and then call those functions (as they accept arrays).

Just a tip to make it a bit faster.
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on April 05, 2012, 05:22:06 PM
Only modes 1-3 work... mode 6 is half broke... modes 4 and 5 show nothing?  Am I supposed to install something else to work with those modes?

Thanks!
Title: Re: [Block] Advanced Who's Online
Post by: andy on April 06, 2012, 02:32:19 AM
Who is online mod from the SMF site might help.
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried 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).

Title: Re: [Block] Advanced Who's Online
Post by: andy 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.
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on April 07, 2012, 10:25:32 AM
That worked like a charm!  Thanks!
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried 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.

Title: Re: [Block] Advanced Who's Online
Post by: Ozzy Mozzy 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?
Title: Re: [Block] Advanced Who's Online
Post by: Ozzy Mozzy 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...
Title: Re: [Block] Advanced Who's Online
Post by: FireDitto 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?
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on July 18, 2012, 02:19:30 PM
Is it possible to ad a sound when someone go online ?
Title: Re: [Block] Advanced Who's Online
Post by: wazza on July 20, 2012, 11:39:55 PM
Works great thank you  :thumbsup:
Title: Re: [Block] Advanced Who's Online
Post by: exit 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...
Title: Re: [Block] Advanced Who's Online
Post by: weerforum 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
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on November 06, 2012, 03:44:06 PM
Any help please  ;)
Title: Re: [Block] Advanced Who's Online
Post by: Blue 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 ;)
Title: Re: [Block] Advanced Who's Online
Post by: ProtoGT on November 12, 2012, 04:07:12 AM
Is there a way to make it so we can select certain groups we want displayed?
Title: Re: [Block] Advanced Who's Online
Post by: weerforum 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
Title: Re: [Block] Advanced Who's Online
Post by: Blue 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:
Title: Re: [Block] Advanced Who's Online
Post by: ProtoGT 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?
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on November 21, 2012, 09:26:34 AM
How to hide as admin ?
Title: Re: [Block] Advanced Who's Online
Post by: Blue 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 :)
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on January 02, 2013, 03:43:49 PM
This block ROCKS... however... it's just been reported by an upset user that folks who are marked HIDDEN are still showing in the block... they show up under "HIDDEN" as a number... but they also show up in the list of users below (with avatar).

Is there a way we can eliminate the HIDDEN users from showing up below?

Sort of defeats the whole "hidden" idea...

:)

Thanks!

Title: Re: [Block] Advanced Who's Online
Post by: andy on January 03, 2013, 02:53:16 PM
Yes, that makes me laugh though ... our 'secretive' members show up in the block... but hidden in forum stats.
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on January 03, 2013, 04:35:09 PM
Yes, that makes me laugh though ... our 'secretive' members show up in the block... but hidden in forum stats.

Normally I'd ignore or make fun of the user complaining... one of them is a lady though... who's had a history of someone stalking her.  She's VERY VERY careful to leave as small of a digital footprint as possible.  It's hard to fault her at being upset.

Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on January 13, 2013, 11:08:53 AM
Anyone?  I had to disable this block because of the continued complaints by more than one of my members...

Title: Re: [Block] Advanced Who's Online
Post by: phantomm on January 13, 2013, 11:32:46 AM
so you want to remove hidden users counter in block?
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on January 13, 2013, 08:06:13 PM
so you want to remove hidden users counter in block?

No... I don't want hidden users to appear in the list below (as they currently do).  If they are "hidden"... they shouldn't be listed.

:)

Title: Re: [Block] Advanced Who's Online
Post by: Blue on January 13, 2013, 09:50:29 PM
I'll hid the hidden users for you then :)
Title: Re: [Block] Advanced Who's Online
Post by: FrizzleFried on January 14, 2013, 01:59:19 AM
I'll hid the hidden users for you then :)

Most excellent... thank you sir!
Title: Re: [Block] Advanced Who's Online
Post by: steiger on January 17, 2013, 06:09:03 AM
Hi Blue,

just found your block and immediately implemented it in my new website.
But I found that some text is hardcoded in the PHP code. Like 'Users active in past minutes:' in mode 3.
My website is currently dual-language so I need to translate these items.

What do you think is the best way to fix this and put them into some language file?
I know how to do it but you should tell us where to put the strings.

Thanks for your work
Title: Re: [Block] Advanced Who's Online
Post by: Blue on February 02, 2013, 10:53:07 AM
Hello,

Well, you should add the string in the general file of your language and call $txt :)
Title: Re: [Block] Advanced Who's Online
Post by: steiger on February 02, 2013, 11:25:31 AM
That's the way I've done it.

But then it will not be "installed" with this mod.
Everyone need to do this again.
Title: Re: [Block] Advanced Who's Online
Post by: Blue on February 02, 2013, 02:14:36 PM
Yes, it's true. In order for it to work I would need to make an hack and make it install as a modification.
Title: Re: [Block] Advanced Who's Online
Post by: dhayzon on February 18, 2013, 07:47:40 PM
awesome, very nice simple portal

(http://i.imgur.com/QPNp7ZP.png)
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on March 10, 2013, 06:37:10 PM
Is it possible to hide admin en administrators ?
And the users online total ?
Guest online and Members online see mi attachment.
Title: Re: [Block] Advanced Who's Online
Post by: weerforum on March 25, 2013, 05:36:37 PM
Can you make it so that the members who log in at the top of the list come to be?
Title: Re: [Block] Advanced Who's Online
Post by: joeseppy on August 20, 2013, 05:22:27 PM
Hi guys, i really want to use this to get avatars on my who's online, but im not sure how to do it.

been using SMF nearly a year now and only yesterday realised what i can do with simple portal. It's great!

So can you tell me, where do i put the code at the start of this thread for the advanced block to get the advanced who's online? Is it in the theme files somewhere?

cheers and many thanks
Title: Re: [Block] Advanced Who's Online
Post by: [SiNaN] on August 21, 2013, 06:51:57 AM
Welcome to SimplePortal! :)

You can use the block codes provided by creating a Custom PHP block from Admin > SimplePortal > Blocks > Add Block. Check out the Blocks section of our documentation for details:

http://simpleportal.net/index.php?action=docs
Title: Re: [Block] Advanced Who's Online
Post by: joeseppy on August 26, 2013, 05:37:28 PM
Welcome to SimplePortal! :)

You can use the block codes provided by creating a Custom PHP block from Admin > SimplePortal > Blocks > Add Block. Check out the Blocks section of our documentation for details:

http://simpleportal.net/index.php?action=docs

thanks for your help, this did the trick mate.

Can I ask, is there any way to make the usernames have a small bit of space between them?

You can see them at the top of this page on the who's online list ;
http://www.dropkickrugby.com/forum

It's not a deal-breaker or anything( hey, it's free! :D) but it would be nice if they weren't stuck together like that.

Any thoughts?
Title: Re: [Block] Advanced Who's Online
Post by: [SiNaN] on August 27, 2013, 04:10:35 AM
I haven't tried it but probably this change will work:

Code: (Find) [Select]
echo '<div style="float: left;">';
Code: (Replace) [Select]
echo '<div style="float: left; padding-right: 0.5em;">';
Title: Re: [Block] Advanced Who's Online
Post by: joeseppy on September 15, 2013, 02:30:44 PM
thank you for this, worked a charm mate :D
Title: Re: [Block] Advanced Who's Online
Post by: gravityarc on December 09, 2013, 11:52:06 AM
Hey all.  I have a strange problem.  I can create the Custom PHP block and Preview it just fine, but when I click on "Add Block" I get the following error:
Code: [Select]
Database error in block code. Please check the code.
Any thoughts?

SMF v 2.0.6
SP 2.3.5
Title: Re: [Block] Advanced Who's Online
Post by: [SiNaN] on December 11, 2013, 08:57:23 AM
SimplePortal tries to validate the code you try to use for Custom PHP block, to make sure that admins don't accidentally break their forums. However, it may give some false positives in rare cases. If you're sure that your code doesn't contain any errors, then go to Admin > SimplePortal > Configuration > General Settings and check the Disable PHP Validation option. You should be able to add PHP blocks and pages without such an error then.
Title: Re: [Block] Advanced Who's Online
Post by: gravityarc on December 19, 2013, 11:39:05 PM
That solved it!  Thanks!
Title: Re: [Block] Advanced Who's Online
Post by: exit on February 06, 2014, 05:29:53 PM
Anyone to help?

How to limit the number of users?

Something like:

Quote
Users active in past minutes:
User1, User2, User3 and 102 others...
Title: thanks
Post by: fapencio on April 18, 2014, 09:44:44 PM
thanks for this mod, is awesome, works in smf 2.0.7!!!   ;D
Title: Re: [Block] Advanced Who's Online
Post by: SimianSteam on June 23, 2014, 11:38:32 AM
Is there any way to put a number next to "Users Online" as well as the list?
Title: Re: [Block] Advanced Who's Online
Post by: Talliostro on September 10, 2014, 07:22:38 AM
good'ol Thread Necromancy, but got a bit of a problem.

When I use this code in a block, my footer with the copyrights and RSS feed gets missing in the portal and forum. If I deactivate the block, the footer returns where it belongs and is everywhere visible. Everything else in SP is working like a charm, so it has to be this block that is causing problems.

SP 2.3.5
SMF 2.0.8

Anyone else encountered this problem?

[EDIT] Nevermind, works now without Problems
Title: Re: [Block] Advanced Who's Online
Post by: stanyy on December 17, 2014, 04:50:13 PM
None of the modes are showing avatars for 'Users online today'?
SimplePortal 2.3.8 © 2008-2024, SimplePortal