Custom code for flag activity

This is an example of how to log activity through code for a user, flagging some content.