Community management insight at ManagingCommunities.com

Bookmark and Share

Strategy for Hacking Your phpBB

Strategy for Hacking Your phpBB

Postby JohnMcK » November 13th 2003, 4:59 pm

phpBB uses quite a few files in order to generate your forums. These files consist of many thousands of lines of code. When you install hacks, you are often required to make a number of edits to several different files. PHP is a powerful language but it is also highly symbolic, meaning that it relies heavily on symbols such as { or } or ;.

All of these facts amount to a very convincing argument to develop a planned approach to hacking your phpBB. It is very easy for even a seasoned programmer to make a seemingly innocuous error that brings down the forum. The seasoned programmer, of course, is experienced in de-bugging these sorts of problems. To those just starting out, these errors can be quite frustrating.

A simple strategy for installing hacks that takes just a couple of minutes of preparation time is really all that's necessary to protect your hard work and help keep this enjoyable for you. By following these simple steps, no matter what happens you will always be able to return your forums to a fully functional condition.

The phpBB Files

First of all, start with making sure you have a current copy, on your local computer, of all the files that make up your board. This copy should duplicate exactly, the folder structure used by phpBB on your server.

Install one hack at a time and fully test it before continuing with other hacks. Otherwise, tracking down a problem can be rather confusing.

These steps should be followed for each hack you install.

  1. Start by zipping up that current copy of your phpBB files. You may want to keep several copies so I suggest naming them in a way which will allow you to easily find the one you are looking for. Using this naming scheme: phpbb_YEAR_MONTH_DAY.zip (example: phpbb_2003_03_31.zip) ensures that the file names will always sort in order and you will easily know which one was the latest.
  2. When ready to install a hack, using the files stored on your local machine, make another copy of just the files to be edited for this hack. You may find it helpful to again duplicate the folder structure; this will make it simpler to upload the files to their proper location. For example, if you were installing my "External Forum Redirect Hack" (version 1), you would need to edit 6 files. So, you would create a file/folder structure something like this on your local computer:
    Code: Select all
    My Documents
      - My_phpBB_root
              FILE: index.php
        - admin 
    	      FILE: admin_forums.php
        - language
    	  - lang_english
    	      FILE: lang_admin.php
              FILE: lang_main.php
        - templates_folder
    	      FILE: subSilver.cfg
    	  - admin
    	      FILE: forum_edit_body.tpl
    
  3. These are the files you edit. Edit them now.
  4. Upload the edited files to your phpBB's web server.
  5. Test the hack.
  6. If the hack was successful and you are happy with it, replace the local copy of the files with the newly edited ones so that your local version matches the web version. If the hack was unsuccessful, correct the local copy of the edited files and upload them again for testing. If you decide to uninstall the hack, either temporarily while you fix it or permanently, you can upload the unedited copies from your local computer.


Now, no matter what happens, you have copies of the files from the previous version of your forums, which you know work well. There's no risk to losing all of your hard work and so, there should be no hesitation tackling that next big hack you want.

The purpose of zipping the files before each hack, is to enable you to "roll-back" your phpBB several steps. This is just a little added protection. If you install several hacks and later decide you don't like the way they work together, you can easily go back several steps and try other hacks. You don't have to keep every version of the zip files, but keeping at least 3 or 4 may come in handy.

The Database

Many hacks require changes to the database, others do not. Certainly for all those hacks that alter the database, making a complete backup of the database before altering it is a good idea. You could also take the additional step of backing up your database before installing any hack. (This is in addition to routine backups.)

Do not rely on the built-in database backup / restore feature of phpBB. It is far safer to make your own backups. There are any number of ways of doing this, but specifics are beyond the scope of this article. If you access your web site with CPanel or a similar tool, these applications generally include a backup function. If you have phpMyAdmin (or a similar tool), you can make database back-ups using it. Failing those, you should contact your host to determine what backup options you have.

John McKernan (JohnMcK)
Retired phpBBHacks.com Support Team Member
User avatar
JohnMcK
Dedicated User
 
Posts: 3868
Joined: April 7th 2003, 4:34 pm
Location: Quakertown, PA

Return to phpBB 2: Customizing Your phpBB

Who is online

Users browsing this forum: No registered users and 0 guests