add JS & shell PHP functions for liking, flagging, and getting states