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

Chapter 4

Search tips

You might not always find the phrase you are looking for on your first search. The main reason for this is that the phrases can contain HTML formatting tags (such as <p> and <p/>) which form part of the phrase but you might not notice them otherwise. For example, if we had searched for the string "Forum Rules Registration to this forum is free" we wouldn't have had a match because the actual HTML is "Forum Rules</strong></p> <p>Registration to this forum is free" (as you can see in the image opposite).

The old saying is as relevant today as ever—if at first you don't succeed, try, try, and try again!

Making Changes

Now that you've found the phrase that you want, you can go about editing it. To get the ball rolling, click on the Edit button that appears next to the phrase.

95

Customizing Your vBulletin Board

This will bring up the phrase editing page allowing you to make changes to the text (shown below).

This screen contains a lot of information and features, so let's take a moment to familiarize ourselves with the information.

At the top, is the phrase description and title (shown below). This is a standard phrase (that is, it appears in the standard phrase category), and has the title forum_rules_description.

96

Chapter 4

Below that, is the variable name assigned to the phrase (see below). Here this is $vbphrase[forum_rules_description]. Knowing the variable name for a particular phrase is really useful, because it allows you to have control over which phrases are displayed. If this is placed into a vBulletin template then the text of the phrase will be shown in that location. Don't worry if this doesn't make any sense right now—it will shortly! Similarly, if you remove the phrase variable from the code, then the text is removed from the displayed page.

Finding phrases

Navigating the code by phrases can be a good way to work through the vBulletin code. If you can find a bit of text in the code, you can then search for the phrase that contains that text. Later we'll show you how to search through the templates for phrase variables.

Below this, appears the existing phrase text, as you can see in the image below. This is there as a safeguard so that you know for sure what you are editing as well as the current wording of the phrase.

Below this, comes the box that does the work—this is where we enter new text. This can be confusing for newcomers to vBulletin, because the edit box is labeled as Translations. However, this is the right way to go about editing the phrases.

You can also choose to copy the existing text into the edit box by clicking on the Copy Default Text button, which means that you don't have to bother retyping it or messing around with cut and paste.

We just want to make some small changes to the rules, so we'll copy the existing phrase by using the Copy Default Text button. The existing text is then placed in the edit box ready for editing as shown below:

Let's just make the small change to the text shown in the image below:

We can customize this a little further if you want. Take a look through the text of the phrase, and you will find the following lines:

If you would like to cancel the registration, click <a href="{1}">here</a>

97

Customizing Your vBulletin Board

and

<p>Although the administrators and moderators of {2} will attempt to

and

All messages express the views of the author, and neither the owners of {2},

and

<p>The owners of {2} reserve the right to remove,

See the instances of {1} and {2} in the phrase. If you take a look at the rules page, you will see that {1} corresponds to the URL of the forum, while {2} is the forum name, both of which are shown below:

Using these variables we can customize the addition we made to the rules.

<p>The decisions of the admin or moderators of {2} are final!</p>

We're now done making the changes to the phrase, so we click on the button marked Save at the bottom.

Viewing the Changes

Now view the change. Go to the front page of the forum as an unregistered/unsigned in member (clicking on Log Out at the top of the AdminCP screen or on the navbar will allow you to do this), and you can start the registration process and take a look at the updated phrase, which is shown below:

Undoing Changes

Be careful when making changes to phrases, as there is no automatic undo or revert feature available. The best thing to do is to keep a backup of any of the text that you change in case you change your mind and want to go back to the original wording.

98