+
+ /**
+ *
+ * We will always have a module name.
+ * First see if we have a plugin which is masquerading as a module.
+ *
+ */
+
+ if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
+ include_once("addon/{$a->module}/{$a->module}.php");
+ if(function_exists($a->module . '_module'))
+ $a->module_loaded = true;
+ }
+
+ /**
+ * If not, next look for a 'standard' program module in the 'mod' directory
+ */
+
+ if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
+ include_once("mod/{$a->module}.php");