Callback for preg_replace_callback on the query.
It allows to replace on the fly a few pre-defined strings, for convenience ('query_see_board', 'query_wanna_see_board', etc), with
their current values from $user_info.
In addition, it performs checks and sanitization on the values sent to the database.