Page 1 of 1

mySQL and phpBB

Posted: Thu Mar 16, 2006 8:22 am
by Kain Elderan
Hi all,

I'm rather new here but I glanced around abit and couldn't find any answers to my questions so here goes.

I currently have a phpBB forum setup on my website. Dunno if anyone here is very familiar with this forum software or not, it uses mySQL. Anyways, I have been learning some PHP and mySQL lately but I'd still consider myself a newbie to it. I need some help on a project I'm working on if possible.

My project is basically building a mySQL database for tracking of group assets in an online game I play, as well as doing calculations and such. I've managed to get some stuff working, as you can see here. Don't mind the errors at the top, that was a user login interface I tried out but don't really care for.

Now what I am trying to do is integrate this database into my phpBB forum database, so that I can give people access to the pages based off their forum access (basically make certain pages only available to our memebers). I have already imported the seperate database into my phpBB database, but I'm unsure where to go from here. Looking over the phpBB database through phpMyAdmin, I was thinking it would probably be best to use the user's rank, which is found in the "phpbb_users" table, under "user_rank".

My question though is where to go from here? I need to build something to query the users rank based off their login, then allow them access via that. If anyone that knows phpBB could assist me I'd greatly appreciate it. I posted in the phpBB forums but haven't really received much assistance there. Thanks.

Posted: Thu Mar 16, 2006 8:35 am
by feyd
user_rank is probably not the best field to work against as the rank can be custom set. I'd use the user group table instead. In order to link the user against their group(s), you'll need a join. See what you can figure out on your own for a bit, and post back if you have further questions. It may be best to have some code or an SQL queries you've tried so we can nudge you in the right directions.

Posted: Thu Mar 16, 2006 10:50 pm
by Kain Elderan
Is there a variable already assigned to the user once the are logged in? The problem I'm having is figuring out how to do a query against the user that is currently logged in, to check their group. If I can get past that then I can make some progress.

Posted: Thu Mar 16, 2006 10:56 pm
by feyd
In phpBB $userdata is filled with some user specific information, however authorization and authentication is run through a separate system (I think the function they call is getAuth() or auth() something like that.