You don't need line 1 or line 3 in your code. Although I don't if that will fix your problem.
You may need to use the $GLOBALS array to access the variable. Try using this code where you would normally just use the variable.
PHP Code:
$GLOBALS['sth_currentloc_enc']
P.S. In most of default vBulletin pages you can make use of the THIS_SCRIPT constant to find the filename.