We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

The "right" way for custom code modifications | Forum

Vasilis
Vasilis Jul 22 '14
Hi everyone,


I recently started using Oxwall and I am in the process of writing my first Oxwall code. 


I have read about the plugins and it seems as the best way to add things to Oxwall while being able to update it without issues. Based on the skeleton I got an idea of how you add new pages and add new functionality but my concern now is how to modify existing base code via a plugin. Can you override some functions of particular classes? 


For example if you look at this post they want to remove the age from the users list while having a populated field in the database. 


Changing the code in user_list.php is fairly simple and nice but if you update Oxwall the changes will be lost and if you make many modifications then the whole process will become a nightmare. 


What is the best approach to this problem? Is there a way to simply override the getFields( $userIdList ) function for the BASE_CTRL_UserList class using a plugin? 


Based on basic OO principles you should be able to extend this class and override the function and then route the extended class on the route of the BASE one? Would that work? I guess it should be possible but is there a way to just override the particular functions without too much fuss? 


I am thinking about this correctly? Anything I need to look out for?


Thanks!