Jump to content

"Who's online" discrepancy

Featured Replies

You can alter the template for it, fairly simple.

Go to your ACP->Customizations->Themes, find your them click on the </> icon.

Make sure the templates tab is highlight, and go to core->front->widgets, and open 'whosOnline', and replace the contents with this:

<h3 class='ipsType_reset ipsWidget_title'>
	{lang="block_whosOnline"}
		&nbsp;&nbsp;<span class='ipsType_light ipsType_unbold ipsType_medium'>{lang="block_whos_online_info_members" pluralize="$memberCount"}, {lang="block_whos_online_info_anonymous" pluralize="$anonymous"}, {lang="block_whos_online_info_guests" pluralize="$guests"}</span>
	<span class='ipsType_medium ipsType_light ipsType_unbold ipsType_blendLinks'><a href='{url="app=core&module=online&controller=online" seoTemplate="online"}'>{lang="see_full_list"}</a></span>
</h3>
<div class='ipsWidget_inner {{if $orientation == 'vertical'}}ipsPad{{endif}}'>
	{{if $memberCount}}
		<ul class='ipsList_inline ipsList_csv ipsList_noSpacing'>
			{{foreach $members as $row}}
				<li>{template="userLinkFromData" group="global" app="core" params="$row['member_id'], $row['member_name'], $row['seo_name'], $row['member_group']"}</li>
			{{endforeach}}
		</ul>
		{{if $orientation == 'vertical' and $memberCount > 60}}
			<p class='ipsType_medium ipsType_reset'>
				<a href='{url="app=core&module=online&controller=online" seoTemplate="online"}'>{lang="and_x_others" pluralize="$memberCount - 60"}</a>
			</p>
		{{endif}}
	{{else}}
		<p class='ipsType_reset ipsType_medium ipsType_light'>{lang="whos_online_users_empty"}</p>
	{{endif}}
</div>

2015-07-15_0236.thumb.png.69088b8b9c6215

it will look something like this, as the styling is bit different on the h3 for the sidebar. This is however not the ideal solution, this should really easy to do with a plugin with a template hook.

@CodingJungle, you need to edit the widget PHP file. It is hardcoded on horizontal view.

@Adriano Faria is it possible that IPS changed the code in the meantime? Because what @CodingJungle provided works for me. I just changed it a little bit because I'm not a friend of the "big widget header". Looks now like this:

online.thumb.png.75a0bd43610b836b6ba9d28

Oh yes, they changed it.

Before:

        if ( $this->orientation === 'horizontal' )
        {
            foreach ( \IPS\Db::i()->select( 'login_type, COUNT(*) AS count', 'core_sessions', array( 'running_time>' . \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ), NULL, NULL, 'login_type' ) as $row )
            {

Now:

		foreach( \IPS\Db::i()->select( 'core_sessions.member_id,core_sessions.member_name,core_sessions.seo_name,core_sessions.member_group,core_sessions.login_type', 'core_sessions', $where, 'core_sessions.running_time DESC', $this->orientation === 'horizontal' ? NULL : 60 )->join( 'core_groups', 'core_sessions.member_group=core_groups.g_id' ) as $row )
		{

It's there since 4.0.9. My post is from march... :)

  • Author

Thank you guys :)

I'd prefer Storyteller's look.

What was your modification if I may?

Sure, this is the changed code:

<h3 class='ipsType_reset ipsWidget_title'>
	{lang="block_whosOnline"}
</h3>
<div class='ipsWidget_inner {{if $orientation == 'vertical'}}ipsPad{{endif}}'>
   <p class='ipsType_reset ipsType_medium ipsType_light'>
    <span class='ipsType_light ipsType_unbold ipsType_medium'>{lang="block_whos_online_info_members" pluralize="$memberCount"}, {lang="block_whos_online_info_anonymous" pluralize="$anonymous"}, {lang="block_whos_online_info_guests" pluralize="$guests"}</span>
	  <span class='ipsType_medium ipsType_light ipsType_unbold ipsType_blendLinks'><a href='{url="app=core&module=online&controller=online" seoTemplate="online"}'>{lang="see_full_list"}</a></span>
   </p>
	{{if $memberCount}}
		<ul class='ipsList_inline ipsList_csv ipsList_noSpacing'>
			{{foreach $members as $row}}
				<li>{template="userLinkFromData" group="global" app="core" params="$row['member_id'], $row['member_name'], $row['seo_name'], $row['member_group']"}</li>
			{{endforeach}}
		</ul>
		{{if $orientation == 'vertical' and $memberCount > 60}}
			<p class='ipsType_medium ipsType_reset'>
				<a href='{url="app=core&module=online&controller=online" seoTemplate="online"}'>{lang="and_x_others" pluralize="$memberCount - 60"}</a>
			</p>
		{{endif}}
	{{else}}
		<p class='ipsType_reset ipsType_medium ipsType_light'>{lang="whos_online_users_empty"}</p>
	{{endif}}
  </div>

 

  • Author

Thank you :)

One little thing. How would I make "See full list" part to display in link kind of font?

Like bold or something...

Simplest way remove:  

ipsType_blendLinks

in this line

<span class='ipsType_medium ipsType_light ipsType_unbold ipsType_blendLinks'><a href='{url="app=core&module=online&controller=online" seoTemplate="online"}'>{lang="see_full_list"}</a></span>

 

  • Author

Thank you :)

@CodingJungle, you need to edit the widget PHP file. It is hardcoded on horizontal view.

Oh yes, they changed it.

Before:

        if ( $this->orientation === 'horizontal' )
        {
            foreach ( \IPS\Db::i()->select( 'login_type, COUNT(*) AS count', 'core_sessions', array( 'running_time>' . \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ), NULL, NULL, 'login_type' ) as $row )
            {

Now:

		foreach( \IPS\Db::i()->select( 'core_sessions.member_id,core_sessions.member_name,core_sessions.seo_name,core_sessions.member_group,core_sessions.login_type', 'core_sessions', $where, 'core_sessions.running_time DESC', $this->orientation === 'horizontal' ? NULL : 60 )->join( 'core_groups', 'core_sessions.member_group=core_groups.g_id' ) as $row )
		{

It's there since 4.0.9. My post is from march... :)

I'm not sure when they changed it, and it is easier to change the template than it would be the widget code :)

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.