The path that works fine from the root of your site may not be working from the location of the MODx index.php file. If your MODx is installed in the root of your site, it should be the same (although a relative path may not work; you may need to make it an absolute path). If your MODx is in its own directory, however, then the path has to be modified to reflect that. For example, if you have something like this for MODx
/home/mydomain/public_html/mymodx
and for your forum
/home/mydomain/public_html/forum/
the relative path from MODx would be
If your code includes a file which in turn required another file, the second file may have a problem since it’s no longer being run from its home directory, it’s being run from the MODx directory. You may find that you have to hack the second file to make an absolute path rather than a relative one, since in the two cases (from MODx and from the forum) it’s being run from two different locations.