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

Customizing Your vBulletin Board

The Revert button does exactly what you'd expect. It reverts the template back to original and eliminates any changes made. Use this with care, as there is no undo feature and your changes will be lost!

PHP Code Modifications

The final kind of modification that can be made to a vBulletin installation is direct modification to the underlying PHP code of the forum. There is no direct access to the PHP code from within the vBulletin, so all of this has to be done using a text editor and an FTP program to upload the file.

Words of caution

Be careful when making changes to the PHP code that lies behind your vBulletin forum—it is very easy to damage or destroy your forum if you make incorrect changes. Also, if you do have problems, don't expect to receive support, as this is not covered. (You will be advised to reload the forum software or fall back to a backup to solve the problem.) So take care!

Be careful when making changes—always make a note of the changes you make and keep backups of any files that you alter.

PayPal Modification

Let's look at making a very simple PHP modification to a vBulletin forum.

This modification revolves around the PayPal subscription system that allows paid subscriptions to a vBulletin forum. Generally, the PayPal subscription is treated as a non-shipping transaction (services only), and the address of the person subscribing isn't transmitted to the administrator when a subscription is made. Usually this is fine, but there are times when a forum subscription might include a gift or a hard copy magazine or newsletter. A simple modification to the PHP code allows PayPal to treat a subscription as a goods transaction and provides the subscriber's address to the administrator of the forum. (The subscriber can change this if they want.)

File Modification

This modification only involves one file. This is includes\functions_subscriptions.php. To begin this modification process, either download a copy of this file from the server using FTP, or go to your original installation files and retrieve a copy of it. (Remember to keep an unaltered original just in case you want to revert the changes.)

Open the file in a text editor. (Do not use Notepad, as this can have problems—instead use WordPad or another editor such as UltraEdit.) Now, in this file we scroll down to line 381. This is the line that we need to change for the modification to work. The change is simple, but effective.

108