Jump to content


IPB 3 - How to install hooks....


  • This topic is locked This topic is locked
3 replies to this topic

#1 Broni

    Malware Annihilator

  • 24,344 posts
  • Joined: October 04, 2004
  • 1,748 topics
  • Age: 57
  • Skin: IPBoard wide
  • Local time: 12:00 PM
  • Zodiac:Virgo
  • Gender:Male
  • Location:Daly City, CA
  • OS:Windows Vista
  • Country:
Online
  • Time Online: 40d 21h 57m 14s

Posted 23 September 2009 - 05:09 AM

Hooks come in three flavors...


1. Simple hook - installing XML file

Sort Poll is an example of a simple hook:

Posted Image

Hook's folder contains just 4 files: couple of screenshots of the hook in action, XML file, which needs to be installed and installation instructions.

To install hook like this:
1. Login to Administrative Control Panel (ACP).
2. Under System tab, click on Manage Hooks:

Posted Image

3. On the next page, scroll all the way down:

Posted Image
4. Click on Browse button, navigate to .XML file location.
5. Click on Install button.

Note. The hook will be installed on all skins, so, if you have number of them, it'll take couple of minutes.

Refresh your site page and the hook should be working.

#2 Broni Re: IPB 3 - How to install hooks....

    Malware Annihilator

  • 24,344 posts
  • Joined: October 04, 2004
  • 1,748 topics
  • Age: 57
  • Skin: IPBoard wide
  • Local time: 12:00 PM
  • Zodiac:Virgo
  • Gender:Male
  • Location:Daly City, CA
  • OS:Windows Vista
  • Country:
Online
  • Time Online: 40d 21h 57m 14s

Posted 04 October 2009 - 09:16 PM

2. More complex hook - installing XML file and uploading some file(s) to your site through FTP client

Which one goes first, you'll have to find out in hook installation instructions.
Installing XML file was described in my previous post, so now, I'll tell you how to upload necessary files.

For that matter, you'll have to obtain some FTP client. There are plenty of free ones out there, but I'd recommend two of them.
One is a Firefox add-on, FireFTP: http://fireftp.mozdev.org/ (this is what I use and all examples will come from it)
Another one is a standalone program, FileZilla: http://filezilla-project.org/
They both have very similar interface.

After opening FireFTP, first, you need to create your account:

Posted Image

Fill out the form:

Posted Image

...and click OK.

IMPORTANT!Login and password are NOT the same as you use to login to your ACP.

You have to acquire them from your host.
If Invision is your host login to "Client area", click on "Purchases" then on your package and you'll find FTP login and password there.

Once you're done, click on Connect button and you'll get connected to your web site files:

Posted Image

In the middle, you can see two green arrows, which serve the purpose of moving files between your computer and your website, back and forth.
Moving always means copy-paste action (not cut-paste), which means, moved file is NOT deleted from its original location.
Both panes work exactly like Windows Explorer.


Now, onto uploading files, needed for some hooks to work.

In this example, we'll work with Display Members Browser hook:

Posted Image

As you can see, this hook is made of already desribed instructions file (ReadMe.html), and XML file (instalable through ACP).
The new part is upload folder. Actually, this hook contains two subfolders, which have to be uploaded: admin and public
In hooks case, we'll always be dealing with some parts of public_html folder of your website:

Posted Image

Let's see what we have to upload.
For easier references, I'll call left pane, C (computer) and right pane, W (website)
Let's start with admin subfolder.
Click on it to see what's inside. At the same time, expand
public_html folder (W) and then click on admin folder to see what's inside:

Posted Image

There are no files in hook's admin folder, just another sub-folder, sources, so we have to expand that sub-folder to see what's inside:

Posted Image

We find another sub-folder, classes. Still, no files. We have to go one more step and see what's inside classes folder:

Posted Image

Another sub-folder, useragents. What's inside?

Posted Image

Aha! Finally, we have a file to upload, tbDisplayMembersBrowser.php

Now, you have to repeat very same sequence of folder opening, on your site:

Posted Image

By now, your window should look like this:

Posted Image

Now, the most important part, file moving.
Click on tbDisplayMembersBrowser.php file, so FirFTP knows, which file to copy, click once on useragents folder on W side, so FireFTP knows where to copy the file and finally, click on lower green arrow to copy the file from your computer to your website.
Lastly, check, if tbDisplayMembersBrowser.php file is present in useragents folder:

Posted Image

Now, perform very similar action with public sub-folder of upload folder and you'll be done in no time.

#3 Broni Re: IPB 3 - How to install hooks....

    Malware Annihilator

  • 24,344 posts
  • Joined: October 04, 2004
  • 1,748 topics
  • Age: 57
  • Skin: IPBoard wide
  • Local time: 12:00 PM
  • Zodiac:Virgo
  • Gender:Male
  • Location:Daly City, CA
  • OS:Windows Vista
  • Country:
Online
  • Time Online: 40d 21h 57m 14s

Posted 06 October 2009 - 04:52 AM

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:

Posted Image

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:

Posted Image

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:

Posted Image

Now, let's look again at the first step of hook installation instructions:

Posted Image

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:

Posted Image

All, you need to do is to add following text after the above:

, uagent_key

so the initial string looks like this:

Posted Image

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 :fat_face_smiling:

#4 Broni Re: IPB 3 - How to install hooks....

    Malware Annihilator

  • 24,344 posts
  • Joined: October 04, 2004
  • 1,748 topics
  • Age: 57
  • Skin: IPBoard wide
  • Local time: 12:00 PM
  • Zodiac:Virgo
  • Gender:Male
  • Location:Daly City, CA
  • OS:Windows Vista
  • Country:
Online
  • Time Online: 40d 21h 57m 14s

Posted 13 October 2009 - 09:41 PM

bump





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


This topic has been visited by 16 user(s)