1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on Online Status Timeout

Discussion in 'Resource and Add-on Requests' started by xmlxp, Aug 5, 2013.

  1. xmlxp

    xmlxp 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.
     
  2. xmlxp

    xmlxp Active Member

    can any one estimate how much this add-on could cost to pay for? I really need it
     
  3. Jarod

    Jarod Active Member

    Hello,

    Enable debug mode :
    Code:
    $config['debug'] = true;
    
    and edit "max value"
     

    Attached Files:

  4. xmlxp

    xmlxp Active Member

    Thanks Jarod,
    what you suggested wont work, Online Status Timeout thing is more complicated
     
  5. Akinak

    Akinak Well-Known Member

    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.
     
  6. xmlxp

    xmlxp Active Member

    Thanks Akinak

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

    Akinak Well-Known Member

    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?
     
  8. xmlxp

    xmlxp Active Member

    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 :)
     
  9. Moshe1010

    Moshe1010 Well-Known Member

    I was able to do it by editing "max value". Not sure why it doesn't work for you.
     
  10. xmlxp

    xmlxp Active Member

    By the way am still on version 1.1.1, i am not sure if its different for other versions
     
  11. Akinak

    Akinak Well-Known Member

    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).
     
  12. Akinak

    Akinak Well-Known Member

  13. xmlxp

    xmlxp Active Member

  14. Nobita.Kun

    Nobita.Kun Well-Known Member

    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
     
  15. Akinak

    Akinak Well-Known Member

    Also look class XenForo_CronEntry_CleanUp
    this code delete old records from table session_activity.
     
    Glockie likes this.
  16. xmlxp

    xmlxp Active Member

    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: Aug 7, 2013
  17. Akinak

    Akinak Well-Known Member

    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"
     
  18. xmlxp

    xmlxp Active Member

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

    Attached Files:

    • mon.png
      mon.png
      File size:
      25.4 KB
      Views:
      49
  19. Nobita.Kun

    Nobita.Kun Well-Known Member

    It should be avaible soon :D
    I will take sometime to create it :)
     
  20. xmlxp

    xmlxp Active Member

    Take your time, and I will be the first to buy it (y)
     

Share This Page