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

Changing the Look of vBulletin

Making the New Style into the Default

OK, you've created a new style, and you want to make it available as the default. How do you do this? Easy! You may have noticed some checkboxes at the top left of the Style Manager window.

The style currently in use is checked. To change the style in use, just swap the check marks around, and click on the button marked Save Display Order.

The new style will now be available, and the old style won't be available. If you want to make both styles available, check both options and click on Save Display Order.

This will now make both styles available to the users of the board, and they can choose which one they want to use.

Distributing a Style

You've made a great style, and you think that others might like to use it. You can choose to make it available for free, or you could decide to sell it. (Remember though that selling a style usually means having to provide the buyer with installation support.)

164

Chapter 7

But how do you package it?

A style consists of the following elements:

An XML file containing the changes

All the custom images that go with it

To create a distribution package for a style, first take the custom XML file that you created and place it in a folder. (Call the folder the same name as the style.)

Then, download all the folders that contain custom images for the style from the web server. Make sure that you get the folders and the images. So, for our earlier example, we'd need to download the following folders:

images/custom/buttons

images/custom/statusicon

images/custom/attach

images/custom/misc

images/custom/editor

images/custom/polls

images/custom/rating

images/custom/reputation

Place these folders and their contents into the folder containing the XML file and you're done. You can package up the whole thing into a zip file for convenience if you want—it also helps to keep all the files together in one place.

Installing a New Style

Installing a new style is simple. Follow these simple steps:

First, find the style that you want to use.

If the style has been packaged, extract the contents of the zip file.

Upload the folders containing images into the images folder on the web server. Do not upload the XML file.

Next, click on Styles & Templates in the left-hand menu, and then click on

Download/Upload Styles.

This takes you to the interface that you saw earlier when downloading the XML file. This time, we're interested in uploading it.

165

Changing the Look of vBulletin

Click on the Browse… button, and go in search of the XML file.

Make sure that (Create New Style) is selected in the Merge Into Style drop-down box.

Scroll to the bottom of the page and click on Import.

The import process will run and import the style into vBulletin.

And that's all there is to it!

Summary

In this chapter we've looked at how to style a vBulletin installation. If you're like most people, this is something you're likely to want to take your time over and work on to get right. It's a good idea not to rush things and to work methodically, checking often that the changes result in the look that you expect.

Also, remember to save regularly and make regular backups—don't rely on the web host to do this for you. If you've spent time making modifications and changes. then take the time to keep them safe!

Finally, you might also want to consider making your style available to others—this is both quick and simple with vBulletin.

Happy styling!

166

8

Developing a Hack

In this chapter we'll be looking at how you go about developing a hack for a vBulletin installation. Being based on the PHP language and on MySQL database infrastructure makes vBulletin very versatile, so we're going to have to limit our scope. Almost anything that you would want to do with vBulletin is possible if you know how to leverage PHP and MySQL!

In particular we will look at:

How to hack a discussion board by changing one of the template files

How to distribute a hack by giving other programmers clear instructions about the code changes

Hacking vBulletin

Let's take a look at how to create a vBulletin hack. The hack we're going to be developing here is one that allows you to control how vBulletin handles private message receipts. As we saw in Chapter 3, private messages, known as PMs, are messages that one member can send to another member of the board.

Developing a Hack

The member types a message into the private message window and then clicks on the

Submit Message button.

The recipient can collect the message the next time they log in (or, if they are already logged in, the next time they request a new page from the board).

But there's one feature that seems to annoy some members (especially if it's a popular board where the members make a lot of use of the PM facility). This is the read receipt feature. When a PM is submitted, a message box is displayed asking the sender whether they want to request a read receipt.

Read receipts are a useful feature, but the problem is the message box displayed—people find it gets in the way and often they won't want to send a read receipt with every message. You as the administrator can do something about this—you can hack your vBulletin installation to give your members greater control over how read receipts are handled.

You have the power …

… to disable private messaging read receipts altogether. In the left-hand menu in the AdminCP, click on Usergroups followed by Usergroup Manager. Then for each usergroup you don't want to have this feature, click on Edit Usergroup and set

Can Use Message Tracking and Can Deny Private Message Read Receipt Request to No. Doing this, however, will remove the ability for members to request a read receipt. It would be much better to simply change how the request works.

168