4
That works. Thanks very much to both.
[EDIT] Just in case this finds its way into anyone else's bag of tricks, there's a missing close bracket in the first line of Mith's modification. It should be
if (!is_object($GLOBALS['xoopsModule']) || $GLOBALS['xoopsModule']->getVar('dirname') != "moduledirname") {
I'm happy to see that I'm not the only one who occasionally loses count of brackets and braces.