If you are doing this in MyBB templates you can try the following:
{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}
{$_SERVER['REQUEST_URI']}
The best one to probably use is
{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}
Here, that would show "community.mybboard.net/showthread.php"... although it isn't recommended to use them unsanitized (which is what I was checking)...