/**
 * Profile guestbook hook for phpBB.
 *
 * @author Paul Sohier <*****@*****.**>
 * @param phpbb_hook $hook
 * @return void
 */
function hook_profile_guestbook(&$hook)
{
    global $template, $user;
    // Make sure we only run this hook once, else we get the most weird errors :).
    if (defined('HOOK_RUNNED')) {
        return;
    }
    define('HOOK_RUNNED', true);
    global $phpbb_root_path, $phpEx;
    if (!class_exists('guestbook')) {
        include "{$phpbb_root_path}includes/class_guestbook.{$phpEx}";
    }
    if (!defined('GUESTBOOK_TABLE')) {
        include "{$phpbb_root_path}includes/constants_guestbook.{$phpEx}";
    }
    $gb = new guestbook();
    $gb->run();
}