BuddyDev

Search

Extended Friendship Request Plugin – add radio buttons

  • Participant
    Level: Initiated
    Posts: 1
    Steven Brown on #4195

    I’m using this great little plugin and wanted to know if it’s possible to add a set of radio buttons underneath the message field?

    My use case is this… I want users to be able to select how they know someone (similar to linkedin) for example:

    I know this person from: College, University, Previous job, we’re friends, etc

    This means that the person receiving the request can see at a glance how someone knows them.

    Is it simple to add this kind of functionality?

    Thanks

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4208

    Hi Steven,

    Thank You for posting. Please download the modified version of plugin from the following url and let me know if it works for you or not.

    https://buddydev.com/wp-content/blogs.dir/1/files/2016/06/buddypress-extended-friendship-request-client.zip

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 1
    Steven Brown on #4225

    Thanks so much Ravi! This works perfectly.

    One other quick question…

    In the friend request received by the user, is it possible to assign a class to the message and radio button answer so these can be styled differently using css?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4259

    Hi Steven,

    Thank You for your acknowledgement. Yes it can be easily. Please modify the following code of file name “bp-extended-friendship-request.php” on line no. 336
    for message content replace this line

    
    
    $message = $_POST['friendship_request_message'];
    
    

    with

    
    
     $message = '<div class="class-for-message-content">'. $_POST['friendship_request_message'] .'</div>';
    
    

    and for selected radio button

    
    
    $message = $message.__(' "Know you from - ', 'bp-ext-friends-request' ).$info[$additional_info].'"';
    
    

    replace with

    
    
    $info = '<div class="class-for-selected-radio">'.__(' Know you from - ', 'bp-ext-friends-request' ).$info[$additional_info].'</div>';
    
    $message = $message.$info;
    
    

    Thank You
    Ravi

    • This reply was modified 8 years, 5 months ago by Ravi.

You must be logged in to reply to this topic.

This topic is: not resolved