Support » Plugin: Sidebar Login » sing %username% in redirect?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same question:
    is it possoble after login to redirect to the persons personal page (referred to with his username, e.g. Walter) with
    http://www.mydomainname.com/%username% ?

    Sorry to hijack this thread but I think my problem relates.
    I’m using the Sidebar login Widget in Buddypress, I would like to redirect the Dashboard and Profile links to “members/USERNAME/” and “members/username/profile/” So I need to change
    Links (Text | HREF | Capability):

    Dashboard | %admin_url%
    Profile | %admin_url%/profile.php
    Logout | %logout_url%

    I don’t know what these Buddypress %username% functions are called. Any ideas?

    @jgclifton and WouterSe, in the “Login Redirect Url”, simply add this:

    http://{YourWebsiteHere}/wp-admin/profile.php

    Due to the nature of sessions, they will automatically redirect to their profile page when logged in.

    @mgkoller, I don’t use buddypress atm, but if I’ll take a look at it when I have the change.

    hi @mgkoller,

    I had it on my site, but I have BB Press deleted.

    I had exactly the same:

    members/%username%/

    or vice versa, I do not remember:

    %username%members/

    Cheers

    (I hope I got it right out of you, my English is not so good.)

    In regards to the original question, not the BB-related issue, I think I use the solution you’re after. I wanted to be able to redirect to a page based on the user’s login name, not the displayed username.
    I had to edit the plugin, though.

    Edit the file sidebar-login/includes/class-sidebar-login-widget.php.
    You need to change the first part of the replace_tags() function:

    public function replace_tags( $text ) {
    
        if ( $this->user ) {
            $text = str_replace(
                array( '%username%', '%userid%', '%userlogin%' ),
                array( ucwords( $this->user->display_name ), $this->user->ID, $this->user->user_login ),
                $text
            );
        }

    And then use the %userlogin% tag in your widget.

    Hope this helps someone!

    The problem is, since I updated, the URL does not resolve correctly for usernames that contain a space. It used to insert the dash needed, but not since I updated! How do I fix this? Is there a tag to use now other than %username% in URLs?

    The problem is, that the plugin vendor uses

    array( ucwords( $this->user->display_name ), $this->user->ID ),

    in line 105 in class-sidebar-login-widget.php

    It works when you replace it with

    array( ucwords( $this->user->user_login ), $this->user->ID ),

    It’s a hack. But the only solution i found so far. Maybe the programmer could provide a new version to fix this.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘sing %username% in redirect?’ is closed to new replies.