<?xml version="1.0" encoding="UTF-8"?>
<plugin name="Total Time Spent Online" version_long="10002" version_human="1.0.2" author="Adriano Faria" website="" update_check=""><hooks><hook type="C" class="\IPS\Member" filename="ttsoMember"><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook196 extends _HOOK_CLASS_
{
	public function getTotalTimeSpentOnline( $member, $timeSpent, $showLang=TRUE )
	{
		try
		{
			try
			{
				$member = $member ?: \IPS\Member::loggedIn();
				$days 	= 0;
				$hrs 	= 0;
				$mins 	= 0;
				$time 	= $this->timeSpent;
		
				if ( $member->inGroup( explode( ',', \IPS\Settings::i()->timeSpent_trackGroups ) ) OR \IPS\Settings::i()->timeSpent_trackGroups == 'all' )
				{
					$secs = $time;
				}
				else
				{
					$secs = 0;
				}
		
				while( $secs >= 86400 )
				{
					$days++; $secs -= 86400;
				}
		
				while( $secs >= 3600 )
				{
					$hrs++; $secs -= 3600;
				}
		
				while( $secs >= 60 )
				{
					$mins++; $secs -= 60;
				}
		
				$days = $days ? $days . \IPS\Settings::i()->timeSpent_acronym_days    . ' ' : '';
				$hrs  = $hrs  ? $hrs  . \IPS\Settings::i()->timeSpent_acronym_hours   . ' ' : '';
				$mins = $mins ? $mins . \IPS\Settings::i()->timeSpent_acronym_minutes . ' ' : '';
				$secs = $secs ? $secs . \IPS\Settings::i()->timeSpent_acronym_seconds . ' ' : '';
		
				if ( $secs > 0 )
				{
					$display	= $showLang ? \IPS\Member::loggedIn()->language()->addToStack('time_spent') . ': ' : '';
					$text 		= $secs > 0 ? $display : '';
					$string 	= "{$text}{$days}{$hrs}{$mins}{$secs}";
		
					return $string;
				}
			}
			catch ( \RuntimeException $e )
			{
				if ( method_exists( get_parent_class(), __FUNCTION__ ) )
				{
					return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
				}
				else
				{
					throw $e;
				}
			}
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return \call_user_func_array( 'parent::' . __FUNCTION__, \func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}

	public function get_timeSpent()
	{
		try
		{
			try
			{
				if ( \strpos( $this->_data['time_spent'], ',' ) === -1 )
				{
					$this->_data['time_spent'] = $this->_data['time_spent'] . ",0";
					$this->save();
				}
		
				list( $timeSpent, $lastUnixtime ) = explode( ',', $this->_data['time_spent'] );
		
				return $timeSpent;
			}
			catch ( \RuntimeException $e )
			{
				if ( method_exists( get_parent_class(), __FUNCTION__ ) )
				{
					return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
				}
				else
				{
					throw $e;
				}
			}
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return \call_user_func_array( 'parent::' . __FUNCTION__, \func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}
}
]]></hook><hook type="S" class="\IPS\Theme\class_forums_front_topics" filename="ttsoPosts"><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook197 extends _HOOK_CLASS_
{

/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
 return array_merge_recursive( array (
  'postContainer' => 
  array (
    0 => 
    array (
      'selector' => 'article > aside.ipsComment_author.cAuthorPane.ipsColumn.ipsColumn_medium.ipsResponsive_hidePhone > ul.cAuthorPane_info.ipsList_reset',
      'type' => 'add_inside_end',
      'content' => '{{if settings.timeSpent_showInPosts}}
	{template="totalTimeSpentOnlineTopics" params="$comment" group="plugins" location="global" app="core"}
{{endif}}',
    ),
  ),
), parent::hookData() );
}
/* End Hook Data */


}
]]></hook><hook type="S" class="\IPS\Theme\class_core_front_profile" filename="ttsoProfile"><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook198 extends _HOOK_CLASS_
{

/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
 return array_merge_recursive( array (
  'hovercard' => 
  array (
    0 => 
    array (
      'selector' => 'div.ipsPad_half.cUserHovercard > div.cUserHovercard_data > ul.ipsDataList.ipsDataList_reducedSpacing',
      'type' => 'add_inside_end',
      'content' => '{{if settings.timeSpent_showHover}}
	{template="totalTimeSpentOnlineCard" params="$member" group="plugins" location="global" app="core"}
{{endif}}',
    ),
  ),
  'profileHeader' => 
  array (
    0 => 
    array (
      'selector' => '#elProfileStats > ul.ipsList_inline.ipsPos_left',
      'type' => 'add_inside_end',
      'content' => '{{if settings.timeSpent_showProfileHeader}}
	{template="totalTimeSpentOnlineProfile" params="$member" group="plugins" location="global" app="core"}
{{endif}}',
    ),
  ),
), parent::hookData() );
}
/* End Hook Data */


}
]]></hook><hook type="C" class="\IPS\Dispatcher\Front" filename="ttsoDispatcher"><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook199 extends _HOOK_CLASS_
{
	/**
	 * Init
	 *
	 * @return	void
	 */
	public function init()
	{
		try
		{
			try
			{
				if ( ! \IPS\Request::i()->isAjax() AND \IPS\Member::loggedIn()->member_id AND ( \IPS\Member::loggedIn()->inGroup( explode( ',', \IPS\Settings::i()->timeSpent_trackGroups ) ) OR \IPS\Settings::i()->timeSpent_trackGroups == 'all' ) )
				{
					try
					{
						$_timeSpent = \IPS\Member::loggedIn()->time_spent;
						if ( strpos( $_timeSpent, ',' ) === FALSE )
						{
							$_timeSpent = $_timeSpent . ",0";
						}
		
						list( $totalTimeSpent, $lastTimestamp ) = explode( ',', $_timeSpent );
		
						$last_click = \IPS\Db::i()->select( 'running_time', 'core_sessions', array( 'member_id=?', \IPS\Member::loggedIn()->member_id ), 'running_time DESC' )->first();
		
						$time_spent = time() - $last_click;
		
				/**
				 * $last_click is greater than 0
				 * $time_spent is less than 10 minutes
				 * $time_spent is less than time since our last update
				 */
						if( $last_click > 0 AND $time_spent <= 600 AND time() - $lastTimestamp > $time_spent )
						{
							$newTimeSpent = ( $totalTimeSpent + $time_spent ) . "," . time();
		
							\IPS\Db::i()->update( 'core_members', array( 'time_spent' => $newTimeSpent ), array( 'member_id=?', \IPS\Member::loggedIn()->member_id ) );
			
							$last_click = 0;
						}
					}
					catch ( \UnderflowException $e ){}
				}
		
				return parent::init();
			}
			catch ( \RuntimeException $e )
			{
				if ( method_exists( get_parent_class(), __FUNCTION__ ) )
				{
					return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
				}
				else
				{
					throw $e;
				}
			}
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return \call_user_func_array( 'parent::' . __FUNCTION__, \func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}
}]]></hook></hooks><settings><setting><key>timeSpent_acronym_days</key><default>d</default></setting><setting><key>timeSpent_acronym_hours</key><default>h</default></setting><setting><key>timeSpent_acronym_minutes</key><default>m</default></setting><setting><key>timeSpent_acronym_seconds</key><default>s</default></setting><setting><key>timeSpent_trackGroups</key><default>all</default></setting><setting><key>timeSpent_viewGroups</key><default>all</default></setting><setting><key>timeSpent_showProfileHeader</key><default>1</default></setting><setting><key>timeSpent_showHover</key><default>1</default></setting><setting><key>timeSpent_showInPosts</key><default>1</default></setting></settings><uninstall><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

try
{
	\IPS\Db::i()->dropColumn( 'core_members', 'time_spent' );
}
catch( \IPS\Db\Exception $e )
{
	/* Ignore "Cannot drop because it does not exist" */
	if( $e->getCode() <> 1091 )
	{
		throw $e;
	}
}


]]></uninstall><settingsCode><![CDATA[//<?php

$form->addTab( 'ttso_settings' );
$form->add( new \IPS\Helpers\Form\Text( 'timeSpent_acronym_days', \IPS\Settings::i()->timeSpent_acronym_days, TRUE, array( 'maxLength' => 3, 'size' => 50 ) ) );
$form->add( new \IPS\Helpers\Form\Text( 'timeSpent_acronym_hours', \IPS\Settings::i()->timeSpent_acronym_hours, TRUE, array( 'maxLength' => 3, 'size' => 3 ) ) );
$form->add( new \IPS\Helpers\Form\Text( 'timeSpent_acronym_minutes', \IPS\Settings::i()->timeSpent_acronym_minutes, TRUE, array( 'maxLength' => 3, 'size' => 3 ) ) );
$form->add( new \IPS\Helpers\Form\Text( 'timeSpent_acronym_seconds', \IPS\Settings::i()->timeSpent_acronym_seconds, TRUE, array( 'size' => 3, 'maxLength' => 3 ) ) );

$form->addTab( 'ttso_permisisons' );
$form->add( new \IPS\Helpers\Form\Select( 'timeSpent_trackGroups', \IPS\Settings::i()->timeSpent_trackGroups != 'all' ? explode( ',', \IPS\Settings::i()->timeSpent_trackGroups ) : 'all', FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => true, 'unlimited' => 'all', 'unlimitedLang' => 'all_groups' ), NULL, NULL, NULL, 'timeSpent_trackGroups' ) );

$form->add( new \IPS\Helpers\Form\Select( 'timeSpent_viewGroups', \IPS\Settings::i()->timeSpent_viewGroups != 'all' ? explode( ',', \IPS\Settings::i()->timeSpent_viewGroups ) : 'all', FALSE, array( 'options' => \IPS\Member\Group::groups(), 'parse' => 'normal', 'multiple' => true, 'unlimited' => 'all', 'unlimitedLang' => 'all_groups' ), NULL, NULL, NULL, 'timeSpent_viewGroups' ) );

$form->addTab( 'ttso_display' );
$form->add( new \IPS\Helpers\Form\YesNo( 'timeSpent_showProfileHeader', \IPS\Settings::i()->timeSpent_showProfileHeader ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'timeSpent_showHover', \IPS\Settings::i()->timeSpent_showHover ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'timeSpent_showInPosts', \IPS\Settings::i()->timeSpent_showInPosts ) );

if ( $values = $form->values() )
{
	$form->saveAsSettings();
	return TRUE;
}

return $form;]]></settingsCode><tasks/><widgets><widget key="ttso" class="\IPS\Widget\StaticCache" restrict="sidebar,cms" default_area="" allow_reuse="" menu_style="menu" embeddable="1"><![CDATA[<?php
/**
 * @brief		ttso Widget
 * @author		<a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
 * @copyright	(c) Invision Power Services, Inc.
 * @license		https://www.invisioncommunity.com/legal/standards/
 * @package		Invision Community
 * @subpackage	ttso
 * @since		09 Sep 2017
 */

namespace IPS\plugins\<{LOCATION}>\widgets;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * ttso Widget
 */
class _ttso extends \IPS\Widget\StaticCache
{
	/**
	 * @brief	Widget Key
	 */
	public $key = 'ttso';
	
	/**
	 * @brief	App
	 */
	
		
	/**
	 * @brief	Plugin
	 */
	public $plugin = '<{ID}>';
	
	/**
	 * Initialise this widget
	 *
	 * @return void
	 */ 
	public function init()
	{
		$this->configuration['timeSpent_nr'] 			= isset( $this->configuration['timeSpent_nr'] ) ? $this->configuration['timeSpent_nr'] : 5;
		$this->configuration['timeSpent_formatname'] 	= isset( $this->configuration['timeSpent_formatname'] ) ? $this->configuration['timeSpent_formatname'] : TRUE;

		$this->template( array( \IPS\Theme::i()->getTemplate( 'plugins', 'core', 'global' ), $this->key ) );
	}
	
	/**
	 * Specify widget configuration
	 *
	 * @param	null|\IPS\Helpers\Form	$form	Form object
	 * @return	null|\IPS\Helpers\Form
	 */
	public function configuration( &$form=null )
	{
 		$form = parent::configuration( $form );

		$form->addMessage( \IPS\Member::loggedIn()->language()->addToStack('timeSpent_permission_text'), 'info' );

		$form->add( new \IPS\Helpers\Form\YesNo( 'timeSpent_formatname', $this->configuration['timeSpent_formatname'] ) );
 		$form->add( new \IPS\Helpers\Form\Number( 'timeSpent_nr', isset( $this->configuration['timeSpent_nr'] ) ? $this->configuration['timeSpent_nr'] : 5, TRUE ) );
		
		return $form;
 	} 
 	
 	 /**
 	 * Ran before saving widget configuration
 	 *
 	 * @param	array	$values	Values from form
 	 * @return	array
 	 */
 	public function preConfig( $values )
 	{
 		return $values;
 	}

	/**
	 * Render a widget
	 *
	 * @return	string
	 */
	public function render()
	{
		if ( \IPS\Settings::i()->timeSpent_viewGroups !='all' AND !\IPS\Member::loggedIn()->inGroup( explode( ',', \IPS\Settings::i()->timeSpent_viewGroups ) ) )
		{
			return '';
		}

		$users 	= array();
		$nr		= $this->configuration['timeSpent_nr'];

		//foreach( \IPS\Db::i()->select( '*', 'core_members', 'time_spent > 0', 'time_spent DESC', array( 0, $nr ) ) as $member )
		foreach( \IPS\Db::i()->select( "*, CONVERT(SUBSTRING_INDEX(time_spent, ',', 1), SIGNED) as timeSpent", 'core_members', NULL, 'timeSpent DESC', array( 0, $nr ), NULL, 'timeSpent > 0' ) as $member )
		{
			try
			{
				$users[] = \IPS\Member::constructFromData( $member );
			}
			catch( \Exception $ex ) { }
		}

		$format = $this->configuration['timeSpent_formatname'] ? 1 : 0;

		if ( count( $users ) )
		{
			return $this->output( $users, $format );
		}
		else
		{
			return '';
		}
	}
}]]></widget></widgets><htmlFiles><html filename="totalTimeSpentOnlineCard.phtml">PGlwczp0ZW1wbGF0ZSBwYXJhbWV0ZXJzPSIkbWVtYmVyIiAvPg0Ke3tpZiBcSVBTXFNldHRpbmdzOjppKCktPnRpbWVTcGVudF92aWV3R3JvdXBzID09J2FsbCcgb3IgXElQU1xNZW1iZXI6OmxvZ2dlZEluKCktPmluR3JvdXAoIGV4cGxvZGUoICcsJywgXElQU1xTZXR0aW5nczo6aSgpLT50aW1lU3BlbnRfdmlld0dyb3VwcyApICl9fQ0KCXt7JHR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GNsYXNzPSdpcHNEYXRhTGlzdCc+CgkJCQl7e2ZvcmVhY2ggJHVzZXJzIGFzICR1c2VyfX0KCQkJCQk8bGkgY2xhc3M9J2lwc0RhdGFJdGVtJz4KCQkJCQkJPGRpdiBjbGFzcz0naXBzRGF0YUl0ZW1faWNvbiBpcHNQb3NfdG9wJz4KCQkJCQkJCXt0ZW1wbGF0ZT0idXNlclBob3RvIiBncm91cD0iZ2xvYmFsIiBhcHA9ImNvcmUiIHBhcmFtcz0iJHVzZXIsICd0aW55JyJ9CgkJCQkJCTwvZGl2PgoJCQkJCQk8ZGl2IGNsYXNzPSdpcHNEYXRhSXRlbV9tYWluJz4KCQkJCQkJCTxhIGhyZWY9InskdXNlci0+dXJsKCl9IiBjbGFzcz0naXBzRGF0YUl0ZW1fdGl0bGUgaXBzVHlwZV9icmVhayc+e3tpZiAkZm9ybWF0fX17JHVzZXItPmxpbmsoIE5VTEwsICRmb3JtYXQgKXxyYXd9e3tlbHNlfX17JHVzZXItPmxpbmsoKXxyYXd9e3tlbmRpZn19PC9hPjxicj4KCQkJCQkJCXt7JHRvdGFsVGltZSA9ICR1c2VyLT5nZXRUb3RhbFRpbWVTcGVudE9ubGluZSggJHVzZXIsICR1c2VyLT50aW1lX3NwZW50LCBUUlVFICk7fX0KCQkJCQkJCTxzcGFuIGNsYXNzPSdpcHNUeXBlX2xpZ2h0IGlwc1R5cGVfc21hbGwnPnskdG90YWxUaW1lfTwvc3Bhbj4KCQkJCQkJPC9kaXY+CgkJCQkJPC9saT4KCQkJCXt7ZW5kZm9yZWFjaH19CgkJCTwvdWw+CgkJPC9kaXY+Cgl7e2VuZGlmfX0Ke3tlbmRpZn19</html></htmlFiles><cssFiles/><jsFiles/><resourcesFiles/><lang><word key="time_spent" js="0">Time Online</word><word key="total_time_online" js="0">Total Time Spent Online</word><word key="timeSpent_acronym_days" js="0">Acronym for days</word><word key="timeSpent_acronym_hours" js="0">Acronym for hours</word><word key="timeSpent_acronym_minutes" js="0">Acronym for minutes</word><word key="timeSpent_acronym_seconds" js="0">Acronym for seconds</word><word key="timeSpent_trackGroups" js="0">Groups that will have their time online recorded</word><word key="timeSpent_viewGroups" js="0">Groups that will be able to view the total time online from other users</word><word key="block_timeSpentWidget" js="0">Total Time Spent Online</word><word key="block_timeSpentWidget_desc" js="0">Will display the user who most appeared online</word><word key="timeSpent_formatname" js="0">Use group color on user link?</word><word key="timeSpent_nr" js="0">Number of users to show</word><word key="timeSpent_permission_text" js="0"><![CDATA[This block uses same permission from the plugin: <strong>Groups that will be able to view the total time online from other users</strong>. So, only allowed users groups in the plugin will be able to view this block]]></word><word key="block_ttso" js="0">Total Time Spent Online</word><word key="block_ttso_desc" js="0">Shows a list of most online users from the community</word><word key="ttso_settings" js="0">Settings</word><word key="ttso_permisisons" js="0">Permissions</word><word key="ttso_display" js="0">Display</word><word key="timeSpent_showProfileHeader" js="0">Show total time online in Profile Header?</word><word key="timeSpent_showHover" js="0">Show total time online when you hover a member link?</word><word key="timeSpent_showInPosts" js="0">Show total time online in posts?</word></lang><versions><version long="10000" human="1.0.0"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Install Code
 */
class ips_plugins_setup_install
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		if( !\IPS\Db::i()->checkForColumn( 'core_members', 'time_spent' ) )
		{
			\IPS\Db::i()->addColumn( 'core_members', array(
				'name'		=> 'time_spent',
				'type'		=> 'int',
				'length'	=> 10,
				'null'		=> FALSE,
				'default'	=> 0,
				'comment'	=> ''
			) );
		}

		return TRUE;
	}

	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version><version long="10001" human="1.0.1"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * 1.0.1 Upgrade Code
 */
class ips_plugins_setup_upg_10001
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_members CHANGE time_spent time_spent VARCHAR(32) CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation . " NOT NULL DEFAULT '0,0' COMMENT ''" );

		return TRUE;
	}
	
	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version><version long="10002" human="1.0.2"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * 1.0.2 Upgrade Code
 */
class ips_plugins_setup_upg_10002
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		

		return TRUE;
	}
	
	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version></versions></plugin>
