3. Even more complex hook - installing XML file, uploading some file(s) through FTP client and editing some of your website file(s)
The hook, we worked on, in my previous post, Display Members Browser is also an example for the above type of hook.\
You need to install XML file, you need to upload some files into your site and you also need to edit some of your board files.
In this section, we'll talk about editing board files.
This operation is not complicated, but you have to be very careful, not to make any mistakes resulting in messing up your board files.
I strongly recommend, you back up any file BEFORE you make any modifications.
Backing up is easy.
Connect to your website through FTP client.
Select your board file, you want to work on, thus you want to back up, select some folder on your computer and click on
upper green arrow.
You're done and now, you can play with editing.
Beside FTP client, which you already have, you'll need some text editor.
Notepad will do, but I prefer and I use
Notepad++:
http://notepad-plus....net/uk/site.htm, which displays text better and has numbered lines (often very helpful).
Below is a screenshot from
Display Members Browser hook installation instructions:
Hook instructions tell you to edit
boards.php file, located in
admin/applications/forums/modules_public/forums
Using your FTP client, navigate to that file:
Right click on
boards.php file and , if you already have your text editor associated with
.php files, click
Open.
If you don't have any program associated with
.php files, instead of
Open, click on
Open with and navigate to your text editor (Notepad, Notepad++...) to associate
.php files with the editor.
When you open boards.php file, you'll see, it's nothing more, but a text file:
Now, let's look again at the first step of hook installation instructions:
With
boards.php file open in Notepad++, click on
Search, then
Find... and paste:
member_group, uagent_type
Click
Find Next button.
You'll see found text highlighted:
All, you need to do is to add following text after the above:
, uagent_key
so the initial string looks like this:
When done with all editing of the above file, simply click
File>Save and you're done.
Easy enough?
I hope so.
Just be careful and you should be able to follow any hook installation instructions and edit any necessary file.
This should complete hook installation section.
Good luck