2010-02-27, 09:12 PM
(This post was last modified: 2010-08-20, 09:25 AM by afrothunder.)
This tutorial will show you how to integrate Windows Live logins with MyBB. Users will be able to log in with Twitter. If the visitor has never visited before it will automatically make an account for that user. If the visitor has visited before it will log that user in.
See the similar tutorial for Twitter here: http://community.mybboard.net/thread-65544.html
Requirements:
A server with PHP5, SQLite, and the mhash and mcrypt PHP modules
A set of Application and Secret keys from Windows Live(
Note: Return URL for the Windows Live app should be http://domain.com/forumdir/webauth-handler.php
Steps:
First, in the Admin CP, go to Templates & Style > Templates > Add Template
Give this new Template the following title:
Fill it in with the following HTML(edit where necessary)
Now go to Configuration>Custom Profile Fields
Note the highest ID number currently listed.
Go to Add New Profile Field
Set the New Field to the following information:
Title: Windows Live UID
Desc: UID
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes
Save this field and Add another
Set the New Field to the following information:
Title: Registered with Windows Live ID
Desc: Registered
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the second ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes
Save this field
Keep those two new IDs in a safe place for later.
Upload the wlregister.php file from the attached archive to your forum root. Edit the file where necessary.
NOTE: fid9 and fid10 should be changed with their respective fid numbers that you noted down, in order(Only replace the number part, leave fid there).
Upload the Application-Key.xml file from the attached archive to a place on your server that is not web-accessible. If there is no such place, chmod the file so that public access is impossible. Edit where necessary.
Upload wlconfig.php to your forum root. Edit the file where necessary.
Upload webauth-handler.php from the attached archive to your forum root.
Upload windowslivelogin.php from the attached archive to your forum root.
You may now direct your guests to login to their Windows Live connected accounts or register using Windows Live with the following url:
http://login.live.com/wlogin.srf?appid=Y...wsignin1.0
Also note that users registered from Windows Live will not have a proper email address set in their profile. You may ask these users after registration to provide one.
The Windows Live API and most other scripts in this package are © Microsoft Corporation.
The wlregister script however is my own(although registration and login is based off of the functions from MyBB's own scripting) and all I ask is that I am credited if anyone asks how the integration was accomplished and that the code is not sold to others(I think you may be breaking other licenses if you do as well but I am not sure).A mention on your site either on the Windows Live connection pages, footer, or in any kind of announcement about the Windows Live connectivity on your site with a link to http://screeze.com would be appreciated as well, but that's in no way required.
If anything isn't working right it may have been something I missed in this tutorial, so please let me know.
See the similar tutorial for Twitter here: http://community.mybboard.net/thread-65544.html
Requirements:
A server with PHP5, SQLite, and the mhash and mcrypt PHP modules
A set of Application and Secret keys from Windows Live(
Note: Return URL for the Windows Live app should be http://domain.com/forumdir/webauth-handler.php
Steps:
First, in the Admin CP, go to Templates & Style > Templates > Add Template
Give this new Template the following title:
Quote:wlregisteruname
Fill it in with the following HTML(edit where necessary)
<html>
<head>
<title>Screeze: Select a username</title>
{$headerinclude}
<script type="text/javascript">
function process(f){
var now = new Date();
f.timezone.value = now.gettimezoneoffset();
return true;
}
</script>
</head>
<body>
{$header}
Hey! It appears this is the first time you are logging into Screeze with your Windows Live ID. Please select a username to use on Screeze and we'll log you in.<br/>
<form action="./wlregister.php" method="post" onsubmit="return process(this)">
Desired Username:<input name="username" type="text" value="">
<input name="timezone" type="hidden" value="0">
<input value="Submit" type="submit">
</form>
<p>By clicking submit you acknowledge that you are over 13 and accept the Screeze Privacy Policy & Terms of Service.</p>
{$footer}
</body>
</html>
Save the template.Now go to Configuration>Custom Profile Fields
Note the highest ID number currently listed.
Go to Add New Profile Field
Set the New Field to the following information:
Title: Windows Live UID
Desc: UID
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes
Save this field and Add another
Set the New Field to the following information:
Title: Registered with Windows Live ID
Desc: Registered
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the second ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes
Save this field
Keep those two new IDs in a safe place for later.
Upload the wlregister.php file from the attached archive to your forum root. Edit the file where necessary.
NOTE: fid9 and fid10 should be changed with their respective fid numbers that you noted down, in order(Only replace the number part, leave fid there).
Upload the Application-Key.xml file from the attached archive to a place on your server that is not web-accessible. If there is no such place, chmod the file so that public access is impossible. Edit where necessary.
Upload wlconfig.php to your forum root. Edit the file where necessary.
Upload webauth-handler.php from the attached archive to your forum root.
Upload windowslivelogin.php from the attached archive to your forum root.
You may now direct your guests to login to their Windows Live connected accounts or register using Windows Live with the following url:
http://login.live.com/wlogin.srf?appid=Y...wsignin1.0
Also note that users registered from Windows Live will not have a proper email address set in their profile. You may ask these users after registration to provide one.
The Windows Live API and most other scripts in this package are © Microsoft Corporation.
The wlregister script however is my own(although registration and login is based off of the functions from MyBB's own scripting) and all I ask is that I am credited if anyone asks how the integration was accomplished and that the code is not sold to others(I think you may be breaking other licenses if you do as well but I am not sure).A mention on your site either on the Windows Live connection pages, footer, or in any kind of announcement about the Windows Live connectivity on your site with a link to http://screeze.com would be appreciated as well, but that's in no way required.
If anything isn't working right it may have been something I missed in this tutorial, so please let me know.
http://Screeze.com - A fun general discussions forum. Login using Facebook, Twitter, Windows Live or normally.
Utilize Twitter logins on your own board.
Utilize Twitter logins on your own board.