logo

eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
add stuff to functions?

One thing thats been bugging me for a while is that you cant add extra stuff on to functions, you have to edit the function file. So, can anyone think about how we can add some sort of callback for the functions? For example, add a callback to the register function, so that when it is executed, another function is run, one defined by a plugin or something?

Someone has asked for a points plugin, in which people get points for posting etc, atm this would require editing all the functions, and editing means keeping track of files edited making updating harder
Last Edit: 7th December, 2009, 11:38:51 AM by confuser

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: add stuff to functions?

Had an idea, because we use call, theme, plugin functions etc, we can add the checks in there. Store the stuff in the database like so
Function name, serialized array of all stuff to execute, also add in the option for call before or after function has ran, also if its after, let the callback have access to the return of the function

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: add stuff to functions?

That is good as long as we keep those things cached.  Otherwise that is a lot of checking the database for every page load.  We will need to make an easy way to add in a callback from a plugin though.

"Control yourself. Take only what you need from it"
http://mrrsm.com

Jump to:


0.05 seconds Queries: 13