Migrating Changes

Before you upload the files to the server, stop and think for a moment. Have you carried out any changes to the core PHP files of vBulletin? (We saw how to customize a bulletin board in Chapter 4.) If you have made any changes, uploading the new files will obliterate these changes. Most people want to keep any changes they made to their vBulletin installation, and this often keeps them from carrying out upgrades.

If there is only one change, then it may be easier just to make the same change again after the upgrade. However, if there are many changes, repeating them will be much more complicated and will need a lot more time and effort, and of course, there will always be scope to get things wrong. What you want is a file compare utility that highlights the differences between two files.

In Chapter 4, we saw how to modify the PHP code so that PayPal treats a subscription as a goods transaction. We will use this example to show how a file compare utility can be used to easily migrate changes to a new version of your bulletin board.

File Compare Utilities

There are a variety of such file compare utilities available. Two of the best are UltraCompare by the makers of UltraEdit (http://www.ultracompare.com) and DiffDog by Altova (http://www.altova.com). These are both commercial applications, and they do an excellent job of comparing files and highlighting the differences.

Another option is taking the free route—an application called WinMerge is available for free from http://winmerge.sourceforge.net.

File Compare Utilities

We can now run WinMerge on both versions of the file that was hacked (includes/functions_subscriptions.php). This will highlight the differences between the two files. Some differences are to be expected while others are hacks.

In WinMerge open the two files (the new version and the old version that we hacked).

File Compare Utilities

When you open the two files, the lines that contain differences are highlighted. Also, on the left‑hand side, there is a location pane that shows a schematic of the documents and places lines in them to show where there are differences.

When a new version of vBulletin is released, not all the files will have been changed. In fact, only a few of the files will contain actual code changes. However, there will be changes in the headers and footers of all the files. In the header, the version number will have been changed, in this case from version 3.5.2 to 3.5.4. In the footer, the changes will be to the date that the package was downloaded and, if the file has been updated, to the version number.

File Compare Utilities

The only other change to the code represents that hack that we installed earlier. Migrating this hack is simply a case of using the buttons on the menu to copy the change from the left-hand window (the original file) to the right-hand window (containing the new file).

File Compare Utilities

To make this hack easier to spot in the future, you can add a comment to the code, explaining what the hack does.

File Compare Utilities

Save the file with the changes, and repeat the file compare process for any other files that have been changed.

If your forum has a lot of hacked files, you might need to go through each file and compare it with the file on the server. However, to make life easier, the vBulletin development team releases a change list detailing the files that have been changed—this makes the job of finding updated files easier.

We're now ready to move on to the next phase of the update process.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset