Skip to:
Content
Pages
Categories
Search
Top
Bottom

Thank you – and another thought

  • Avatar of Beck B
    Beck B
    Participant

    @beckb

    I’m using this plugin, because otherwise the whole mentioning feature seems screwy to me. @r-a-y, thank you so much for making your work widely available!

    Did wonder, though, if an alternative would be to display whatever display name but with the link title (displayed on mouseover) being the mentionable username (maybe even preceded by “@” to be super clear) rather than a repeat of the display name. Would that be very hard to implement, either working with BP or by modifying your plugin?

    To be clear, I’m not asking you to implement it–although of course you’re more than welcome to do so–but more wondering if it’s something I might be able to tackle without too much headache. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Thanks for your comments, Beck. Glad you like the plugin.

    Re: your thoughts. It’s a good idea, but a little troublesome on my end.

    I’m basically overriding every single instance of the display name, so I’d have to add the title attribute to every single instance. Also, depending on the filter I’m overriding, this might be tricky.

    Take a look at the source code to see what I mean.

    Also, some people might not want this. I’ll put this in the back of my mind for a future release.

    Avatar of Beck B
    Beck B
    Participant

    @beckb

    Oh, no, no worries at all about future releases. It might be an alternate plugin, if anything. I haven’t poked at the code at all yet, sadly, but when I mentioned “modifying your plugin,” I meant more leapfrogging off your work (identifying all those instances) to create a new plugin than changing the official “BuddyPress Usernames Only” plugin.

    I agree that not everybody would want it–I’m just thinking of various ways to get around the username/display name/mentioning issue, in general. Something like the title attribute might be a compromise between the other two approaches.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Just read over your first post again, and I get what you mean now (would be great if I was fully awake before I started typing!).

    That sounds like it might be a good alternative.

    Avatar of Beck B
    Beck B
    Participant

    @beckb

    Hey, sorry to keep bugging you here about something that’s more like an alternative to your plugin, but my head is pounding, and I suspect you might be able to quickly/easily answer me. (And to be clear, I mean “quickly” as in “without taking a ton of your time” not as in “get back to me this instant!” So feel free to just swat the question away.)

    Looks like this is where the title attribute is set, in the bp-core-classes.php file:
    function populate() {

    if ( function_exists( 'xprofile_install' ) )

    $this->profile_data = $this->get_profile_data();

    if ( $this->profile_data ) {

    $this->user_url = bp_core_get_user_domain( $this->id, $this->profile_data, $this->profile_data );

    $this->fullname = attribute_escape( $this->profile_data[BP_XPROFILE_FULLNAME_FIELD_NAME] );

    $this->user_link = "user_url}' title='{$this->fullname}'>{$this->fullname}";

    $this->email = attribute_escape( $this->profile_data );

    } else {

    $this->user_url = bp_core_get_user_domain( $this->id );

    $this->user_link = bp_core_get_userlink( $this->id );

    $this->fullname = attribute_escape( bp_core_get_user_displayname( $this->id ) );

    $this->email = attribute_escape( bp_core_get_user_email( $this->id ) );

    }

    I guess I have two questions.
    1. Is this probably the only place that really matters, or am I just looking for a shortcut because of my headache?
    2. Without modifying the original core file, can I easily override (or supplement or something) this function elsewhere (i.e., in my child theme)? I haven’t dug around to figure out when populate() gets called. I’m pretty sure I could work out the php to search and replace the title link after the fact somehow, if that’d be the best route to take, but I haven’t a clue when/where I’d need to call a function to do so, or what checks I’d need to run before calling the new function, or whatever.

    Or….no, if it were that simple, you’d have done the same. But perhaps I could modify your plugin’s first function (ray_bp_core_get_userlink) that way and create the alternate plugin (fully crediting you, of course) So now the questions are:
    1) Would that do the trick?
    2) Would you mind? I’d be glad to keep your donate info alive.
    Though, really, rather than ape your plugin, I wonder…. how hard would it be to create an admin toggle where the wp admin selects one of two options, and that determines which approach is taken, if it’s really just that one function of yours….?

    I suspect I’m not making much sense. I have got to get away from the computer screen and lie down before my head explodes. Thank you for your patience.

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

The topic ‘Thank you – and another thought’ is closed to new replies.