PHP, Button and Javascript

After doing some research, I’m still not clear as to fix my problem. Please let me know if I need to remove my question if it’s similar.

I am doing a content sharing website and it gives users the ability to have their own profiles. I got a plug in to also offer a forum for users to talk about things. Anyway, because of that, there are 2 profiles now for each user which sucks. But one is for the content sharing and one is for the forum. I’m not sure how to combine them and probably can’t. BUT, that isn’t my main concern. The forum profile has a “Message Me’ button on it where people can message the user privately. I want to put that button on the main profile. I am pretty good at figuring things out but this time I can’t really figure it out. I have a PHP file and it has this code in it:

public function add_message_button( $current_object ){

    if( isset($this->wpforo->current_userid) && isset($current_object['userid']) ){

        if( $this->wpforo->current_userid == $current_object['userid'] || $current_object['template'] == 'messages' ) return false;

        if( $this->wpforo->perm->usergroup_can('vwpm') ) {

            $url = $this->get_pm_url($current_object['userid']);

            echo '<div class="wpfpm-message-div"><a href="' . esc_url($url) . '" class="wpfpm-message-button wpf-button">'.wpforo_phrase('Send a Message', false).'</a></div>';




I’m pretty certain that’s the function I need. Now, I have an Ajax.js file, but am uncertain if it has what it needs in there.

my HTML button is: href="" class="wpfpm-message-button wpf-button">Send a Message

However, that url is generated because of the JS and the PHP (the button has to be specific to each user, pending on which profile it was clicked from. So, I know all of the essentials are here. I am just having trouble making a NEW button.

This is an example of the working button: Fake user profile

and then this is where I want the button(you will see ‘Send a message’ on right sidebar): Another fake profile

Anyway, I have been searching in the backend of the forum profile page and I can’t for the life of me see where and how the button is being called. If you need more info, or this is too much of a customized thing, or whatnot, I get that. but really, I have been trying to figure this out for hours. I would love some help. THANK YOU!!

Read more here: PHP, Button and Javascript