Simple Machines Community Forum

General Community => Scripting Help => Topic started by: SmartRoss on April 20, 2008, 06:31:16 AM

Title: Site Home Page/SMF Login Integration?
Post by: SmartRoss on April 20, 2008, 06:31:16 AM
I am building a site around the SMF Forum System and I hope to be able to create a login prompt on the site home page that logs into the forum and displays the index.php page. What PHP code would I need to add to the home page do this?

By home page I mean the home page of my website; not the home page of the forum system (index.php).
Title: Re: Site Home Page/SMF Login Integration?
Post by: Oldiesmann on April 21, 2008, 05:45:58 PM
Right after the opening PHP tag, add this:

include_once('/path/to/smf/SSI.php');

Replace "/path/to/smf" with the actual path to your SMF installation.

Then, wherever you want the login box to appear:

ssi_login();
Title: Re: Site Home Page/SMF Login Integration?
Post by: SmartRoss on April 22, 2008, 03:00:18 AM
Thanks a lot for that, Oldiesmann. :)
Title: Re: Site Home Page/SMF Login Integration?
Post by: Jumpmasterrt on May 03, 2008, 04:05:05 PM
So if I wanted to remove or override another PHP scripted program's login to accept the SMF login I would do the same thing at that page's index/login screen?
Title: Re: Site Home Page/SMF Login Integration?
Post by: Spaceman-Spiff on May 05, 2008, 05:23:23 PM
Yes, you can do that, but for a better integration, perhaps you should create a Bridge script instead.

You can check out the SMF API: http://www.simplemachines.org/download/?tools
Title: Re: Site Home Page/SMF Login Integration?
Post by: jmrallen on June 25, 2008, 08:17:14 PM
A somewhat related question: I have integrated my forum login on my non-forum homepage using SSI. However, the login section that appears is somewhat ugly. I would prefer to use the better-looking login/register interface and buttons that's shown inside the forum itself. Is there an SSI reference I can use to include that better-looking interface instead, or are there alterations that I can make to the SSI code that would let me "re-create" that look?

Work-in-progress page is here: http://76.12.227.132/testradical.php (http://76.12.227.132/testradical.php).

You can see that I'm trying to create a login section on the top left. However, I'd like it to look like the forum login/registration interface shown here in the top left: http://76.12.227.132/forums/ (http://76.12.227.132/forums/)