+ local path, name = plugin:match("([^/]*)/?(.*)");
+ if name == "" then
+ if not resource then
+ resource = "mod_"..plugin..".lua";
+ end
+
+ local content, err = load_file(plugin.."/"..resource);
+ if not content then content, err = load_file(resource); end
+
+ return content, err;
+ else
+ if not resource then
+ resource = "mod_"..name..".lua";
+ end
+
+ local content, err = load_file(plugin.."/"..resource);
+ if not content then content, err = load_file(path.."/"..resource); end
+
+ return content, err;