collapse

* Simple Portal Archived Forum

This is an Archive Forum.

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

Visit our thread at Simple Machines Forum for current support.

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

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 217
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

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

* Recent Posts

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


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


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


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


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

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

Author Topic: Who's Online Block  (Read 9727 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Who's Online Block
« on: July 18, 2010, 03:51:52 PM »
How do i change the "Who's online" block from the layout it currently has to the default forum layout where the names are side by side and go across width ways.

Like this;


Offline rad1701

  • Semi Newbie
  • *
  • Posts: 15
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Who's Online Block
« Reply #1 on: July 24, 2010, 10:40:27 PM »
I would also like something like this a lot too.  I want to put my Who's Online block on top of my forum in the Center Block.  So, I want the "Who's Online" list to run horizontally so it won't take up so much space.

- Thanks

P.S.  Love Simple Portal!

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #2 on: July 28, 2010, 08:55:17 AM »
Thanks for your support Rad :)

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #3 on: July 28, 2010, 09:17:20 AM »
look on Sources/Portalblocks.php   the function   function sp_whosOnline

below this:

$stats = ssi_whosOnline('array');

   echo '

you will see its only a html list, so, changing the html will get your block horizontally. it may be even done with pure css  by creating a new class with:  display: inline;


this is an example:


.myclass li
{
display: inline;
list-style-type: none;
padding-right: 20px;
}

and change in PortalBlocks.php  within function sp_whosOnline :

<ul class="sp_list">

to

<ul class="myclass">



Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #4 on: July 29, 2010, 07:16:43 PM »
So that would create the exact same styled who's online list as the forums default?

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #5 on: July 29, 2010, 08:56:01 PM »
not entirely the same as the forums default, but will give you a horizontal look, the same as SP block but horizontal

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #6 on: July 30, 2010, 06:46:37 AM »
Thanks i will take a look :).

EDIT: I added and it's still not want i want really. I would prefer the default forum look.
« Last Edit: July 30, 2010, 09:26:20 AM by Nick »

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #7 on: July 30, 2010, 10:09:12 AM »
ok, on a php block copy an paste this:

Code: (php) [Select]
global $context, $txt, $settings;

// "Users online" - in order of activity.
echo '


<span class="ie6_header floatleft">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
', $txt['online_users'], '
</span>
</h4>

<p class="inline stats">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
</p>
<p class="inline smalltext">';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<br />[' . implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']';
}

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

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #8 on: July 30, 2010, 01:35:46 PM »


Thats how it goes, doesn't work at all :(

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #9 on: July 30, 2010, 03:34:11 PM »
I forgot to globalize $modSettings

use this one

Code: [Select]
global $context, $txt, $settings, $modSettings;

// "Users online" - in order of activity.
echo '


', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
', $txt['online_users'], '



<p class="inline stats">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
</p>
<p class="inline smalltext">';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<br />[' . implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']';
}

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

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #10 on: July 30, 2010, 04:49:56 PM »
Doesn't display me as online or show my name  :dead:

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #11 on: July 30, 2010, 05:01:43 PM »
can I have a link to your forum please?

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #12 on: July 30, 2010, 05:11:29 PM »

Offline rad1701

  • Semi Newbie
  • *
  • Posts: 15
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Who's Online Block
« Reply #13 on: July 30, 2010, 07:54:20 PM »
Ok, that last code is pretty much working for me.  A question though.  Is there a way to not have it show that little people icon link?  Takes up a bit of space and not really needed for me.  Also, why is there a little colon above the names?  Can that be removed?  Here's how it's looking on the top of my forum over at:  http://www.treksinscifi.com/forum/index.php



P.S.  Oh, I just noticed one more thing.  This shows up fine when on the main forum/index.php page.  But when I look at a forum post, the display shows 0, 0 (meaning no one online).  I have the block set to show everywhere too.

- thanks
« Last Edit: July 30, 2010, 07:58:08 PM by rad1701 »

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #14 on: July 30, 2010, 09:27:40 PM »
ok, let me check as the code above its just a copy/paste from BoardIndex.template.

to remove the little people just remove this:

Code: [Select]
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '

Offline rad1701

  • Semi Newbie
  • *
  • Posts: 15
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Who's Online Block
« Reply #15 on: July 30, 2010, 10:57:53 PM »
Ok, that's a help.  Any idea why the number of users and guests goes to zero when inside the forum?  Also, still would like to have the colon gone.

Offline Nick

  • Jr. Member
  • **
  • Posts: 97
  • Gender: Male
    • GearedGamers
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #16 on: July 31, 2010, 07:58:53 AM »
Mines going to be just set to the portal page but as you can see i'm signed in but it doesn't display Users :1 and my name :S ?

Offline dsantana

  • Semi Newbie
  • *
  • Posts: 37
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #17 on: August 12, 2010, 10:44:30 AM »
ok, let me check as the code above its just a copy/paste from BoardIndex.template.

to remove the little people just remove this:

Code: [Select]
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '

Can I also change that code to show my own image?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Who's Online Block
« Reply #18 on: August 20, 2010, 11:42:20 AM »
http://w3schools.com/php/default.asp will help you get started -- reading and understanding the code will be easier.
http://w3schools.com/html/default.asp if you want an HTML refresher.
 
Most of the time, the variable names and array indices make some kind of sense, so you can often figure out "where's that image I want to replace".
Also, you can spot the HTML "<img" tag, for example.
 
On a PC, the command line find command helps you search a whole directory full of php files at once for something you are looking for.
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline TattooMasters

  • Semi Newbie
  • *
  • Posts: 16
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Who's Online Block
« Reply #19 on: June 15, 2011, 02:41:43 PM »
Mines going to be just set to the portal page but as you can see i'm signed in but it doesn't display Users :1 and my name :S ?

I have that problem too. What do I have to do to make it count the guests and members online including showing the names?