Making the Changes

With the hack open on your desktop (in Notepad, EditPlus, or a similar text editor), start by navigating to the proper file—in this case, viewtopic.php—and following the instructions on where to insert code. The instructions are fairly straightforward. Look toward the end of the file to insert a large block of code. (For the sake of brevity, and acknowledging the changing nature of modifications, the code is not reprinted here.) After making the prescribed changes, save and close viewtopic.php.

Next, open lang_main.php, which will reside under language/lang_english for our purposes. These language lines will contain two strings used by this hack. In this instance, you're looking for a comment marked "That's All Folks" at the very end of the file. Above that, you'll insert the language lines specified in the next section of the hack. In the version of the hack available at the time of this writing, two lines are specified.

■ Note Feel free to substitute for other languages in which you have translations of phpBB. However, note that the text supplied with this particular hack is in English, so you will need to translate to your other desired language (or obtain a translation of the hack, if one is available).

Finally, open the viewtopic_body.tpl template file, which will place the form on the bottom of the View Topic page. Chapter 12 will delve into the details of working with template files, but for now, you'll be editing just this one file. If you have multiple active templates, you will need to edit the viewtopic_body.tpl file for each additional template as well, in order for the feature to be properly enabled across all templates. Look for the line {S TOPIC ADMIN}, and insert the final line specified in the hack below it. Don't worry about the meaning of these lines right now; Chapter 12 will educate you on the available template variables.

The final instruction is to save and close all files. Yes, that's right—you're finished! Upload your changes to the server, open your board, and go view a topic (while logged in, of course). With any luck, you'll have a new Figure 11-2. The expected results of addition to your View Topic page, as illus-

installing the Quick Reply hack: a trated in Figure 11-2.

Quick Reply box

If you see something reasonably close to Figure 11-2, you've successfully installed the Quick Reply hack, and congratulations are in order. Feel free to give the box a try. Chances are, you'll like it.

Be sure to back up your newly hacked files, in case you decide to go for more modifications and they don't work out. This way, you can restore from a recent point if something goes wrong, so you won't lose all your work. This is excellent practice for each modification you install. Once you know that everything is working properly, you can feel free to clean up some of these developmental backup copies. Go ahead and check out my recommendations on additional modifications (listed earlier in Table 11-1) for more phpBB hacking fun!

If you see something other than Figure 11-2, don't panic. I've got some troubleshooting ideas for you.

Was this article helpful?

0 0

Post a comment