Skip to content

Instantly share code, notes, and snippets.

@jacob-g
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacob-g/7a85de5c0ef58cbc22db to your computer and use it in GitHub Desktop.
Save jacob-g/7a85de5c0ef58cbc22db to your computer and use it in GitHub Desktop.
A sample of a FutureBB hooks file
<?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