Blog

Archive for the ‘Modifications’ Category

How to set up a test board for modding

Posted by battye in Development, Modifications with the tags , , , on July 16th, 2010

This article was written primarily for MOD writers interested in ways to optimise testing. Everyone has their own style of testing which works for them, and this is only one such style.

A good way to test MODs is by using a local setup. A local setup is an installation on your own computer or network, as opposed to a remote setup which would typically be your website (as it is hosted by another company in a “remote” location). This means that less time is spent uploading and downloading through FTP as any changes you make take effect almost instantly. An added benefit is you can continue developing and testing your modifications when you are without an internet connection.

There are many types of software which will allow you to create a local setup, such as XAMPP and EasyPHP. What these programs do is install PHP, a database like MySQL and Apache in their own sandbox which only runs when you start the program. For the purposes of this article, I will look at EasyPHP.

Installation instructions can be found at http://www.easyphp.org. Once EasyPHP is installed, in Windows Explorer navigate to the local web server directory. In the case of EasyPHP v2.0b (and depending on how you configured the software during installation) then it might be C:\Program Files\EasyPHP 2.0b1\www

Now that EasyPHP is set up, a quick way to install phpBB3 is to use phpBB QuickInstall (by tumba25 and evil<3). Of course, you can simply install phpBB3 as you would normally – but for the purposes of testing MODs by using QuickInstall there is the added flexibility of being able to install multiple boards very quickly (such as if you wanted to have a separate test board for multiple MODs).

QuickInstall is very easy to use, simply download it from http://www.phpbb.com/mods/quickinstall/ and extract the zip file. Create a new directory in the EasyPHP local web space (www) called quickinstall and copy all of the extracted files into this directory. Then in your web browser, go to http://127.0.0.1/quickinstall/index.php – you should see a page like this:

Once you have filled in the forms and pressed submit, QuickInstall is configured and ready to use. This means you can now create test boards. To do this, go to the Main Page tab and fill out the options in the forms provided. When you get to the setting where it asks to install AutoMOD, make sure you select “Yes”.

It will take a few minutes to install and copy the files across to the new directory (in this case “test”).

Once this is has happened, the browser will automatically redirect you to the newly installed phpBB3.

Once this is done, if you have already written (or partially written) a MOD then you can install it on the test board. Installing your MOD is a simple matter of navigating to the Administration Control Panel (ACP) and clicking the AutoMOD tab. From here, providing your MOD is in the correct MODX format and can be read by AutoMOD, the MOD will be installed very quickly.

If the MOD installs correctly, you will see a message like this:

Now your MOD has been installed. If you have yet to start writing your MOD then you can edit the files directly, as mentioned above this is a huge time saver. In this example, the test board is located in C:\Program Files\EasyPHP 2.0b1\www\quickinstall\boards\test – so the files that require editing can all be found in that test directory.

Note: if you ever want to delete a directory this can be done very easily by navigating to the “Manage Boards” tab of QuickInstall and selecting the board, and clicking delete. There is no confirmation message, so be sure that you want to delete it before proceeding.

There are some other useful tips to bear in mind when running a test board.

The easiest way to check the performance of the script (the MOD) is to enable DEBUG and DEBUG_EXTRA in config.php.

@define(‘DEBUG’, true);
@define(‘DEBUG_EXTRA’, true);

QuickInstall enables this by default. To turn this off is as simple as commenting those lines out.

The purpose of DEBUG is to show page load and simple query information in the page footer:

DEBUG_EXTRA is very similar (and only works if DEBUG is enabled), except it shows the explain link:

Clicking the explain link leads to the SQL report page, which lists database query information:

It is worth noting that DEBUG and DEBUG_EXTRA can be used on individual pages. If you don’t want that footer information appearing everywhere, then you can comment out those two lines in config.php but include them at the top of the PHP file for any individual page. For instance, if the lines were commented out of config.php but included under the <?php line of index.php – then the debug information would appear only on the index page.

Another useful benefit of enabling DEBUG is to see PHP notices. For instance, suppose I included the line echo $dog[6]; at the top of index.php. If DEBUG is disabled then the script will run error-free, despite that variable never being defined.

With DEBUG enabled, the PHP notice will be shown. This is important because it does reduce the amount of mistakes and potential bugs in code. (Note: the PHP notices can be shown with DEBUG disabled if you include error_reporting(E_ALL | E_NOTICE); in the file. This is handy if you want to see the notices, but for whatever reason do not want the additions to the page footer).

When dealing with cached database queries, during testing you might want to clear the cache (or at least clear any cached queries relevant to your MOD). You may or may not want to remove this code once testing is complete, depending on the MOD. By including the line $cache->destroy(‘sql’, MOD_TABLE); you can remove any cached queries relating to the specified table (you would change MOD_TABLE to the constant of whichever table you want to clear the cache for).

When making changes to the template, it is very annoying to have to Purge Cache after each change. Fortunately this can be made a lot easier, by going to the Server configuration -> Load settings page in the ACP and setting “Recompile stale style components” to Yes.

Remember to exercise caution when editing templates though. It is always better to edit the html files directly instead of editing the templates from within the ACP. Edits from within the ACP are stored in the database, they don’t physically change the file. Therefore if you have made edits in the ACP to a given file, then if you edit that file directly in the future the changes you made within the ACP will be lost.

I hope this article has been of some help. If you already enjoy writing MODs, now you can enjoy testing them as well!

Guest Post: Writing Modifications by RMcGirr83

Posted by DavidIQ in Modifications on February 25th, 2010

As a Junior MOD Validator (aka “JMV”), it is my “job” to try and test each MOD as thoroughly as possible. What does this mean?

Each modification (aka “MOD”) that goes through validation on phpBB.com is first run through MOD Pre-validation (aka “MPV”) which looks for certain items (licensing, correct version of phpBB, correct MODX version, etc) that MUST be in a modification that is to be validated. If the modification does not pass MPV (there are exceptions) then the MOD is “insta-denied” with a PM shot off to the MOD author to let them know why.

If the MOD passes MPV then a MOD Team member starts to analyze the code being submitted as well as what changes, if any, to the core code of phpBB are done (this includes any edits to the HTML files as well). Notes are made concerning the coding of the modification. For example: if the MOD follows the coding guidelines, the security of the code, the effiency of the code (query in loop == baaaaaaaad), etc. Once the validating Team Member looks at the code a status is set on the MOD (either “Deny”, “Testing”, “Repack”, etc).

If set to testing, then it’s one of the members of the JMV turn. 🙂

Once a MOD is set to testing, we must follow strict guidelines concerning the testing of the MOD. Those guidelines give us a sort of “checklist” and are comprised as follows:

  • The MOD must install using AutoMOD
  • The MOD must be installed on a fresh, unmodified version of phpBB
  • The instructions for making the MOD functional (eg, DIY instructions) must be accurate.
  • Debug is set to “on” in the Test Forum.
  • Any additions to HTML files, or html files themselves, must pass W3c validation.

Once the forum is setup and AutoMOD installed on it, we then upload the MOD and install it to test. If the MOD does not install (due to incorrect commands in the MODX installation file) we attempt to adjust the MODX file so that the MOD installs properly and note the changes for a possible “Repack”. As you can imagine, some modifications are quite easy to adjust while others have very involved MODX installation files.

Once installed on the forum, we test the functionality and accuracy of what the modification is supposed to do. Some of us may make recommendations on “user friendliness” but it is not a reason for a denial of a MOD. Again, some modifications are quite easy to tell if they do what the description states they do. Some modifications are extremely involved and require quite a bit time to be able to test the MOD as thoroughly as possible.

How can a MOD Author help?

The “trick” to getting any MOD to pass validation is to ensure that you, as a MOD author, thoroughly test your MOD just as a JMV would. Ensure it installs onto a fresh installation of phpBB (a.k.a. “vanilla installation”) using AutoMOD. Test your MOD as thoroughly as possible to ensure that it works properly and does not create any “features” (my version of “bugs”). If there is HTML involved, ensure the layout is as “user friendly” as possible. Analyze your code, analyze it again, analyze it again, rinse, repeat…always retesting any changes you make.

Ultimately, the success or failure of a modification passing validation does not rely upon the MOD Team Members or even the Junior Validators but with you, the MOD author. It is up to you to ensure your modification is secure and works correctly. Please know that we are here to help with suggestions and comments or even with code snippets if needed.

Happy modding!! 🙂

Written by: RMcGirr83 (website)

If you would like to have one of your own blog posts that relates to phpBB on this blog, please contact the Team Leader of the group for which your blog post applies to via a private message with the contents of the blog post.

Adding navigational links to your MOD (breadcrumbs)

Posted by battye in Modifications with the tags , , on January 31st, 2010

An easy way to add navigational links to your MOD is to use an inbuilt feature of phpBB3 called “breadcrumbs” (named because it leaves a trail back to the forum index).

It only requires a few extra lines of PHP code to add a breadcrumb to your own MOD (or to your website if you are doing personal customisations). This article explains how to do so.
Read the rest of this entry »

Junior Validators

Posted by battye in Modifications with the tags , , , on January 10th, 2010

What is a Junior Validator?

Junior Validators assist the MOD Team with the validation of MODs. They help the MOD Team validators with pre-validation and testing.

Pre-validation involves running a check on MODs newly submitted to the MOD Database queue using the MOD Pre-Validation tool (MPV) and setting a status on the MOD accordingly.

Testing is the major role of a Junior Validator, and requires installing the MOD on a vanilla phpBB3 board through AutoMOD. After installing the MOD, all functions of the MOD and board should then be tested – all to make sure that the MOD and the board run error-free. The Junior Validator then makes any notes or suggestions to the MOD Team concerning the MOD and, again, the MOD status is set accordingly (“approve”, “deny”, “repack”, etc). In a nutshell, this is the role of a Junior Validator.

Why should I become a Junior Validator?

As a Junior Validator you will be gaining valuable first-hand experience with MOD Team processes which could lead to consideration for a position on the MOD Team. You will also have access to private forums including a Junior MOD Validators forum where you can discuss MOD validation with fellow Junior Validators and MOD Team members.

Most importantly, it will be fun! If you have a passion for writing MODs you will find working with the MOD Team to help validate MODs, and also the opportunity to give something back to the community, very rewarding. The phpBB Team is a very friendly group of people so the chance to work closely with the MOD Team will be very enjoyable.

What are the requirements?

To be considered for a position as a Junior Validator, it is important that you:

– have authored a MOD and submitted it to the MOD Database.
– can communicate in English.
– understand the phpBB3 codebase.
– have an understanding of MODX and MOD policies
– are familiar with the MOD Validation checklist

Where can I apply?

To apply, please fill out the form at the bottom of the Junior Validators page and your application will be reviewed by the MOD Team shortly thereafter. Successful applicants will be notified by private message on phpBB.com.

How to display posts and topics on external pages

Posted by battye in Modifications with the tags on November 9th, 2009

A very common question about phpBB is how to display recents posts or topics on a separate page, such as a website homepage. It can be very handy to do this, as it allows visitors to your website a chance to quickly see recent activity.

This blog post details how displaying a list of recent posts and topics externally can be done. There are a couple of different formats that are covered:

  • The latest topics (including only from specified forums)
  • The first post of the latest topics (including from specified forums)
  • The latest posts from specified topics
  • The latest posts from the entire forum

Everything displayed is subject to the users forum read permissions.

Read the rest of this entry »

MOD Validation Workflow

Posted by igorw in Modifications with the tags , , , on October 5th, 2009

As the title already says, this blog post will describe how the MOD Team validates modifications and what happens to them before they come out at the other end of the queue.

Read the rest of this entry »

Less significant modification team changes

Posted by igorw in Modifications with the tags on September 19th, 2009

As previously stated every team will announce in what way it will be affected by the significant phpBB development changes. This post will explain the effects on the modifications team.

Versioning scheme

Since phpBB will be using a new versioning scheme we will adopt this scheme for all of our tools (AutoMOD, UMIL, etc).

MOD authors will be encouraged to use this new versioning system too. We will however be less strict in enforcing it. In fact, we will allow any versioning that is compatible with version_compare, so versions such as 1.0.0.0 will be allowed. We will still require it to be stable though.

Additionally we will release a new version of MODX to support this and adapt our tools where needed.

phpBB 3.0

Because phpBB 3.0 is not going to change we don’t have to adopt any changes. This will just continue as it has been so far.

phpBB 3.x

Depending on what changes will be made to the modding API we will assist MOD authors in using it and provide documentation. All in all, it will highly depend on how many changes will be made to phpBB itself. There are a lots of improvements we can think of, and we will try and get them implemented where possible.

We will allow submission of modifications for new phpBB branches once they are released. We will support the branches that are supported globally.

phpBB 4.0

The release of phpBB 4.0 is way too far ahead for us to be able to say anything at all about it. It is a fresh start and will possibly bring many new possibilities. We can be pretty sure that the new architecture will have an impact on modding that will change it fundamentally. We will wait and see. And work together with the development team.

The future

We have some great plans waiting for the MOD writing community. These include building more advanced infrastructure and tools, as well as making alterations to the MODX standard. We will work on making the workflows of modification engineering more efficient. More information will follow in due time.

— The Modifications Team

How (not) to use request_var

Posted by igorw in Modifications with the tags , on September 10th, 2009

Note: This post is targeted at MOD authors and contains many technical details.

Introduction

Amongst the great security features that phpBB 3.0 provides is the function used for processing user input, request_var.  This function was designed to make it easy to securely retrieve user inputted data.  It is one of the most important security functions in a system that retrieves external data as it can (with caveats that will be elaborated upon) single-handedly stop XSS and SQL injection attacks dead in their tracks

The reason we have created this blog post is to give more information to modification developers on how to properly explain how this works and why you should use it.

Read the rest of this entry »

3.0.6 CAPTCHA plugins and you

Posted by Kellanved in Development, Moderating, Modifications, Styles, Support with the tags , , , on June 27th, 2009

You probably have already heard about it: the next release will include a host of new features. This post will present one of them in detail, showing the idea and the impact on users, style and MOD authors.

Most admins are experiencing problems with spam, which is taking away lots of energy that would be better spent on the enjoyable parts of administrating a community. We tried our best in the arms race against spambot programmers, but have to admit failure with our previous approach. Since 3.0.x became as popular as it is, any default visual confirmation gets broken almost instantly. After long discussion in and outside the teams, we came to the conclusion that diversity is the answer: every board admin should be able to use a non-default anti-bot measure without it being a pain. Read the rest of this entry »

phpBB 3.0.6 plans

Posted by Acyd Burn in Development, Modifications, Styles with the tags , , , on June 10th, 2009

Here we are. phpBB 3.0.5 got released and work on phpBB 3.0.6 began. Previously, we concentrated on fixing bugs and only introduced tiny new features. This time, phpBB 3.0.6 will be a “feature” release, packed with numerous new, cool, stunning, breath-taking… err, just new features. 😉 We will now tell you which new features are planned for 3.0.6 and what style authors and modders need to take care of.

Read the rest of this entry »