MyBB Community Forums

Full Version: Intergrating MyBB login with personal website
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello again everyone! I hope everyone day is going great for them, anyway onto my question.

Is it possible to have a MyBB login in my personal website? I don't really like wordpress as I like to be able to code my html and CSS directly. Adding menu's and links where I want them.

(See here: http://mantispmsllc.no-ip.org)

As you can see anything you see on the page is coded in by me and thats the way I like it. So is there some coding that can be added? Do I need a database setup? Any help is most appretiated. Thanks a bunch in advance guys!

(2013-02-25, 05:13 AM)IT Guy Wrote: [ -> ]Hello again everyone! I hope everyone day is going great for them, anyway onto my question.

Is it possible to have a MyBB login in my personal website? I don't really like wordpress as I like to be able to code my html and CSS directly. Adding menu's and links where I want them.

(See here: http://mantispmsllc.no-ip.org)

As you can see anything you see on the page is coded in by me and thats the way I like it. So is there some coding that can be added? Do I need a database setup? Any help is most appretiated. Thanks a bunch in advance guys!

hmm 34k views no reply? Perhaps this is not possible to do?

Or would this be copyright to have MyBB login code on my website?
Yes it is I dont know where to start the mybb session, But to echo A users Logged In Username.

You would create a file in the mybb root and add the following.

require "global.php";
//we need to add the global function to use $mybb
global $mybb;

$mybb_username = $mybb->user['username'];
echo($mybb_username);



You dont need to add $mybb_username= it makes it easier when writting.

Hope this helped
Also I was tired when writting this as it is late here so report if theres any mistakes and I fix asap. But there shouldnt be.

Im not sure about starting sessions.
Thank you very much, no need to strain yourself for my simple troubles! I will try this and report back with an update. Talk to you soon.

(2013-02-25, 12:54 PM)Spudster Wrote: [ -> ]Yes it is I dont know where to start the mybb session, But to echo A users Logged In Username.

You would create a file in the mybb root and add the following.

require "global.php";
//we need to add the global function to use $mybb
global $mybb;

$mybb_username = $mybb->user['username'];
echo($mybb_username);



You dont need to add $mybb_username= it makes it easier when writting.

Hope this helped
Also I was tired when writting this as it is late here so report if theres any mistakes and I fix asap. But there shouldnt be.

Im not sure about starting sessions.

I put that coding into my website html coding. But nothing happened? Perhaps im doing it wrong?
I believe you need to be experienced in PHP and SQL to do this.
Note that that code snipet it PHP code which doesn't run/work in HTML files. Unless your website uses PHP or you know how to implement it you won't be able to do what you are looking for.
Is it a login box to login to your MyBB account then that is possible using HTML?

Edit: Ninga'd - Should make sure someone hasn't posted when I have had a thread open for so long. Blush
(2013-02-25, 04:30 PM)ElectricShock Wrote: [ -> ]I believe you need to be experienced in PHP and SQL to do this.

1.) This is the 21st century "Experience" is a youtube click away.
2.) Im willing to bet I know more coding languages then you. Please do not post useless information just to rack up a post count.

(2013-02-25, 04:40 PM)JordanMussi Wrote: [ -> ]Note that that code snipet it PHP code which doesn't run/work in HTML files. Unless your website uses PHP or you know how to implement it you won't be able to do what you are looking for.
Is it a login box to login to your MyBB account then that is possible using HTML?

Edit: Ninga'd - Should make sure someone hasn't posted when I have had a thread open for so long. Blush

Yes thank you that is what i said and posted -.- Im looking for the code so I can call on it from the HTML code. Another document will be made SOMETHING.php. The code will be entered and then called on from my HTML pages.

I know what im doing, I just need the right parts of code to do this. The one given to me is such a small piece there has to be more to it.
(2013-02-25, 12:54 PM)Spudster Wrote: [ -> ]
require "global.php";
//we need to add the global function to use $mybb
global $mybb;

$mybb_username = $mybb->user['username'];
echo($mybb_username);



echo is not a function, the parenthesis are not needed. In addition, there is one unnecessary line of code and global is only required inside functions. It is instansiated in global.php. A better way of doing it would be like so:

require_once "global.php";

echo $mybb->user['username'];

Smile


IT Guy, would this be in the same directory as MyBB, or external to it?

ie, if you had MyBB located at www.example.com/forums, would you want it to be in the forums directory or, for example, in www.example.com/website?
(2013-02-26, 03:09 AM)Seabody Wrote: [ -> ]
(2013-02-25, 12:54 PM)Spudster Wrote: [ -> ]
require "global.php";
//we need to add the global function to use $mybb
global $mybb;

$mybb_username = $mybb->user['username'];
echo($mybb_username);



echo is not a function, the parenthesis are not needed. In addition, there is one unnecessary line of code and global is only required inside functions. It is instansiated in global.php. A better way of doing it would be like so:

require_once "global.php";

echo $mybb->user['username'];

Smile


IT Guy, would this be in the same directory as MyBB, or external to it?

ie, if you had MyBB located at www.example.com/forums, would you want it to be in the forums directory or, for example, in www.example.com/website?

The MyBB forums are hosted from Xampp, in order for a user to get to them they must go to http://mantispmsllc.no-ip.org and use the "Forums Tab" Which redirects them to the MyBB forums being hosted.

I hope that answers your question as I'm not sure what the difference is between www.example.com/forums and www.example.com/website besides spelling and the place it takes someone.

For the PHP coding if it is not a function then how do I add it to my personal website? For instance the main page of the website has two files, the html file and the CSS file. I have no php files for the personal website. Would this file need to be made? If so then what.

- Thanks for all your help.
Okay, so MyBB is in a directory called mybb, and the login should be on the main site at mantispmsllc.no-ip.org?

You need something like this: http://phpdave.com/MyBBIntegrator/ . Smile It should be fairly straightforward.
(2013-02-28, 03:44 AM)Seabody Wrote: [ -> ]Okay, so MyBB is in a directory called mybb, and the login should be on the main site at mantispmsllc.no-ip.org?

You need something like this: http://phpdave.com/MyBBIntegrator/ . Smile It should be fairly straightforward.

Once again thank you very much for your help. I have +ed your posts here. In the unfortunate event something does not work I will let you know.

To the rest who helped thank you all for your efforts in aiding me.