* User Info

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

* Recent Posts

Re: What are you listening to? by Stelios
[July 16, 2023, 08:54:53 am]


Re: What are you listening to? by Stelios
[July 16, 2023, 08:52:34 am]


Re: What are you listening to? by Jacob
[July 12, 2023, 01:59:53 am]


Re: What are you listening to? by Dagger
[July 06, 2023, 04:11:15 pm]


Re: Cannot Register on Support Forum by Jacob
[June 01, 2023, 01:09:08 am]


Re: Cannot Register on Support Forum by SMFNew
[May 21, 2023, 10:22:14 am]


Cannot Register on Support Forum by Stelios
[May 21, 2023, 06:45:30 am]


Re: Forum Profile Signature Error by SMFNew
[January 19, 2023, 10:26:49 pm]


Re: Forum Profile Signature Error by MangoMochi
[January 19, 2023, 10:24:45 pm]


Re: Forum Profile Signature Error by SMFNew
[January 19, 2023, 01:57:05 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 4430 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-2024, SimplePortal