Current tavidoc.php contains two bugs, which may prevent it from working correctly.
- The QUERY_STRING was assumed to be global. This fails when PHP is configured to disable these globals.
Fix is to just reference $_SERVER['QUERY_STRING'], which is always available.
- The call to tavi's freelink_token() failed due to a missing 5th parameter. The entire code for tavidoc's custom_parse_freelink() was replaced by a slightly stripped version of tavi's parse_freelink() (as was the previous code).
Attached version of tavidoc.php contains fixes for both these bugs and no other changes.