Skip to:
Content
Pages
Categories
Search
Top
Bottom

Extending Profiles


  • arnonel
    Participant

    @arnonel

    Hi guys,

    I have a profile field : “Company” under a Profile Category “About My Company” which is not in the base.

    If i fill the profile field in as Company: Google……………

    On the public profile, If i click on the “Google”, it redirects to a Search, eg: http://domain.com/members/?s=Google

    How do i edit this one profile field (ignore all others – ie, i like how they direct to bp search), so that it links somewhere else? eg: http://www.google.co.uk/search?q=google

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

  • mlovelock
    Participant

    @mlovelock

    Check out this plugin: https://wordpress.org/extend/plugins/custom-profile-filters-for-buddypress/

    It will allow you to exempt that field from the standard BP search string function. You could also add a little customisation in the settings file to set your Company field to redirect to somewhere else as you’re suggesting here.


    arnonel
    Participant

    @arnonel

    Thanks….

    What I was really getting at, was how do I do this in code….


    mlovelock
    Participant

    @mlovelock

    If you’re using the plugin I mentioned and you want to do exactly what you mentioned above, you could probably just add it into the SN arry in the plugin file, thus:

    $social_networking_fields = array( // Enter the field ID of any field that prompts for the username to a social networking site, followed by the URL that must be appended to username to create a link to the user's profile on that site. Thus, since the URL for the profile of awesometwitteruser is twitter.com/awesometwitteruser, you should enter 'Twitter' => 'twitter.com/'. Don't forget: 1) Leave out the 'http://', 2) Include the trailing slash (/) if needed to make a valid URL, and 3) to separate items with commas
    'Twitter' =>'twitter.com/' ,
    'Delicious ID' => 'delicious.com/' ,
    'YouTube ID ' => 'youtube.com/' ,
    'Flickr ID ' =>'flickr.com/' ,
    'FriendFeed ID' => 'friendfeed.com/',
    'Facebook' => 'facebook.com/',
    'MySpace' => 'myspace.com/',
    // your site's Company Field
    'Company' => 'google.co.uk/search?q='

    );

    // You shouldn't need to touch anything below this line.

    Of course I haven’t actually tried this myself. The alternative is to extend the plugin a little with a function that takes that company field and does whatever you want to do with it.


    arnonel
    Participant

    @arnonel

    What i want to do is add different html/css/etc for a particular field….

    eg: adding a map…

    i know there are these plugins,….but they are merely examples of what i want to achieve in code…

    i want to do all sorts of things to profile fields….. and need to know how to do things like this in code…


    mlovelock
    Participant

    @mlovelock

    You need to write a plugin then, and / or delve into the wordpress hooks and functions – best to check out the buddypress codex: https://codex.buddypress.org/


    arnonel
    Participant

    @arnonel

    or search google for help? yeah, i know about codex, google, etc :)

    was hoping for a little more specific help…


    mlovelock
    Participant

    @mlovelock

    For more specific help you’d need to give more specific details –

    i want to do all sorts of things to profile fields…..

    … is a bit vague.

    Also, you’re effectively asking someone to teach you how to write code. What you’re after probably requires a more in-depth answer than you’re likely to get here in the forums.

    Perhaps you ought to download and break down / delve into the custom profile filters plugin and start from there – that’s an example of how to do these things in code – combined with the codex etc should get you started.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Extending Profiles’ is closed to new replies.
Skip to toolbar