1

I need to create an 'add friend' link programatically.

       $content .= '<li>' . l('<span class="icon"></span>Add to your friends', 'relationship/' . $tid . '/request/1?destination=user/' . $tid, array('html' => true, 'attributes' => array('class' => 'add`-friend')));

It leads me to another page with confirmation form for the invitation.

Could anybody tell me how (if possible) I can display this confirmation form in dialog?

2 Answers 2

1

I've created Add as friend likes in a project once doing this:

l(t('Add as friend'), 'relationship/' . $account->uid . '/request');

It served me fine, but I'm not sure if you want something different.

0
0

It's all because laziness. It's so easy to do.

I need to add this link with dialog on content profile page.

All to do is:

  • add js to content profile page:

        if ($variables['node']->type == 'profile') {  
            drupal_add_js(drupal_get_path('module', 'user_relationships_ui') .'/user_relationships_ui.js');
        } 
    
  • add class to request relationship link:

user_relationships_popup_link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.