Skip to:

Modify the member search function

  • laurienicholas


    Hey guys,
    Right this could be a long shot but here goes…

    I use the S2 Member plugin to limit access on my website and this changes the way that users sign up – It also has it’s own way of adding new information to the BP Profiles and allows the easy importation of a lot of users at once.

    The problem this has posed is that I have a massive field called ‘Business Description’ that I would very much like to be included in the search function within buddypress but as it’s been created by s2Member it currently isn’t.

    The information is stored in the wp_usermeta table within wordpress and each row has a user_id, a meta_key which for the values I want to be searchable is ‘wp_s2member_custom_fields’ and then the meta_value is stored in this format:

    `a:7:{s:20:”business_description”;s:112:”HERE IS THE BUSINESS DESCRIPTION.”;s:12:”telephone_no”;s:13:”TELEPHONE NUMBER”;s:15:”company_website”;s:0:””;s:9:”address_1″;s:17:”ADDRESS 1″;s:9:”address_2″;s:16:”ADDRESS 2″;s:9:”address_3″;s:9:”Sheffield”;s:8:”postcode”;s:6:”POST CODE”;}`

    (I’ve copied this straight from database so the CAPITAL LETTERS are where I’ve omitted sensitive information.)

    Right now does anybody now how I can modify the buddypress search function to include this data and provide a link to the correct users profile in the search results?

    Many thanks in advance,

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

  • laurienicholas





    Short answer – don’t do it.

    Long answer – could be done, but performance would be terrible because your meta_value is a serialized string.

    If you could require some other field(s) for a search and then based on those results then do a sub-search by pulling the wp_s2member_custom_fields into php and unserializing and doing a string search on each one – then performance would be better.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modify the member search function’ is closed to new replies.
Skip to toolbar