solved Who Is Online

derrickhand300
@derrickhand300
10 years ago
1,353 posts
How are you guys getting this who is online module at the bottom of the jamroom forum?
Capture.JPG.jpg
Capture.JPG.jpg  •  15KB


updated by @derrickhand300: 02/21/16 06:21:28PM
michael
@michael
10 years ago
7,791 posts
That should be there by default. Its this code if you need to add it to your item_categories.tpl file or wherever:

    <div class="item">
        {jrForum_active_users profile_id=$_profile_id}
        <div style="clear:both"></div>
    </div>
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks Michael
adding this to the template section of a widget should display the members online? if so its not working that way for me
douglas
@douglas
10 years ago
2,802 posts
The jrForum_active_users funtion is for the Forum only and will not work anywhere else.

However you can use the jrUser_whos_online function to add a "who is online" section to a widget.

Add something like this to a "Template Code" widget
{jrUser_whos_online template="whos_online.tpl" assign="WHOS_ONLINE"}
{if isset($WHOS_ONLINE) && strlen($WHOS_ONLINE) > 0}
    {$WHOS_ONLINE}
{else}
    <br><br><br><br>
    <div style="text-align:center;">
        <input type="button" class="form_button" value="Login" onclick="jrCore_window_location('{$jamroom_url}/{jrCore_module_url module="jrUser"}/login');"><br>
        <br>
    {if $_conf.jrCore_maintenance_mode != 'on' && $_conf.jrUser_signup_on == 'on'}
        <input type="button" class="form_button" onclick="jrCore_window_location('{$jamroom_url}/{jrCore_module_url module="jrUser"}/signup');" value="Create Account"><br>
        <br>
    {/if}
    </div>
{/if}

Then create a whos_online.tpl file with this code in it and upload it to your skins/YOURSKIN directory:

<div class="container">{if isset($master)}
    <div class="row">
        <div class="col12 last">
            <span>{jrCore_lang  skin=$_conf.jrCore_active_skin id="56" default="Master"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="57" default="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">
                    <a href="{$jamroom_url}/{$m_admin.profile_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>
                </div>
            </div>
        {/foreach}
    </div>
{/if}
{if isset($admin)}
    <div class="row">
        <div class="col12 last">
            <hr>
            <span>{jrCore_lang  skin=$_conf.jrCore_active_skin id="8" default="Site"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="57" default="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">
                    <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>
                </div>
            </div>
        {/foreach}
    </div>
{/if}
{if isset($user)}
    <div class="row">
        <div class="col12 last">
            <hr>
            <span>{jrCore_lang  skin=$_conf.jrCore_active_skin id="58" default="Members"}</span>
            <hr>
        </div>
    </div>
    <div class="row">
        {foreach from=$user item="member"}
            <div class="col3{if $member@last} last{/if}">
                <div class="center">
                    <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>
                </div>
            </div>
        {/foreach}
    </div>
{/if}
</div>

<hr>

<div class="p5" style="width:90%;display:table;margin:0 auto;">
    <div style="display:table-row;">
        <div style="display:table-cell;">
            {jrCore_lang  skin=$_conf.jrCore_active_skin id="56" default="Master"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="57" default="Admins"}:
        </div>
        <div style="width:5%;display:table-cell;text-align:right;">
            {$master_count}
        </div>
    </div>
    <div style="display:table-row;">
        <div style="display:table-cell;">
            {jrCore_lang  skin=$_conf.jrCore_active_skin id="8" default="Site"} {jrCore_lang  skin=$_conf.jrCore_active_skin id="57" default="Admins"}:
        </div>
        <div style="width:5%;display:table-cell;text-align:right;">
            {$admin_count}
        </div>
    </div>
    <div style="display:table-row;">
        <div style="display:table-cell;">
            {jrCore_lang  skin=$_conf.jrCore_active_skin id="58" default="Members"}:
        </div>
        <div style="width:5%;display:table-cell;text-align:right;">
            {$user_count}
        </div>
    </div>
    <div style="display:table-row;">
        <div style="display:table-cell;">
            {jrCore_lang  skin=$_conf.jrCore_active_skin id="59" default="Visitors"}:
        </div>
        <div style="width:5%;display:table-cell;text-align:right;">
            {$visitor_count}
        </div>
    </div>

</div>

<hr>

<div class="p5" style="width:90%;display:table;margin:0 auto;">

    <div style="display:table-row">

        <div style="display:table-cell;">
        {jrCore_lang  skin=$_conf.jrCore_active_skin id="60" default="Total"}:
        </div>
        <div style="width:5%;display:table-cell;text-align:right;">
        {$all_count}
        </div>

    </div>

</div>



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
paul
@paul
10 years ago
4,335 posts
Try this -
{capture name="online_tpl" assign="online_tpl"}
{literal}
{if isset($master)}
    {foreach from=$master item="member"}
        <a href="{$jamroom_url}/{$member.profile_url}" title="{$member.user_name}" alt="{$member.user_name}">{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><br><br>
    {/foreach}
{/if}
{if isset($admin)}
    {foreach from=$admin item="member"}
        <a href="{$jamroom_url}/{$member.profile_url}" title="{$member.user_name}" alt="{$member.user_name}">{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><br><br>
    {/foreach}
{/if}
{if isset($user)}
    {foreach from=$user item="member"}
        <a href="{$jamroom_url}/{$member.profile_url}" title="{$member.user_name}" alt="{$member.user_name}">{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><br><br>
    {/foreach}
{/if}
{if isset($visitor)}
    {$vcnt = 0}
    {foreach from=$visitor item="member"}
        {$vcnt = $vcnt + 1}
    {/foreach}
{/if}
<br>
Visitors: {$vcnt|default:0}
{/literal}
{/capture}

{jrUser_whos_online template=$online_tpl}

hth


--
Paul Asher - JR Developer and System Import Specialist

updated by @paul: 11/23/15 02:57:54AM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you both!

Tags