Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sign in redirect

  • Avatar of Andrew Parris
    Good in Today
    Participant

    @goodintoday

    Okay, I find it rather hard to believe that I’m the first to ask this question but I did search it for the last few hours online and have not come up with a viable answer so I must word things badly or something. What I am looking to do is… I have a sign in link at the bottom of my forum topics that anyone not logged in sees. I want to have them redirected back to the same page that called sign in once they have finished signing in.

    In other words you are currently reading a topic post called “I can win.” but you’ve forgotten to log in and so you can not post a reply. But there is a link there to take you to the sign in page. Upon signing in I wish to redirect the user back to the page they clicked the sign in link from, the topic post of “I can win.”. So far, I’ve been fighting this for a few hours and I’m not winning. LOL! The sign in link is inside of a <?php call if that makes any difference. It looks like this…

    <?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'Want to join the conversation? Join or Signin‘, ‘bbpress’ ); ?>

    It’s inside of the form-reply.php and yeah, I’ve already edited it a bit but as you can plainly see I have a link there to Sign in. I need to know how to make the sign in page bring them back to where they clicked on this link from, once they’ve signed in.

    I hope that I’ve made my problem clear enough and I hope there’s an easy answer out there somewhere. Any help would be appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • What I’ve done in the past for blocking activity comment replies but the same idea can be modified for forum replies. (ie, change out the permalink)


    $bp->root_domain . '/wp-login.php?redirect_to=' . urlencode( bp_activity_get_permalink( $activities_template->activity->id ) )

    Avatar of Andrew Parris
    Good in Today
    Participant

    @goodintoday

    I’ve come up with this line of code…

    / *<?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'Want to join the conversation? Join or ‘.__(‘Login’, ‘suffusion’).’‘ ); ?> */

    And it works… When you’re on the login screen UP UNTIL YOU PRESS SUBMIT the redirect shows correctly in the URL. WHEN YOU PRESS SUBMIT to actually login the system then redirects your redirect to PROFILE.PHP and I’m so far unable to locate which file this secondary redirect is bothering me from. I’ve butchered wp-login.php and the system doesn’t even seem to care. I think I could erase the file entirely and the system wouldn’t care.

    What file is BuddyPress using to control User Login’s, if it’s not using WP-LOGIN.PHP? I’ve been unable to locate that too. I figure my secondary redirect headache MUST be in that file somewhere.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.