Firefox PHP

How to best add database fields for module development

Posted by theapplelover 
How to best add database fields for module development
May 07, 2011 07:42PM
Hi Phorum Developers,
I am pretty new to Phroum but I really like the nice open and modular approach! I am trying to write an addon that can store additional information in the database. Simple example store the users address. But I do want to store the data in real database fields so I can use SQL searches etc. I know there are a thousand ways of doing this but if someone has a hint of what would be a good way it would be great! I am not looking for a detailed description, just a general overview like where to put the database access code the best, how to merge it with the current available stuff etc and still keep the modularity of phorum. Or if you think a hack would be better? Thanks in advance!
Re: How to best add database fields for module development
May 07, 2011 08:49PM
Best would be to have a look at existing modules.
Use your own tables and don't change the core tables so its easier to use for later changes.
I think the event logging module is a nice example with separated database code and adding its own table.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: How to best add database fields for module development
May 07, 2011 09:29PM
Hi Thomas,
Thanks for your answer. Is there any specific module you can recommend? I e.g. looked at the Simple Text Replacement Mod which is only using the standard fields for storing data. And which would be the right module then to ini the connection to the database etc.?
Re: How to best add database fields for module development
May 08, 2011 12:16AM
Thomas: "I think the event logging module is a nice example with separated database code and adding its own table."


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How to best add database fields for module development
May 08, 2011 04:36AM
Cool, thanks I will check it out!
Sorry, only registered users may post in this forum.

Click here to login