Add-on Online Status Timeout

xml

Active member
As you know Online Status Timeout option for xenforo is limited to 60 minutes. I would like to find add-on that unlimit Online Status Timeout same as vBulletin.
 
can any one estimate how much this add-on could cost to pay for? I really need it
 
Hello,

Enable debug mode :
Code:
$config['debug'] = true;

and edit "max value"
 

Attachments

  • online.webp
    online.webp
    1.3 KB · Views: 85
Thanks Jarod,
what you suggested wont work, Online Status Timeout thing is more complicated
 
Online Status Timeout is just time, in which set cookie with session_id.
This time in code, XenForo_Session (\library\XenForo\Session.php)
Find this code:
Code:
public function __construct(array $config = array(), Zend_Cache_Core $cache = null, Zend_Db_Adapter_Abstract $db = null)
    {
        if (empty($config['admin']))
        {
            $defaultConfig = array(
                'table' => 'xf_session',
                'cacheName' => 'session',
                'cookie' => 'session',
                'lifetime' => 3600
            );
        }
        else
        {
            $defaultConfig = array(
                'table' => 'xf_session_admin',
                'cacheName' => 'session_admin',
                'cookie' => 'session_admin',
                'lifetime' => (XenForo_Application::debugMode() ? 86400 : 3600) // longer lifetime in debug mode to get in the way less
            );
            unset($config['admin']);
        }
'lifetime' => 3600 - it is what You need. Just change 3600 to You time.
As for addon for this, I dont know how to extends this class so can not make addon.
 
Thanks Akinak

I already change ( 'lifetime' => 3600) and (max value) that @Jarod suggested to somthing different and it didnt work out, its more complicated
 
Thanks Akinak

I already change ( 'lifetime' => 3600) and (max value) that @Jarod suggested to somthing different and it didnt work out, its more complicated
Cockies delete when you close brouser or when time left. I test on my forum. Can You give link to you forum?
I suspect that we do not understand each other :-)
Do you want to increase the time in which the logout is an open forum page, right?
 
what I meant from this post is the number of members and guests OnLine Now is limited by xenforo code to 60 minutes currently, what I want is increase it to 240 minutes for example to show more members and guests OnLine Now :)
 
By the way am still on version 1.1.1, i am not sure if its different for other versions
 
what I meant from this post is the number of members and guests OnLine Now is limited by xenforo code to 60 minutes currently, what I want is increase it to 240 minutes for example to show more members and guests OnLine Now :)

OnlineNow show users by active session. When user close brouser or press logout or 60 min comes session is deleted. So, You can change this time (60 min) by editing code (or editing config.php).
 
When visitor visiting your site, and clicked any link on your site, Its should be consider 'Online' and It recorded into xf_sesseation_activity. And xenForo called 'Online' by
PHP:
return $sessionModel->getSessionActivityQuickList(
            $visitor->toArray(),
            array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
            ($visitor['user_id'] ? $visitor->toArray() : null)
        );
So simple Addon should be overidden this function:
Code:
/**
    * Returns the length of time after the last recorded activity that a user is considered 'online'
    *
    * @return integer Time in seconds
    */
    public function getOnlineStatusTimeout()
    {
        return XenForo_Application::$time - XenForo_Application::get('options')->onlineStatusTimeout * 60;
    }
Or you can edit such as
Hello,

Enable debug mode :
Code:
$config['debug'] = true;

and edit "max value"
 
When visitor visiting your site, and clicked any link on your site, Its should be consider 'Online' and It recorded into xf_sesseation_activity. And xenForo called 'Online' by
PHP:
return $sessionModel->getSessionActivityQuickList(
            $visitor->toArray(),
            array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
            ($visitor['user_id'] ? $visitor->toArray() : null)
        );
So simple Addon should be overidden this function:
Code:
/**
    * Returns the length of time after the last recorded activity that a user is considered 'online'
    *
    * @return integer Time in seconds
    */
    public function getOnlineStatusTimeout()
    {
        return XenForo_Application::$time - XenForo_Application::get('options')->onlineStatusTimeout * 60;
    }
Or you can edit such as

Also look class XenForo_CronEntry_CleanUp
// delete expired session activities
$sessionModel = XenForo_Model::create('XenForo_Model_Session');
$sessionCleanUpCutOff = XenForo_Application::$time - 3600;
$sessionModel->updateUserLastActivityFromSessions();
$sessionModel->deleteSessionActivityOlderThanCutOff($sessionCleanUpCutOff);
this code delete old records from table session_activity.
 
as I said its little bit complicated with 3 or 4 code elements involved and it needs a skilled coder to make this add-on and I am sure this add-on will make good sales for the coder
 
Last edited:
No big deal here.
The problem occurred in the understanding of what you want.
I decided that I need time to logout. And there was a block "Users Online"
 
No big deal here.
The problem occurred in the understanding of what you want.
I decided that I need time to logout. And there was a block "Users Online"

No need to create block "Users Online", the block is already existed by defualt
 

Attachments

  • mon.webp
    mon.webp
    28.1 KB · Views: 56
Top Bottom