Source code of replaying visitor's actions
- Source code Location
- Server side program
The source code is in the "[ALINOUS_HOME]/admin/player/" folder.
In this folder, there are source code files of function written in Replay visitor's actions.
The detail of how to replay the visitor's action is written at Replay visitor's actions.
By clicking the "play" button of the record, a new popup window is opend and the user actions are played.
When the user push "play" button, then the "play()" function is called with "use_id" and "access_id" parameter.
This function access the server-side program, whichi is
"/admin/player/playhelper.alns", and succeeded in it, open a new popup window and set the event handler for the "onload" event.
The event handler for the "onload" event makes a mouse indicator, and call the "fetchEvents()" function.
The "fetchEvents()" function is to access the url of server-side program to fetch the records in the database, and start player.
If the next actions are there, it calls "doPlay()" function to continue playing actions. If not exists, show alert in the popup window and finish.
The "doPlay()" function is to play the fetched event.
The fetched actions are stored in "
playActions" variable and if play all the actions, call the "fetchEvents()" function again.
The server side program of this player is
These program process the data in the server side.
The "playhelper.alns" extract the archived action logs.
The number of actions are so many that this application stores archived log in the "wic_user_motion_archive" table. The archived logs are separated with " "(space). The "extractArchive()" function split them and insert each log into the "wic_user_motion" table.
This function query the extracted data, convert it into Json string, and return it.