Jump to content

Modding Suggestion


Guest TestingSomething

Recommended Posts

I am just curious if it would be possible for a future release of IPB to allow for modifications to be placed in various areas without editing files. I know modding is obviously not the main concern for a software company, but I was just curious if this could rather easily be implemented. For example basically some command in a component's file that would allow it to place things on the index paghe or in topics or w/e even without editing board.php, forums.php, topic.php, etc...

Would that even be possilbe or is everything going to HAVE to be loaded with that particular file, regardless? Could there maybe be some sort of check in each file for a certain class which is located in another file, for example?

I obviously know very little about programming. lol But in my mind, it seems like this would be possible in some way, given that when a file such as board.php is loaded it would ahve some sort of check, maybe to check a particular file designed for something along these lines?

Link to comment
Share on other sites

theres been talk of a "hooks" system implemented into ipb 3.0 but i'm not sure how that will work yet and since its not been coding maybe ips don't even know how yet either :P. will allow you to install mods in future without needing file edits (hopefully).

Link to comment
Share on other sites

This is completely possible to do, the question is just how far they want to take it. There is already something of this system in place, with the way you are able to add new sections into the UserCP by just having a component that has an associated components_ucp file. As it's building the UserCP menu, it loops through all components, finds any that have a file in the components_ucp.php file, and if it finds one it does the require_once() function to load the class, and gets the HTML that the class returns. The hooks system would work exactly like that (at least that's how I see it happening). But like I said, they have to determine how far they will take it. Having 500 different places where it has to look for files may not be worth it, but 25 or so might.

Link to comment
Share on other sites

Not if they're not called.

We haven't started coding this yet, and we haven't ironed out the techie details. But the way I envision it is a modification would register it's hook in the ACP first. This would be stored in a cache_store, or something easily loadable on each page. Even if you have 100 mods installed, the little amount of data stored in the cache store won't be a big deal (likely will be less data than some people have in their forum_cache even).

Then, rather than just reading directories for files, checking if they match, and so on for each hook location, we check if there is a cache entry at the specific hook time for that hook entry - if so, load up those hooked files. For example...members online today pretty much always shows a list of members in the board stats. Right now, you'd have to edit a file (boards.php or func_boardstats.php for example). Instead, when the members online today mod is "installed" a hook is registered to $hooks_array[ boardstats ][] - when we parse the boardstats routine, we can loop through any entries in this array ($hooks_array[ boardstats ]), and we'll see the members online today hook - and then call it.

I believe this will allow a lot of flexibility, while still preserving resource usage. If there is no registered hook, the code would be skipped entirely, so you wouldn't have any slow down (rather than reading files in a directory, which will always slow things down a tad, even if none of those files are processed).

Rough ideas still, mind you. ;)

Link to comment
Share on other sites

and with a system like this you won't have to re add code edits via the files. which means IPB can pretty much keep the same source code to troubleshoot issues with support tickets. and with a global hooks disable you can see just by shutting off the hooks system to see if its one of your mods.

It would be nice for a way to uninstall hooks as well. so if you don't want that hack or feature anymore on your site just uninstall the hook (which will uninstall any database edits and what not.( and all you have to do is delete the files related to that hack.

Link to comment
Share on other sites

I suppose, the next step of optimizaition will be "forum compilator" :) . When you have forum sources & hook mods in backup directory, and compiler generates a working php code with embedded hooks/cache files right in place. May be, for IPB 5.0 or IPB 6.0 :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...