How to add the who is online for the entire site?

pch
@pch
8 years ago
328 posts
Hello,

How to add the "Who is online" module for the entire site similar to the one at the bottom of the jamroom forum? How to add it at the bottom of the entire site (or any other place including the home page) and get it shown in both desktop and mobile/tablet?

I have read this post:

https://www.jamroom.net/the-jamroom-network/forum/design-and-skin-customization/35551/who-is-online

but there seems to be two posts (solutions): one from Douglas and the other one from Paul. Which one to follow? i am confused.

Thanks


updated by @pch: 12/13/16 01:30:27AM
paul
@paul
8 years ago
4,326 posts
I'd just use the jrUser_whos_online smarty call as in -

{jrUser_whos_online template="whos_online.tpl"}

but check that the whos_online.tpl is present in your active skin. If it isn't create the code in your template prior to the smarty call -

{capture name="online_tpl" assign="online_tpl"}
{literal}
<div class="container">{if isset($master)}
    <div class="row">
        <div class="col12 last">
            <span class="media_title">Master Admins</span>
            <hr>
        </div>
    </div>
    <div class="row">
        {foreach from=$master item="m_admin"}
            <div class="col3{if $m_admin@last} last{/if}">
                <div class="center capital p5">
                    {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$m_admin.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$m_admin.session_user_name title=$m_admin.session_user_name}
                </div>
            </div>
        {/foreach}
    </div>
{/if}
{if isset($admin)}
    <div class="row">
        <div class="col12 last">
            <hr>
            <span class="media_title">Site Admins</span>
            <hr>
        </div>
    </div>
    <div class="row">
        {foreach from=$admin item="s_admin"}
            <div class="col3{if $s_admin@last} last{/if}">
                <div class="center capital p5">
                    {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$s_admin.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$s_admin.session_user_name title=$s_admin.session_user_name}
                </div>
            </div>
        {/foreach}
    </div>
{/if}
{if isset($user)}
    <div class="row">
        <div class="col12 last">
            <hr>
            <span class="media_title">Members</span>
            <hr>
        </div>
    </div>
    <div class="row">
        {foreach from=$user item="member"}
            <div class="col3{if $member@last} last{/if}">
                <div class="center capital p5">
                    {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$member.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$member.session_user_name title=$member.session_user_name}
                </div>
            </div>
        {/foreach}
    </div>
{/if}
</div>
<hr>
<div class="p3" style="width:90%;display:table;margin:0 auto;">
    <div style="display:table-row">
        <div class="capital bold" style="display:table-cell">
            Master Admins:
        </div>
        <div class="hilite_2" style="width:1%;display:table-cell;;text-align:right;">
            {$master_count}
        </div>
    </div>
    <div style="display:table-row">
        <div class="capital bold" style="display:table-cell;">
            Site Admins:
        </div>
        <div class="hilite_2" style="width:1%;display:table-cell;;text-align:right;">
            {$admin_count}
        </div>
    </div>
    <div style="display:table-row">
        <div class="capital bold" style="display:table-cell;">
            Members:
        </div>
        <div class="hilite_2" style="width:1%;display:table-cell;;text-align:right;">
            {$user_count}
        </div>
    </div>
    <div style="display:table-row">
        <div class="capital bold" style="display:table-cell;">
            Visitors:
        </div>
        <div style="width:1%;display:table-cell;;text-align:right;">
            <span class="hilite_2">{$visitor_count}</span>
        </div>
    </div>
</div>
<hr>
<div class="p3" style="width:90%;display:table;margin:0 auto;">
    <div style="display:table-row">
        <div class="capital bold" style="display:table-cell;">
            Total:
        </div>
        <div class="hilite_2" style="width:1%;display:table-cell;text-align:right;">
            {$all_count}
        </div>
    </div>
</div>
{/literal}
{/capture}

{jrUser_whos_online template=$online_tpl}
hth


--
Paul Asher - JR Developer and System Import Specialist
pch
@pch
8 years ago
328 posts
Hi Paul,

Thanks for your reply.

I have created a whos_online.tpl for my clone skin with the code you posted above.
Then added the {jrUser_whos_online template="whos_online.tpl"} to my footer.tpl and profile_footer.tpl

It works fine. Thanks a lot.

The only problem is it looks very ugly. How to display it in a nice designed box/widget exactly like in the JR forum (horizontally)?

E.g:

10 user(s) currently active on this site:
(profile image) (profile image) (profile image) + (image) 5 Guests

I don't like the way it displayed the stats:

Master Admins: 1
Site Admins: 0
Members: 0
Visitors:

The "Who is online" model from the forum is really awesome.

Note: I am not using site builder and I have cloned my skin from Elastic.

Thanks
douglas
@douglas
8 years ago
2,790 posts
I've not tested this, but you can give it a try, it should be close to the forum who is online:

<div class="container">
    <div class="row">
        <div class="col12 last">

            <div class="item">

                {* MASTER ADMIN *}
                {if isset($master)}
                    {foreach from=$master item="m_admin"}
                        <div style="float:left;display:inline-block;margin-right:10px;">
                            {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$m_admin.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$m_admin.session_user_name title=$m_admin.session_user_name}
                        </div>
                    {/foreach}
                {/if}

                {* SITE ADMIN *}
                {if isset($admin)}
                    {foreach from=$user item="member"}
                        <div style="float:left;display:inline-block;margin-right:10px;">
                            {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$member.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$member.session_user_name title=$member.session_user_name}
                        </div>
                    {/foreach}
                {/if}

                {* MEMBERS *}
                {if isset($user)}
                    {foreach from=$user item="member"}
                        <div style="float:left;display:inline-block;margin-right:10px;">

                            {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$member.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$member.session_user_name title=$member.session_user_name}

                        </div>
                    {/foreach}
                {/if}

                {* VISITORS *}
                {if $visitor_count > 1}
                    {jrCore_module_url module="jrImage" assign="iurl"}
                    {if $visitor_count > 1}
                        {$gs = 'Guests'}
                    {else}
                        {$gs = 'Guest'}
                    {/if}
                    <div style="float:left;display:inline-block;">
                        <big>+</big> <img src="{$jamroom_url}/{$iurl}/img/module/jrImage/default.png" height="40" width="40" class="img_shadow" alt="{$gs|jrCore_entity_string}"> <i><b>{$visitor_count}</b> {$gs}</i>
                    </div>
                {/if}

            </div>

        </div>
    </div>
</div>



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 06/17/16 09:59:32AM
pch
@pch
8 years ago
328 posts
Hello Douglas,

Thanks a lot your reply and the code.

I have tested the code. It is not close to the Forum who is online yet. Few things
still need to be fixed:

1) The profile image is not clickable, it should point to the profile url.

2) Even after logging out I am still shown in the Who is online. Does it take few minutes before the loggout user disappears rom the who is online list?

3) The following text should be added: "xx user(s) currently active on this site" or "There are currently xx user(s) in this site"

4) Guests are not shown in the Who is online.

5) Guest should be shown with the following mention:

E.g:

+ (Guests image here with the question mark) 2 Guests

6) The design is not like in the forum yet. It should be good to display the "Who is online" in box/widget exactly like in the JR forum with nice rounded corner.

Thanks a lot for helping.
updated by @pch: 06/16/16 11:10:29PM
douglas
@douglas
8 years ago
2,790 posts
This should work:

    <div class="container">
        <div class="row">
            <div class="col12 last">

                <div class="block">
                    <div class="title" style="border-radius:4px;">
                        <h2>{$all_count} user(s) currently active on this site:</h2>
                    </div>
                    <div class="block_content">
                        <div class="item" style="border-radius:4px;">


                            {* MASTER ADMIN *}
                            {if isset($master)}
                            {foreach from=$master item="m_admin"}
                            <a href="{$jamroom_url}">{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$m_admin.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$m_admin.session_user_name title=$m_admin.session_user_name}</a>&nbsp;
                            {/foreach}
                            {/if}

                            {* SITE ADMIN *}
                            {if isset($admin)}
                            {foreach from=$admin item="s_admin"}
                            <a href="{$jamroom_url}/{$s_admin.profile_url}">{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$s_admin.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$s_admin.session_user_name title=$s_admin.session_user_name}</a>&nbsp;
                            {/foreach}
                            {/if}

                            {* MEMBERS *}
                            {if isset($user)}
                            {foreach from=$user item="member"}
                            <a href="{$jamroom_url}/{$member.profile_url}">{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$member.session_user_id size="xsmall" crop="auto" class="iloutline" alt=$member.session_user_name title=$member.session_user_name}</a>&nbsp;
                            {/foreach}
                            {/if}

                            {* VISITORS *}
                            {jrCore_module_url module="jrImage" assign="iurl"}
                            {if $visitor_count == 1}
                            {$gs = 'Guest'}
                            {else}
                            {$gs = 'Guests'}
                            {/if}
                            <big>+</big>&nbsp;<img src="{$jamroom_url}/{$iurl}/img/module/jrImage/default.png" height="40" width="40" class="img_shadow" alt="{$gs|jrCore_entity_string}"> <i><b>{$visitor_count}</b> {$gs}</i>

                        </div>

                    </div>
                </div>

            </div>
        </div>
    </div>



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
8 years ago
1,353 posts
Hi Douglas- I am trying your code above...I copied and paste into notepad- any idea what could be causing the special characters?
Capture.JPG.jpg
Capture.JPG.jpg  •  11KB

douglas
@douglas
8 years ago
2,790 posts
Most likely hidden characters when you pasted it into notepad, don't use notepad for code work. Try a different editor, like crimson editor.

http://www.crimsoneditor.com/


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
8 years ago
1,353 posts
Thanks Douglas- for coding I use http://www.pspad.com/en/ I was always under the impression that pasting to notepad removed all MS word characters and formatting so thats always just been a step in my progression ( but does not seem to be working that way anymore) I pasted the code into PSPad and it cleaned a bunch of it up but still lacks 2 characters.. I will try that Crimson editor in a bit
pch
@pch
8 years ago
328 posts
Woww Douglas!!!! You are a genius. Thanks a lot. That's what I have been talking about. :)

Now there are just few issues that need to be fixed:

1) I am still showing online after logging out. Even after refreshing the page from time to time, it takes something like 15 or 20 minutes (i guess so) before JR removes a logged out user from the Who is online. I have noticed the same here in the JR forum. Is it possible to reduce that delay?

2) There seems to be a duplication. I have been shown as myself then as a guest. (Admin profile icon) + 1 Guest. I doubt that it was a really guest. I think that, that guest was still me. I am more than sure that there wasn't anybody else on the site apart from me. I am the only one using it right now because it is under reconstruction. When JR removed me from the Who is online, the guess was gone too. I realized that I was probably that Guest. (I am not quite sure).
I have even noticed it here in the JR forum. There is a moment I was the only one logged in, the Who is online, displays my profile + 1 Guest.

By the way:

- Do Profiles with privacy set to "Shared - Profile Owners and Followers only" show on the Who is online?

- What about if a site has let's say 200 members and 120 of them are online simultaneously, Will all the 120 profiles (profile picture by profile picture) be displayed and an horizontal scrollbar be created in the Who i online? How will JR handle this scenario?

- I created a language string for the phrase: "user(s) currently active on this site" and it displays fine on the site but the language string for "Guest" doesn't display the text, it displays the code because "Guest" is hardcoded:

{if $visitor_count == 1}
{$gs = 'Guest'}
{else}
{$gs = 'Guests'}
{/if}

We probably need two language strings for "Guest": "Guest" in singular (when guest == 1) and "Guests" in plural. How to do that in the code you posted? (I am building a multilingual site)

Thanks


updated by @pch: 06/18/16 02:51:49AM
brian
@brian
8 years ago
10,148 posts
pch:
We probably need two language strings for "Guest": "Guest" in singular (when guest == 1) and "Guests" in plural.
Just to add that you can avoid this by using the tag as a prefix - i.e. use this:
Quote:
guests: 1
instead of:
Quote:
1 guests



--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 06/18/16 07:06:04AM
douglas
@douglas
8 years ago
2,790 posts
pch:
1) I am still showing online after logging out. Even after refreshing the page from time to time, it takes something like 15 or 20 minutes (i guess so) before JR removes a logged out user from the Who is online. I have noticed the same here in the JR forum. Is it possible to reduce that delay?

This is most likely a cache issue, if your testing on your site, turn dev mode on so caching isn't an issue. ACP > Developer > Developer Tools > Global Config > Run In Developer Mode

https://www.jamroom.net/the-jamroom-network/documentation/modules/932/developer-tools

be sure to turn if off when your site is live.

pch:
2) There seems to be a duplication. I have been shown as myself then as a guest. (Admin profile icon) + 1 Guest. I doubt that it was a really guest. I think that, that guest was still me. I am more than sure that there wasn't anybody else on the site apart from me. I am the only one using it right now because it is under reconstruction. When JR removed me from the Who is online, the guess was gone too. I realized that I was probably that Guest. (I am not quite sure).
I have even noticed it here in the JR forum. There is a moment I was the only one logged in, the Who is online, displays my profile + 1 Guest.

This is probably due to caching as well, it saw you as a guest before you logged in, and then as the logged in user, try resetting your cache, ACP > System Tools > Reset Cache, and clear your browser cache as well. lf you turn dev mode on as mentioned above, you shouldn't see this issue at all and you shouldn't have to reset your cache.

pch:
- Do Profiles with privacy set to "Shared - Profile Owners and Followers only" show on the Who is online?

From looking at the code, the who is online function does not take into consideration if the profile is private or not.

pch:
- What about if a site has let's say 200 members and 120 of them are online simultaneously, Will all the 120 profiles (profile picture by profile picture) be displayed and an horizontal scrollbar be created in the Who i online? How will JR handle this scenario?

The code posted will just show a list without scroll bars, if you want scroll bars you would need to modify the code to do so. You could wrap it in a div with the overflow set to auto... ie.

<div style="height:72px;overflow:auto;">
    the rest of the code here...
</div>

pch:
- I created a language string for the phrase: "user(s) currently active on this site" and it displays fine on the site but the language string for "Guest" doesn't display the text, it displays the code because "Guest" is hardcoded:
{if $visitor_count == 1}
{$gs = 'Guest'}
{else}
{$gs = 'Guests'}
{/if}
We probably need two language strings for "Guest": "Guest" in singular (when guest == 1) and "Guests" in plural. How to do that in the code you posted? (I am building a multilingual site)
Thanks

If you have created language strings in your language file for "Guest" and "Guests" then change this:

{if $visitor_count == 1}
{$gs = 'Guest'}
{else}
{$gs = 'Guests'}
{/if}

to this:

{if $visitor_count == 1}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guest"  assign="gs"}
{else}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}
{/if}

be sure to change the # to the correct number for those language strings.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 06/18/16 07:30:48AM
brian
@brian
8 years ago
10,148 posts
The reason it still shows you online is that this function:

jrUser_whos_online()

Gets users that have been active within the last 15 minutes (900) seconds. You can change that by passing in the seconds:

{jrUser_whos_online template=$online_tpl length=600}

This is NOT going to give you an up to the second "whos online" - this is more "users active in last XX seconds".


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
pch
@pch
8 years ago
328 posts
brian:
Just to add that you can avoid this by using the tag as a prefix - i.e. use this:
Quote:
guests: 1
instead of:
Quote:
1 guests

Yes it is a good alternative in such a situation. Thanks Brian.
pch
@pch
8 years ago
328 posts
douglas:
This is probably due to caching as well, it saw you as a guest before you logged in, and then as the logged in user, try resetting your cache, ACP > System Tools > Reset Cache, and clear your browser cache as well. lf you turn dev mode on as mentioned above, you shouldn't see this issue at all and you shouldn't have to reset your cache.

Yes, it is probably because of the cache. Then, users in JR are being shown twice at the same time: as logged users and as guests, because there were guest few minutes or seconds before logging.

Even here in the JR Forum the guests that we are seeing in the Who is online are probably "us" - logged users (There are not really users - I am not quite sure, I am just presuming). That can lead us to conclude that the Who is online is not accurate because of the duplication, right?

Is it possible to make "logged in user" a real "logged in user" and a "guest", a true/real "guest"?

douglas:
{if $visitor_count == 1}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guest"  assign="gs"}
{else}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}
{/if}

It works. Thanks Douglas.

Just another small issue:

If there was more than 1 visitor online, when JR removes them from the Who is Online, it shows:

0 Visitantes

instead of:

0 Visitante

Please notice that visitante (guest) is being display in plural and not in singular. it should have used the correct language string in singular because the number is 0 (zero). The number updates but the language string doesn't. It will keep on showing 0 Guests (guest in plural) for almost forever till another guest will be online. Then it will go back to normal and show: 1 Guest (in singular).

How to fix it?

Thanks
pch
@pch
8 years ago
328 posts
brian:
The reason it still shows you online is that this function:
jrUser_whos_online()
Gets users that have been active within the last 15 minutes (900) seconds. You can change that by passing in the seconds:
{jrUser_whos_online template=$online_tpl length=600}
This is NOT going to give you an up to the second "whos online" - this is more "users active in last XX seconds".

Thanks Brian.

I understand. it makes sense. What is the default setting being used here in the JR site? 900 or 600 seconds?
douglas
@douglas
8 years ago
2,790 posts
pch:
Yes, it is probably because of the cache. Then, users in JR are being shown twice at the same time: as logged users and as guests, because there were guest few minutes or seconds before logging.
Even here in the JR Forum the guests that we are seeing in the Who is online are probably "us" - logged users (There are not really users - I am not quite sure, I am just presuming). That can lead us to conclude that the Who is online is not accurate because of the duplication, right?
Is it possible to make "logged in user" a real "logged in user" and a "guest", a true/real "guest"?

You might try clearing your browser cache. I'm not seeing an issue with it here on our forums.

pch:
It works. Thanks Douglas.
Just another small issue:
If there was more than 1 visitor online, when JR removes them from the Who is Online, it shows:
0 Visitantes
instead of:
0 Visitante
Please notice that visitante (guest) is being display in plural and not in singular. it should have used the correct language string in singular because the number is 0 (zero). The number updates but the language string doesn't. It will keep on showing 0 Guests (guest in plural) for almost forever till another guest will be online. Then it will go back to normal and show: 1 Guest (in singular).
How to fix it?
Thanks

It might be better if you use Brian's suggestion.

Change this:

{if $visitor_count == 1}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guest"  assign="gs"}
{else}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}
{/if}

to this:

{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}

and this:

<i><b>{$visitor_count}</b> {$gs}</i>

to this:

<i>{$gs}: <b>{$visitor_count}</b></i>

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
pch
@pch
8 years ago
328 posts
Hi Douglas,

Thanks. Your way of showing guests was the best one but because of this last issue i will use Brian's solution. Still no way to fix it?

Isn't there really a way to get a language string to work in a gs variable like this:

{if $visitor_count == 1}
{$gs = '...... language string here.....'}
{else}
{$gs = ..... language string here.....'}
{/if}

Thanks
updated by @pch: 06/25/16 12:21:55AM
douglas
@douglas
8 years ago
2,790 posts
If I understand what your wanting, give this a try:

{if $visitor_count > 1}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}
{else}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guest"  assign="gs"}
{/if}

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 06/25/16 08:54:39AM
pch
@pch
8 years ago
328 posts
douglas:
If I understand what your wanting, give this a try:
{if $visitor_count > 1}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guests"  assign="gs"}
{else}
{jrCore_lang skin=$_conf.jrCore_active_skin id="#" default="Guest"  assign="gs"}
{/if}
Hope this helps!

Douglas, you are the best. What a great support. Yes! working smoothly.

Thanks a lot!
douglas
@douglas
8 years ago
2,790 posts
Your welcome! Glad that worked out for you.

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
pch
@pch
8 years ago
328 posts
Hi Douglas,

Can you tell me why is the "Who Is Online" module not showing for the not-logged users? I would like to show it to visitors as well.

Thanks
pch
@pch
8 years ago
328 posts
Any idea on why is the "Who Is Online" block not showing to not-logged users (visitors)? It shows to members only when they are logged-in. I've noticed it with all the blocks I add to the custom skin template. Even my Stats block only displays to logged-in members.

I have searched for the documentation, I didn't find a solution. Is there a special code to use in order to display blocks to visitor?

Thanks
douglas
@douglas
8 years ago
2,790 posts
Which blocks are not showing to visitors?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
pch
@pch
8 years ago
328 posts
Hi Douglas, The "Who is online" and the "Stats" blocks. I have been creating and testing many blocks. I have just noticed that any block that I add to the skin template doesn't show to visitors.

Thanks
douglas
@douglas
8 years ago
2,790 posts
The "Whos Online" doesn't show for me when logged out either, I'll get a ticket open for that.

If your trying to use the Stats block from the skins/jrElastic/profile_sidebar.tpl, it isn't going to work in non profile skin templates. You would need to use the jrCore_stats function instead for non profile templates, ie.:

{capture name="template" assign="stats_tpl"}
{literal}
{foreach $_stats as $title => $_stat}
<span class="normal">&bull;&nbsp;{$title}:&nbsp;{$_stat.count}</span>
{/foreach}
{/literal}
{/capture}
{jrCore_stats template=$stats_tpl}

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
pch
@pch
8 years ago
328 posts
Hi Douglas,

Thanks a lot. I will give it a try and let you know. Also I will be waiting for the fix to the Whos Online issue.

Thanks for the support.
pch
@pch
8 years ago
328 posts
Hi Douglas

It works. The stats block is now showing to visitors. I have used the code taken from ProJam the get thing to display properly.

For those interested, here is the final code:


            <div class="block">
                <div class="title">
                    <h2>{jrCore_lang skin=$_conf.jrCore_active_skin id="67" default="stats"}</h2>
                </div>
                <div class="block_content">
                     <div class="item">   
                          <div style="width:90%;display:table;margin:0 auto;">
                          {capture name="template" assign="stats_tpl"}
                          {literal}
                              {foreach $_stats as $title => $_stat}
                              <div style="display:table-row">
                                  <div class="capital bold" style="display:table-cell">{$title}</div>
                                  <div class="hilite" style="width:5%;display:table-cell;text-align:right;">{$_stat.count}</div>
                              </div>
                              {/foreach}
                          {/literal}
                          {/capture}

                          {jrCore_stats template=$stats_tpl}
                      </div>
                      
                    </div>  
                </div>
            </div>


By the way, have you found the fix for the "Whos Online" that doesn't show for logout users and visitors?

Thanks
douglas
@douglas
8 years ago
2,790 posts
pch:
By the way, have you found the fix for the "Whos Online" that doesn't show for logout users and visitors?
Thanks

The "Who Is Online" function is setup to NOT show to non logged in users. A workaround would be to add an if statement to show the login and signup links to non logged in users, which could inspire them to create an account or at least login to the site.

{if jrUser_is_logged_in()}

Who is online code goes here...

{else}

Signup and Login links go here...

{/if}

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 09/11/16 01:23:34AM
pch
@pch
8 years ago
328 posts
Hi Douglas,

Thanks. So Can you explain how come is the Who is online in this JR website showing to visitor?

Thanks
douglas
@douglas
8 years ago
2,790 posts
pch:
Hi Douglas,
Thanks. So Can you explain how come is the Who is online in this JR website showing to visitor?
Thanks

You can see who is online when logged out here on jamroom.net?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
douglas
@douglas
8 years ago
2,790 posts
I think what your seeing is the forum modules who is active on the forum, I'm not sure that is going to work as a site wide "who is online". The code I've given will only work for logged in users.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
pch
@pch
8 years ago
328 posts
Yep, I was referring to the forum module: 'who is active'.

Tags