Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-06-19 00:14:06
- ahlt
- New Member
- Registered: 2008-06-19
- Posts: 5
Getting user values from phpBB3
Hi, I’am developing a plugin which will allow you to display your profile information if you are logged in to phpBB3. The plugin should supply a tag with the following information: username, avatar, inbox messages and logout link.
So I’ve asked around on the phpBB forum for assistance on this, and do now have a script which can gain access to the $user variabel used by phpBB. The problem is however, when I try to include the script in my plugin file, I get the following error:
Fatal error: Call to a member function sql_query() on a non-object in /var/www/path/forum/includes/cache.php on line 51
After talking to some guys over at the phpBB forum, the source of the problem was found, and I quote:
“This usually happens when you use the same variable as phpBB for different things. In this case, something has probably overwritten phpBB’s $db variable so it is no longer a database object. The only way to fix this kind of thing is to rename variables.”
My question to you is then, how do I work around this? It seems that Textpattern is using the same variable name as phpBB in this case.
My post over at the phpBB forum can be found here.
Offline
Re: Getting user values from phpBB3
Textpattern’s global database variable is $DB
, not $db
. Renaming variables in the core would not be smart – just do your own query with mysql_query.
Offline
Re: Getting user values from phpBB3
HI, i have already try to integrate txp with phpbb.
I’ve incountred your same problem.
I’ve think to rewrite all cade necessary for obtain the same $user value.
If you need help, or you want to cooperate to made this plugin…. say me.
Offline
#4 2008-06-19 12:03:31
- ahlt
- New Member
- Registered: 2008-06-19
- Posts: 5
Re: Getting user values from phpBB3
Hi MarcoK. I actually found a solution for this. You need to define some global variables, here’s an example function which will give you the $user object: http://pastebin.com/m6af14434
Offline
Re: Getting user values from phpBB3
sorry. but the id is expired. I have seen your message only now
Offline
#6 2009-04-30 09:43:50
- divan
- New Member
- From: Ukraine
- Registered: 2009-04-30
- Posts: 7
Re: Getting user values from phpBB3
Any progress on this? I look for the same thing.
Offline