Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Integrating Login into Homepage?

Aloittaja Mstcool, tammikuu 20, 2014, 06:28:07 IP

« edellinen - seuraava »

Mstcool

Hey guys,
Is there a way in which I can integrate the SMF login into a homepage (not a portal, just a html coded homepage)? I am new to coding so I have no idea on what to do. I just want to make it so people can login via the homepage and when they access the forum, they would already be logged in.


Thanks,
-Mstcool. :)

Arantor

Holder of controversial views, all of which my own.


Mstcool

Oh, right. I read about that yesterday, I completely forgot about it. But what does it mean by "calling the Ssi.php file"? And am I supposed to add the Ssi.php file to the homepage, right? Not to the SMF forum?

Arantor

Yup, you have the homepage load SSI.php which can check if the user is logged in or not.
Holder of controversial views, all of which my own.


margarett

Look at the file "ssi_examples.php" in your forum root for a more detailed insight.
And yes, you add SSI.php to your homepage by adding:

// Include the SSI file.
require(dirname(__FILE__) . '/SSI.php');

(have a look at that file ;) )

edit: ninja'd!
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Mstcool

Wait, so for the code you wrote....am I supposed to change the "dirname(___FILE__)" thing to any? And this goes on my index file for my homepage, right? Sorry for asking lame questions, just confused. :p

margarett

dirname(__FILE__) is a way to automatically get the folder where the script being called is. If you don't want to use it like that (if your homepage is not in SMF folder, as it is likely), you can always give the full path:


// Include the SSI file.
require('/srv/home/users/user1234/forum/SSI.php');

Works the same way
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Mstcool

Thank You!!

I have integrated the login with the homepage and it works perfectly.

Thanks once again,
-Mstcool. :)

Advertisement: