This probably isn't a great question for the Advanced Profile module, but I figured the contributors may know. How do I get an "add to buddies" link in to my panels page? Would one just create a block with the link in?

Comments

michelle’s picture

Status: Active » Fixed

It's not that simple. You need to check for access and if the user is already a buddy. The code for it is in panels-content_userinfo.inc in the includes directory if you want to see what's involved. It's probably easier to just add the user info content type again and theme away everything except the link.

Michelle

greg.harvey’s picture

Ah, cool. Thanks for the pointers. =)

oct376’s picture

I'm having the same problem... Could you elaborate a little more as to what I should do?
Has anyone gotten this to work successfully?

codenamerhubarb’s picture

Try adding print $buddylist_link; to panel-user-info.tpl.php

Fixdit’s picture

None of the above have worked for me. Could someone point to how exactly these buttons should be implemented? I think I'm having trouble passing the right information to the mini panels in the users profile due to the new way Panels2 works. I think it's something to do with the contexts???

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

greg.harvey’s picture

For reference, I ended up adding a link to my usernodes using hook_link_alter and then showing the usernode in my advanced profile panel page ... hook_link_alter code looked like this:

if ($node->type == 'usernode') {
  if (user_access('maintain buddy list')) {
    $links['add_buddy']['title'] = 'Add '.$node->name.' to your network'; 
    $links['add_buddy']['href'] = 'buddy/add/'.arg(1);
  }
}