[eluser]masterix[/eluser]
Hi!
I have following class to integrate my site with forums:
Code:
<?PHP
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Integration
{
private $userdata;
public function __construct()
{
global $db, $board_config, $phpbb_root_path, $phpEx;
DEFINE( 'IN_PHPBB', TRUE );
$phpbb_root_path = 'forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php' ) ;//.$phpEx);
if ( !defined( 'IN_PHPBB' ) )
{
die( "Hacking attempt!" );
}
$userdata_tmp = session_pagestart( $user_ip, PAGE_INDEX );
init_userprefs( $userdata_tmp );
$this -> userdata = $userdata_tmp;
// print_r( $this -> userdata );
}
public function get( $key )
{
if ( array_key_exists( $key, $this -> userdata ) )
return $this -> userdata[$key];
else
return false;
//return $this -> userdata;
}
public function is_logged()
{
return $this -> userdata['session_logged_in'];
}
}
?>
This class is in libraries folder and autoloaded by CI.But unfortunately I get some errors like:
Quote:A PHP Error was encountered
Severity: Warning
Message: array_merge() [function.array-merge]: Argument #1 is not an array
Filename: forum/common.php
Line Number: 78
I know that CI removes superglobal arrays but I'm pretty sure that it worked few months ago. This line in common.php merges arrays $HTTP_POST_VARS and so on.The controller is very simple:
Code:
<?PHP
class Test extends Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
if( $this -> integration -> is_logged() ) echo ":)";
else echo ":/";
}
}
?>
Forum script was modified ( some mods were included ) but I think it isn't the issue.
Thanks in advance for every tip