* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Recent Posts

Re: package manager by Jacob
[March 15, 2020, 09:52:22 pm]


Re: How can i create a mysql database by Jacob
[March 15, 2020, 09:49:47 pm]


Re: package manager by SMFNew
[March 15, 2020, 07:42:01 pm]


package manager by dofferz
[March 15, 2020, 03:12:36 pm]


Re: How can i create a mysql database by SMFNew
[March 15, 2020, 11:37:10 am]


Re: How can i create a mysql database by AbilayHan
[March 15, 2020, 11:34:13 am]


Re: How can i create a mysql database by SMFNew
[March 15, 2020, 11:31:02 am]


How can i create a mysql database by AbilayHan
[March 15, 2020, 11:30:29 am]


SSL Cheaper option now for custom domain users! by SMFNew
[February 26, 2020, 11:17:04 pm]


Re: I need help by Jacob
[February 22, 2020, 03:42:41 am]

* Poll

  • Have you noticed better loading times?
  • Dot YES! My forum loads instantly!
  • 53 (33%)
  • Dot I have much better loading times
  • 20 (12%)
  • Dot I have noticed my forum loads a tiny bit faster than before
  • 22 (13%)
  • Dot I have not noticed any changes
  • 64 (40%)
  • Total Members Voted: 150
  • View Topic

* Twitter

Keep up to date with SMFNew by following us on twitter!

Author Topic: Integrating MyBB into your website. (Login Form)  (Read 3280 times)

0 Members and 1 Guest are viewing this topic.

Offline Kamran Saleem

  • Member
  • Posts: 28
  • Reputation: +0/-0
    • View Profile
Integrating MyBB into your website. (Login Form)
« on: April 27, 2009, 02:49:18 am »
Integrating MyBB into your website. (Login Form)
Hmmm... Let me guess.
You need to integrate your forum within your website?
Well, you came to the right place.

What you need
1. Basic Knowledge In HTML.
2. Basic Knowledge In PHP.
3. MyBB (Duh).
4. A website to integrate it with.

How To
First, Before ANYTHING, even the "" or "
Code: [Select]
<?php
chdir
('forums'); // path to MyBB
define(&quot;IN_MYBB&quot;, 1);
require 
'./global.php';
?>


Then, place this where you want the login form/welcome message to appear.
Code: [Select]

if($mybb->user['uid'])
{
��// The user is logged in, say Hi
echo "Hey, $mybbuser[username].

Thanks for logging in.";
}
else
{
��// The user is not logged in, Display the form
echo "
Username:

Password:



";
}
?>


Where 'index.php' from line 17 (or close):
Code: [Select]


Should be replaced with where you want to redirect after the login.

And Where 'forums/member.php' from line 12 (or close):
Code: [Select]


Is the Path to your forum's member.php. Generally "forums/member.php".

If you need to add anything under on line 7 (or close):
Code: [Select]
echo "Hey, $mybbuser[username].

Thanks for logging in.";


Make it like:
Code: [Select]
echo "Hey, $mybbuser[username].

Thanks for logging in.
Your text here.";


To Add a link, do not use.
Code: [Select]
Link
But
Code: [Select]
Link

In other words, Do NOT use double quotes inside
Code: [Select]
echo ""

Use 's instead of "s.

Also, save the file (Which has the login form) as "something.php" and not "something.html" or "something.htm".

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal