How to Grab Session Activity

How to Grab Session Activity

LPH

Flight Director
Staff member
LPH submitted a new resource:

How to Grab Session Activity - Enhance your addon

Grabbing the session activity to use in your add on focuses on the SessionActivity from the repository.

PHP:
        /** @var SessionActivity $activityRepo */
        $activityRepo = XF::app()->repository( 'XF:SessionActivity' );

        $activityRepo->updateSessionActivity(
            XF::visitor()->user_id, XF::app()->request->getIp(),
            '', '', array( '' ), 'valid',
            ''
        );

Next, you can find the online count, staff list, etc.

PHP:
...

Read more about this resource...
 
Top