Como alterar el tiempo que pasa hasta que un usuario desaparece de la lista de conectados

Si un usuario simplemente se va de la página sin cerrar la sesión continúa apareciendo en la lista de usuarios conectados por un tiempo demasiado largo.

Para poder poner este tiempo a tu gusto, edita el siguiente fichero:

ow_system_plugins/base/bol/user_service.php 

y editas esta función:

public function deleteExpiredOnlineUsers()

{

    $timestamp = time() - 30 * 60; //30 minutos

    $this->userOnlineDao->deleteExpired($timestamp);

}

Explicación:$timestamp es la variable que controla este tiempo.

Se le establece la hora actual con time() y se le resta el tiempo que desees, en el ejemplo 60 segundos * 30 minutos que es media hora,

También puedes poner 60 * 15 (un cuarto de hora), o 60 * 45 (3/4 de hora), o lo que te convenga.

Después, la función deleteExpired eliminará de la lista de conectados todos los que no hayan interactuado con la página en este tiempo que tú has definido.

No has de preocuparte por la función deleteExpiredOnlineUsers(), a ésta la va llamando CRON periódicamente.


Comments:

Rob VIP
Nov 8
My sincere apologies for not finding and reading this article, even though I had asked about how to automatically deactivate online members who may not even be on the website.

Perhaps it would be helpful to post this article in English.?
My sincere apologies for not finding and reading this article, even though I had asked about how to automatically deactivate online members who may not even be on the website.

Perhaps i...See more
Rob VIP
Nov 8
Even though this setting appears to be set by default, I still experience that members are online day in and day out but are simply not active on my websites.
You need to sign in to comment

Rate

Your rate:
Total: (0 rates)

Next article