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. :)
How to use the SMF user system outside of SMF (http://wiki.simplemachines.org/smf/How_to_use_the_SMF_user_system_outside_of_SMF)
SSI Readme (http://wiki.simplemachines.org/smf/Category:SSI)
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?
Yup, you have the homepage load SSI.php which can check if the user is logged in or not.
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!
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
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
Thank You!!
I have integrated the login with the homepage and it works perfectly.
Thanks once again,
-Mstcool. :)