Quite a few modules (Protector and MetaTags come to mind) need to be able to hook into Xoops. This is usually done by the site owner having to hack into mainfile.php, footer.php or header.php.
It would be better if Xoops provided a mechanism whereby when a module installs, it can register itself as needing to hook into one of these files at an appropriate point.
Many years ago I worked on Burroughs CTOS machines and the OS for these was written as a set of vector offsets. This meant that you could insert new code into the OS simply by changing the vector table. This may be a way that could be used to run mainfile et al, or perhaps someone has a better solution.
At the very minimum we could provide two entry points into mainfile (beginning and end) and similarly for header and footer.php (although in footer's case it would need to be prior to the actuall page display.) At these points Xoops looks to a system table to see if it has any registered module code to run and runs it.
The real advantage of this is that it stops end users having to hack code and places the onus back on the module developer.
Log in to post a comment.