Hello,
i’m new with phpVMS and have problems with the automated forum registration in phpbb3.
i have the event registered but problems with this script here :
<?php
class ForumRegister extends CodonModule
{
public function __construct()
{
CodonEvent::addListener(‘ForumRegister’);
}
public function EventListener($eventinfo)
{
if($eventinfo[0] == ‘registration_complete’)
{
echo “include_path:::”.$include_path;
define(‘IN_PHPBB’, true);
$phpbb_root_path = ‘core/modules/forum/’; // Your path here
$phpEx = substr(strrchr(__FILE__, ‘.’), 1);
include($phpbb_root_path . ‘common.php’);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
require($phpbb_root_path .‘includes/functions_user.php’);
$username = ‘test1’;
$password = ‘test1’; // Do NOT encrypt !
$email = ‘[email protected]’; // Please validate this email yourself ! Phpbb will accept non-valid emails.
// Do a check if username is allready there, same for email, otherwhise a nasty error will occur
$user_row = array(
‘username’ => $username,
‘user_password’ => md5($password), ‘user_email’ => $email,
‘group_id’ => 2, #Registered users group
‘user_timezone’ => ‘1.00’,
‘user_dst’ => 0,
‘user_lang’ => ‘en’,
‘user_type’ => ‘0’,
‘user_actkey’ => ‘’,
‘user_dateformat’ => ‘d M Y H:i’,
‘user_style’ => 1,
‘user_regdate’ => time(),
);
$phpbb_user_id = user_add($user_row);
echo "New user id = ".$phpbb_user_id;
}
}
}
?>
i become errors from php “cannot redeclare template”
Can anyone help here ?
Matthias