My New Hooks: Will This Work?
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #1
My New Hooks: Will This Work?
Hi, I'll test this myself, just looking for some idea if it will work as expected.
On a 'custom' page which includes global.php:
i.e.

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

define('IN_MYBB', 1);
require_once './global.php';

// comments here....
// code here....

$plugins->run_hooks("thispage_mynewhook);

// more code here....

?>

...now will this 'new hook' be available to a MyBB plugin?
Is it really that easy, or do I need to include other file(s), and / or...
...how are new MyBB hooks created?

Thank you very much

11-17-2010 05:49 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: My New Hooks: Will This Work?
Yes, it'll work as long as you get the syntax correct.

My Blog
11-17-2010 06:14 PM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #3
RE: My New Hooks: Will This Work?
Perfect...glad to hear it, thanks ZB...
...too easy.  Biggrin
11-17-2010 06:26 PM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #4
RE: My New Hooks: Will This Work?
But look at the hook code please;

Code:
$plugins->run_hooks("thispage_mynewhook);


It should be;

Code:
$plugins->run_hooks("thispage_mynewhook");


A " is missing.


[Image: logo.png]

[Image: twitter.png]
11-18-2010 03:24 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #5
RE: My New Hooks: Will This Work?
I see that was left out, thanks.
11-19-2010 01:21 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #6
RE: My New Hooks: Will This Work?
No Problem Fire Fox Smile

[Image: logo.png]

[Image: twitter.png]
11-19-2010 01:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: