MyBB Community Forums

Full Version: Integrating MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I want to integrate MyBB with my website, so registered users can post in my website (chat, guestbook, games,) I found this tutorial and it was very helpful and works for me:

http://iwaha.com/wiki/?b=2&p=3&cat=2

BUT, Now I want to access custom fields in db. I added custom fields like Country, Sex (m/f). So I can display content related to these fields. The programmer of Mybb used loop to read created custom fields!!

Any help.
Thanks.
A simple DB-query should do it...

$query = "SELECT fid1 FROM ".TABLE_PREFIX."userfields WHERE ufid = '".$youruserid."';";
$query_1 = $db->query($query);
while($results = $db->fetch_array($query_1))
	{
	$location = $results[fid1];
	}
Thanks "Lennart Sauter" . I will try it a.s.a.p.

Regards.
You are welcome webstar Smile
Hello,

Is there direct way like above tutorial like loading id by $mybb->user['uid'];
DB-query requires db access permision and I don't want to accsess Mybb db from my website.
MyBB has always DB connection.
You can run the query above with a simple include of global.php
Hello,

Thanks "Lennart Sauter", it works.