Skip to:
Content
Pages
Categories
Search
Top
Bottom

Link Profile Field Type

  • @gogoplata

    Participant

    I’d like to allow users to enter a URL and title on their profiles to link to their external blogs, which are going to be on a subdomain (blogs.domain.com). Currently fields are automatically converted to community searches and are not user friendly for entering URLs/titles.

    Has anyone accomplished this profile field type yet or have any recommendations on how to do so?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • @burtadsit

    Participant

    Howdy. I don’t see any way to do this other than disabling the ‘make everything a search term’ filter which exists in bp-xprofile-filters.php. That filter is called ‘xprofile_filter_link_profile_data’ and you can disable it by creating a small plugin file which contains the following:

    remove_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data',2 );

    Then the new ‘make clickable’ filter can take over and voila. You got a link if the user enters http://myblog.yoursite.org

    There are other ways of doing this but this seems to be the easiest and fastest.

    Create a profile field called ‘my blog’, make it a textfield and you’re done.

    You might want to post a bug ticket in trac that details your inability to do this. An enhancement ticket might suggest a ‘make searchable’ on/off button for all profile fields. ‘eh?

    @gogoplata

    Participant

    Thanks for the instructions, I’ll give this a go tomorrow.

    I’ll probably post an enhancement ticket for the search toggle as well as the link field type as they both seem like they’d be useful.

    Thanks again!

    @dobh32

    Participant

    “make searchable” is a great idea

    @famous

    Participant

    I have been hoping to do this for at least 3 weeks now. Wouldn’t it be better if the profile fields could be broken up? The make searchable would work perfect for other data. When checking make searchable, the formatting of links would not apply allowing more data customization options such as links.

    However, this still leaves the issue of lumping data together. All data that is marked or shown under the profile leaves no way to truly customize it. So then it would be better if data was segmented to allow a type of include or not to include–that way you can post the data where you would like. Or how about the option of adding data to group segments? A drag and drop approach through the control panel.

    For instance, you could drag a field under PROFILE or if you would rather have it show up under LINKS then you have the option to drag it under that category.

    Then in the profile you would have to add the options for categories, not just:

    <?php if ( function_exists(‘xprofile_get_profile’) ) : ?>

    <?php xprofile_get_profile() ?>

    <?php else : ?>

    <?php bp_core_get_wp_profile() ?>

    <?php endif; ?>

    @psfk

    Participant

    Guys, I removed an ‘s’ from this line and it made the URLs work

    if ( preg_match( ‘@(https?://([-\w\.]+)+(:d+)?(/([\w/_\.]*(\?\S+)?)?)?)@’, $value ) ) {

    to

    if ( preg_match( ‘@(http?://([-\w\.]+)+(:d+)?(/([\w/_\.]*(\?\S+)?)?)?)@’, $value ) ) {

    @wythagy

    Participant

    fyi – You should not need to alter any settings as long as you are using BP RC1+ as they took into account this issue. Just be sure users include the “http://&#8221; in their URLs.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link Profile Field Type’ is closed to new replies.
Skip to toolbar