Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Forums With vBulletin (2006).pdf
Скачиваний:
40
Добавлен:
17.08.2013
Размер:
6.3 Mб
Скачать

Upgrading vBulletin

This has two advantages:

It spreads the word about updates quickly and easily.

It encourages people to upgrade licenses!

Clicking on the link takes you to the members' download area. (You will need your customer number and password to access this area.) From there, you'll be able to download the latest vBulletin installation package (in the form of a compressed Zip file about 1.5Mb in size).

Preparing for Upgrade

Before you upgrade anything, you need to backup your database with the data for the forum. We saw how to do this in Chapter 5.

As well as a database backup, make an up-to-date copy of the files on the server—preferably a full server backup of all files and folders, just in case something goes wrong or you upload the files to the wrong location and overwrite non-vBulletin files.

Backup motto

It's better to have made a backup and not need it than not to have made one and find that you do!

The next stage is to extract the files from the compressed archive that you downloaded. Extract them to a separate folder on your system.

Once you have done this, locate the folder called upload, and rename it to match the name of the existing vBulletin folder on your server (in our case vb).

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

140

Chapter 6

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.

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.

141

Upgrading vBulletin

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

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.

142

Chapter 6

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).

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

143