Not really sure what your trying to do.
Your free to post outside the support forums in THE MOD CORNER if your trying to discuss with other users code modifications.
There is no global variable to remove the menubar on pages. Variables change by what scripts your on like in showphoto the variable for the photo poster is $iuserid but thats not valid anywhere else. Likewise on showgallery the variables I think your looking for are $catinfo['cattype'] and $catinfo['parent'] and not valid anywhere else. You would have to do clauses for any respective script. There is no need to add queries if your trying to mod things you just need to dive in and do investigation to find out what the variables are depending on where you are and what your trying to modify.