broni Posted July 14, 2015 Share Posted July 14, 2015 If moved to sidebar it doesn't display this: I originally posted it as a bug: https://community.invisionpower.com/4bugtrack/active-reports/whos-online-r7014/#comment-161020 but Andy advised me to create new topic here. Link to comment Share on other sites More sharing options...
CodingJungle Posted July 15, 2015 Share Posted July 15, 2015 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"} <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> 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. Link to comment Share on other sites More sharing options...
Adriano Faria Posted July 15, 2015 Share Posted July 15, 2015 @CodingJungle, you need to edit the widget PHP file. It is hardcoded on horizontal view. Link to comment Share on other sites More sharing options...
Storyteller Posted July 15, 2015 Share Posted July 15, 2015 @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: Link to comment Share on other sites More sharing options...
Adriano Faria Posted July 15, 2015 Share Posted July 15, 2015 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... Link to comment Share on other sites More sharing options...
broni Posted July 15, 2015 Author Share Posted July 15, 2015 Thank you guys I'd prefer Storyteller's look. What was your modification if I may? Link to comment Share on other sites More sharing options...
Storyteller Posted July 15, 2015 Share Posted July 15, 2015 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> Link to comment Share on other sites More sharing options...
broni Posted July 15, 2015 Author Share Posted July 15, 2015 Thank you One little thing. How would I make "See full list" part to display in link kind of font? Like bold or something... Link to comment Share on other sites More sharing options...
Storyteller Posted July 15, 2015 Share Posted July 15, 2015 Simplest way remove: ipsType_blendLinksin 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> Link to comment Share on other sites More sharing options...
broni Posted July 15, 2015 Author Share Posted July 15, 2015 Thank you Link to comment Share on other sites More sharing options...
CodingJungle Posted July 16, 2015 Share Posted July 16, 2015 @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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.