* User Info

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

* Recent Posts

Re: Migration to SMFNew by SMFNew
[October 31, 2019, 08:42:32 am]


Re: Migration to SMFNew by Phil Harvey
[October 31, 2019, 08:09:38 am]


Re: Migration to SMFNew by SMFNew
[October 30, 2019, 09:32:04 pm]


Re: Migration to SMFNew by Phil Harvey
[October 30, 2019, 02:32:17 pm]


Re: Migration to SMFNew by SMFNew
[October 30, 2019, 01:09:30 pm]


Re: Migration to SMFNew by Phil Harvey
[October 30, 2019, 01:05:34 pm]


Re: Migration to SMFNew by SMFNew
[October 30, 2019, 01:01:30 pm]


Re: Migration to SMFNew by Phil Harvey
[October 30, 2019, 12:56:28 pm]


Re: Migration to SMFNew by SMFNew
[October 30, 2019, 12:31:31 pm]


Re: Migration to SMFNew by Phil Harvey
[October 30, 2019, 12:02:27 pm]

* 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 3265 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