Last active
August 29, 2015 14:24
-
-
Save jacob-g/7a85de5c0ef58cbc22db to your computer and use it in GitHub Desktop.
A sample of a FutureBB hooks file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //this example requires usernames to be >= 10 characters when registering | |
$hooks = array(); | |
$hooks['review_registration'] = array( | |
function($args) { | |
global $errors; | |
if (strlen($args['username']) < 10) { | |
$errors[] = 'Your username must be >=10 characters'; | |
return false; | |
} | |
} | |
); | |
$hooks['show_captcha'] = array( | |
function($args) { | |
?> | |
<p>THIS IS A TEST DUMMY CAPTCHA</p> | |
<?php | |
} | |
); | |
$hooks['bbcode_toolbar'] = array( | |
function($args) { | |
?> | |
<p>THIS IS YOUR BBCODE TOOLBAR</p> | |
<?php | |
} | |
); | |
$hooks['new_post'] = array( | |
function($args) { | |
?> | |
<p>A NEW POST WAS POSTED!</p> | |
<?php | |
print_r($args); die; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment