1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Making your own login screen

Discussion in 'Styling and Customization Questions' started by Robby, Jun 30, 2013.

  1. Robby

    Robby Well-Known Member

    Hello,

    My main site is wordpress and i would like to make a login screen in my wordpress site.
    Any ideas how this can be done? copying the code from the login page doesn't work...
     
  2. Robby

    Robby Well-Known Member

    Nobody?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    If you want to customise your WP site, wouldn't this be better asked on a WP support forum?

    I have never used WP so can't help.
     
  4. Robby

    Robby Well-Known Member

    Touché but i thaught there would be some specialists here that can guide me.
    On a wp support forum they just say the opposite, time for figure it out myself i suppose.;)
    Sorry for the trouble...
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    Sounds more like you are wanting a bridge? Or are you going to have two different user bases - one in WP and one in xenForo? If two different ones, can't you just set a link to the forum login (in my case it would be http://sayapple.com/login). Or are you wanting a custom coded WP module that ties into the WP theme with a minimal login screen (you would have to figure out how to get it to open the login in overlay mode or get a custom login screen - and in that case the best place to ask would be here)?
     
    Robby likes this.
  6. LPH

    LPH Well-Known Member

    Sorry - I'm back at work - so not always able to see these types of posts. Try this code and modify to your liking.

    PHP:
    <div id="xenlogin">
       <
    form action="http://path/to/community/login/login" method="post" id="pageLogin">
      
         <
    div class="ctrlWrapper">
           <
    dl class="ctrlUnit">
             <
    label for="LoginControl">Your name or email address:</label>
             <
    input type="text" name="login" id="LoginControl" class="textCtrl" tabindex="101" />
      
             <
    label for="ctrl_password">Password:</label></dt>
             <
    input type="password" name="password" id="ctrl_password" class="textCtrl" tabindex="102" />
      
             <
    input type="submit" class="button primary" value="log_in" tabindex="104" data-loginPhrase="log_in" data-signupPhrase="sign_up" />
             <
    label for="ctrl_remember" class="rememberPassword">
             <
    input type="checkbox" name="remember" value="1" id="ctrl_remember" tabindex="103" /> stay_logged_in</label>
         </
    div>
      
         <
    input type="hidden" name="cookie_check" value="1" />
         <
    input type="hidden" name="redirect" value=" ' . get_permalink( $post->ID ) . ' " />
         <
    input type="hidden" name="_xfToken" value=" ' . $XF->visitor->get( 'visitor.csrf_token_page' ) . ' " />

       </
    form>
    </
    div>
    Now that get_permalink may not work for you and you'll want to play around with things for the xf_token and redirects.....

    http://xenforo.com/community/threads/login-from-external-page-needs-redirect-to-original-page.51393/

    Feel free to look over some other instructions.
     
    Last edited: Jul 2, 2013
    Robby and Tracy Perry like this.
  7. Robby

    Robby Well-Known Member

    Thanks man, not quite working for the moment but now i have hope:)
     
  8. Robby

    Robby Well-Known Member

    Ok I have it working but when i put in a false password, it redirects to xenforo login page, is it possible to redirect to wordpress page?
     
  9. LPH

    LPH Well-Known Member


    Maybe .... :

    PHP:
    wp_login_url(get_permalink());
     
  10. Robby

    Robby Well-Known Member

    thanks for the reply but it doesn't seem to work
     
  11. Deepmartini

    Deepmartini Well-Known Member

    How about a xenforo login widget for Wordpress? That would be a handy thing to have!
     
  12. dknife

    dknife Active Member

    I was using this external login form suggestion for my custom site and it works great, however I'm confused about the cookie check component

    Code:
    <input type="hidden" name="cookie_check" value="1" />
    What is the reason to include this? If I have it present in the form, the member cannot login on the external site unless they check the box for remember password, it goes to the forum and displays an error that cookies must be enabled. However removing the cookie_check from the form results in perfect external login allowing temp session or permanent via checkbox.
     

Share This Page