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 making additions/changes to Oxwall | Forum

Topic location: Forum home » Support » General Questions
Vasilis
Vasilis Jul 24 '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!

ross Team
ross Jul 25 '14
Vasilis, everything you said here is correct. except for overriding as it may and can cause conflicts with the newly created functions/classes/methods. It would be better if you just extend classes or redefine them. 


I recommend you to download any plugin from the store which has something to do with the front-end and you will get a better understanding what is what. 

The Forum post is edited by ross Jul 25 '14