I have the source of a pretty good PHP based chess program that supports checking of legal moves, detects check, and a number of other features. But
the style of programming is very different than what is used for XMB (session-state versus cookie-state) and it will take some work to get integrated.