PDA

View Full Version : User Online


kapii
12-02-2012, 04:15 AM
I am attempting to code a custom plugin, but on php side I need it to check if the member is online, something like so:

if (member is online)
{
$do_this;
}
else
{
$do_that;
}

I know in the templates it is <vb:if condition="$onlinestatus==1">

but how to do it in php?

Lynne
12-02-2012, 04:02 PM
Well, just converting that template conditon to php would be:

if ($onlinestatus == 1)

But, that is assuming the variable is valid where you are using it.

kapii
12-02-2012, 04:47 PM
Hi Lynne, thanks for the reply, I would be using it in the private_insertpm_complete hook.

Lynne
12-02-2012, 11:12 PM
That hook location is present in several files - you will need to look up the page you are using it on.

user.php
class_dm_user.php
infraction.php
private.php