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.
- 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.
- 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
- These are the files you edit. Edit them now.
- Upload the edited files to your phpBB's web server.
- Test the hack.
- 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.
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)