Skip to:
Content
Pages
Categories
Search
Top
Bottom

Are Usernames with Spaces Sensible?


  • James Blacker
    Member

    @james-blacker

    Is it ‘done’ to choose usernames with spaces? I’m just looking at this forum homepage, and I’m the only one who has chosen one, which is also why I have a problem with links from Post to my Profile on my own discussion board, even though it works for users who have an unbroken string as a username. Obviously, looking at the URL’s it’s the space that stops it being found, but given that the system (both, in fact) allowed me to choose a username with a space, is that no reasonable? Givem that it’s functionally possible, it would be poor to say to my subscribers to not use spaces.

    Here’s the example of posts where link to my profile doesn’t work, but the link to another (non-spaced) user does;

    http://wholelifewholeworld.com/forums/topic/everything-respectful-and-supportive

    http://wholelifewholeworld.com/forums/topic/ilp-practice-session-2912010

    And here’s the change I made to the post.php code, putting in; `<a>”>

    <?php bb_get_profile_link(post_author()); ?></a>` – is this not the best/quoted way to do this?

    <div class="threadauthor">
    <p><strong><a>">
    <?php bb_get_profile_link(post_author()); ?></a></strong>
    <small><?php post_author_title(); ?></small></p>
    </div>

    Thanks,

    James

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

  • deadlyhifi
    Participant

    @tomdebruin

    Usernames can have a space in them because there is also a user_nicename set. This is all lowercase and any spaces are replaced with underscores. If you look at the link to your member page here you’ll see it ending in ‘james-blacker’.

    I presume you’re wanting a link to the profile page when you click on a username.

    To do that you need to something along the lines of

    <a href="<?php user_profile_link(get_post_author_id()); ?>"><?php post_author(); ?></a>


    James Blacker
    Member

    @james-blacker

    Oh you top man Tom! Yep, worked first time, perfect.

    Over on the other forum at: https://bbpress.org/forums/topic/how-to-keep-just-display-name-which-links-to-profile-in-posts#post-58301

    they tried this, which didn’t quite work;

    <a href="http://www.example.com/forum/profile/<?php bb_get_profile_link(post_author()); ?>">
    <?php bb_get_profile_link(post_author()); ?>
    </a>

    I’ll mark this thread as resolved then, and put a link to here on there. Nice one, thanks.

    James

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar