PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Guide To Creating A phpBB MOD 
Description: A simple guide on how to write a MOD
Author: wGEric
Date: Sun Aug 31, 2003 2:41 am
Type: HowTo
Keywords: mod,writing,creating,guide
Category: MODifications
A simple guide on how to write a phpBB MOD

These are some steps that I take when I am writing a MOD. If you follow these steps you will know exactly what your final product will be and you won’t have any questions on where you are taking the MOD or how you will do that.

  • Step 1 - Planning your MOD
    First imagine what you want your MOD to be. Think of the final product and write down the features that will be included in the MOD. Once you have the features written down number them by priority. This will be the order that you will go about adding features to the MOD once you have the initial code done.

  • Step 2 - Planning your Files
    In this step you will be planning out your initial code. Think of what files you will make and which phpBB files you will edit. Of course write down the files and what each one will hold and also what order they are in importance. Once you have what files you will be using or editing, go through each file and think of where you are going to put the code in those files. I usually make the files here and start adding switches to it with comments on what each switch will do. There are other methods then switches but I prefer switches to the others.

    Another thing to plan is what code will be used a lot throughout your MOD. These will need to be made into functions. If you will be making a lot of functions then it is a good idea to make a new file in the includes directory for your MOD. If not just add your functions to an existing function file (functions.php, functions_admin.php, etc.).

    Along with the functions you need to think if you will be adding a lot of new language variables. If you are, you will need to create a new file in the language directory to keep these. If you aren’t adding the language variables to an existing language file (lang_admin.php or lang_main.php).

  • Step 3 - Planning Database Changes
    If you will be making changes to a database with your MOD then now is the time you will plan this out and create the tables or make the changes. First write out each table and what each one file will contain. I always include an ‘id’ field in each table that I use. This makes it easier to call data from the table because you just have to use the id number. Also, it lets you have duplicate entries. Once you have written down the table’s structure, make it in your database that you will be using to develop the MOD.

  • Step 4 - Programming your MOD
    Now is the time to start programming. Start with the file that you have down as the most important and start writing the code. I like to keep the language file and functions file that I will be using open so when I get to some code that I want to add to those files I can add it right away. Or if I forget what one of the functions or language variable I can look them up really quick.

    Once you have the initial code done, you can start adding the features to your MOD that you wrote down, starting with number one and working up. If you don’t want to do that you can skip to step five and add the features in later.

    Tips to remember while programming
    • Keep code clean and organized
      Nothing is more annoying to me then trying to edit a file that has code that isn’t being used in it or they don’t use any tabs so it is hard to tell what is going on. For your sake and the sake of others that might try to edit your code please keep it organized and clean.

    • Use comments
      Use comments throughout your code so you know what is going on. You can delete these if you don’t want the people who will be using your MOD to view them.

    • Use phpBB’s Database Abstraction Layer (DBAL)
      The DBAL makes it so phpBB works with multiple database types. If you want more people to be able to use your MOD then I would suggest making your MOD support DBAL. Also phpBB will reject any MODs that don’t support DBAL from their database.

    • Use phpBB Template System
      Using the phpBB template system makes it so your php code and html code are in separate files. That way if you want to change the way something looks you can just edit the html file instead of looking through php code for the html you put in there. phpBB will reject any MODs that don’t support their template system from their database.

    • Use the language variables
      Since not everybody speaks English and you want lots of people to use your MOD you will need to use language variables. Using them makes it so that someone just has to translate those and they will be able to use your MOD. Hard coding language into your MOD makes it difficult to find them and translate them. Also phpBB will reject any MODs that don’t support their multiple languages from their database.


  • Step 5 - Beta or Alpha Stage
    Now that you have your MOD complete, you will need to get it ready for testing. That means, getting it so people can install your MOD. phpBB has made a template that is required for all MODs submitted to their database. It is also is the install file that you will use to give instructions on how to install your MOD. I suggest you use it since it is easy to understand and follow the commands. You can find that here along with a tutorial on how to use it.

    Before you release it to the public, I suggest you go through your MOD on your development board. Once you have gone through that and fixed anything that you found, I suggest you install the MOD somewhere else and run through it again. Doing this will get rid of a lot of bugs in your MOD. The less bugs you have the more happy people will be.

    Once you have completed that you will need to get your MOD available to the public. This means if you have multiple files you will need to zip together. Once you have zipped them, or just have the install file, upload it somewhere on the internet so people can download it. Once it is uploaded, make a topic in phpBB’s MODs in Development forum. In the topic write what your MOD does and include a link to where users can download it. The subject of the topic should be your MODs name. Make sure you follow the rules

  • Step 6 - Bugs!
    As people start to use your MOD they will start posting bugs in your code, if there are any, that you missed when you did your testing. Of course you will want to fix those because no body likes a MOD that doesn’t work and phpBB doesn’t allow MODs that have bugs into their MOD Database.

  • Step 7 - Submitting to the MOD Database
    Once you have all of the bugs fixed and all of the features added that you want to, it is time to submit your MOD to the MOD database at phpBB. Before you do that though you should put your MOD version at 1.0.0 if you are below that. Once that is done then submit it to the MOD Database by following its instructions.

    In about a month you will either get a PM telling you your MOD was rejected and why (in this case you should fix the problem and resubmit) or saying your MOD was accepted and giving you a link to its topic.

  • Step 8 - After Your MOD is in the Database
    Once you MOD has made it into the Database you should find your Beta topic and change its prefix to [MODDB]. That way a Moderator will lock the topic so any more discussion on your MOD will be in its release topic.

    Even though your MOD is in the Database, you should still check its thread and help anyone who is having problems. Showing that you give good support will give people a good impression about you so they might use your other MODs.


Now that you have your MOD done, you can start on your next one. Follow these steps again and you will have another successful MOD.

Helpful Links:

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.