The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Login to forumotion forums from different site?

View previous topic View next topic Go down

Login to forumotion forums from different site?

Post by mrchasez on November 22nd 2011, 4:17 pm

Forumotion hosts my forums, but on my main site ( not forumotion )
I want to have a login / register thing. So they could login and register from my website?
Is this possible?

mrchasez
Forumember

Posts : 34
Reputation : 0
Language : United States

Back to top Go down

Re: Login to forumotion forums from different site?

Post by LGforum on November 22nd 2011, 5:20 pm

Yes.
The best way to do it, would be to make a HTML page on your forum, with a log in form in. (the log in form will obviously log people into your forum).
Then on your actual site, have an Iframe displaying that log in form.
Therefore they can log in to your forum.

To make them register, then you'll just have to have a link on your site.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login to forumotion forums from different site?

Post by mrchasez on November 22nd 2011, 6:40 pm

uh.

An example?
I was looking more like, they can register / login and stay on my main site.

mrchasez
Forumember

Posts : 34
Reputation : 0
Language : United States

Back to top Go down

Re: Login to forumotion forums from different site?

Post by LGforum on November 22nd 2011, 7:44 pm

Yes. This will do just that.

Take my steps slowly.
Create a log in form in a HTML page. This tutorial will provide a log in form for you: http://help.forumotion.com/t262-log-in-form-for-the-faq

After that, go to your main site. And have somewhere:
Code:

<iframe src="URL OF YOUR FORUM HTML PAGE WITH LOG IN FORM" width="SET THE WIDTH" height="SET THE HEIGHT" frameborder="0" name="fmlogin"></iframe>

And that will mean, on your main site, people will see a log in form. That when they enter their details in it. It will log them into your site.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login to forumotion forums from different site?

Post by mrchasez on November 23rd 2011, 8:33 am

How can i get this but for registering >??????

It lets the user login, but my whole forums becomes a little box on my webstie 0.0

How can i do that but for registering?

mrchasez
Forumember

Posts : 34
Reputation : 0
Language : United States

Back to top Go down

Re: Login to forumotion forums from different site?

Post by mrchasez on November 23rd 2011, 8:39 am

Better yet, how about when they login from the login on my website, It auto takes them to my forums?

mrchasez
Forumember

Posts : 34
Reputation : 0
Language : United States

Back to top Go down

Re: Login to forumotion forums from different site?

Post by LGforum on November 23rd 2011, 10:15 am

You'll need to use Javascript to change the functions of things inside the Iframe.

Someting like this will (should) work:
Code:

$(function() {
var iframe=parent.fmlogin;
$(iframe).find('form').attr('target','_top');
});

So when the form is submitted, it submits and changes the actual page, not the contents in the iframe. Thus taking the user to your forum.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login to forumotion forums from different site?

Post by ioncube on November 24th 2011, 12:17 am

@LGforum wrote:You'll need to use Javascript to change the functions of things inside the Iframe.

Someting like this will (should) work:
Code:

$(function() {
var iframe=parent.fmlogin;
$(iframe).find('form').attr('target','_top');
});

So when the form is submitted, it submits and changes the actual page, not the contents in the iframe. Thus taking the user to your forum.

Trying to understand your code using this as a html code for the login form
Code:
 <form action="http://engineering.forumotions.info/login.forum" method="post">
    <table cellspacing="1" cellpadding="3" border="0">
      <tr>
        <td width="25%" align="right"><br />
        Username:</td>

        <td><input type="text" name="username" id="username" size="11" maxlength=
        "40" /></td>
      </tr>

      <tr>
        <td align="right"><br />
        Password:</td>

        <td><input type="password" name="password" id="password" size="11" maxlength=
        "32" /></td>
      </tr>

      <tr align="center">
        <td colspan="2">Remember me: <input type="checkbox" name="autologin" checked=
        "true" /></td>
      </tr>

      <tr align="center">
        <td colspan="2"><input type="submit" class="mainoption" name="login" value=
        "Log in" /></td>
      </tr>
    </table>
  </form>

I cannot understand this part
Code:
var iframe=parent.fmlogin;
...& this
Code:
$(iframe).find('form').attr('target','_top');
supposedly will add target blank feature to form tag Yes?

ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

Re: Login to forumotion forums from different site?

Post by LGforum on November 24th 2011, 2:03 am

if you look at the Iframe HTML you can see i have given it a name of 'fmlogin'

Code:

<iframe src="URL OF YOUR FORUM HTML PAGE WITH LOG IN FORM" width="SET THE WIDTH" height="SET THE HEIGHT" frameborder="0" name="fmlogin"></iframe>
And so it can be accessed in JS by:
Code:

var iframe=parent.fmlogin;

Now it can be manipulated like other elements. For some examples:
Code:

iframe.style.display="none";
iframe.style.width="100%";
etc etc...

In my original code it was actually wrong.
It was supposed to be var iframe=parent.fmlogin.document;
Therefore the DOM of the contents within the iframe is accessed.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Login to forumotion forums from different site?

Post by mrchasez on November 24th 2011, 5:32 am

So i should add that to my index.html
or make a Js file?

mrchasez
Forumember

Posts : 34
Reputation : 0
Language : United States

Back to top Go down

Re: Login to forumotion forums from different site?

Post by ioncube on November 24th 2011, 8:05 am

Plus one for explaination

ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum