Buddylist2 'add user' to node-profile.tpl.php

Liliplanet - September 10, 2008 - 17:43
Project:Buddylist2
Version:5.x-1.x-dev
Component:Buddylist UI
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

Did a good search and only found the following to add 'add to my buddylist' for my node-profile.tpl.php. It appears but somehow when clicked receive error 'user not found'.

<?php
//load all buddies from active user
$userbuddies = buddy_api_get_buddies($user->uid);
//buddylist links
if ($account->uid != $user->uid && user_access('maintain buddy list')) {
 
in_array($account->uid, array_keys($userbuddies)) ? print l(t('Remove @username from your contact list',array('@username'=>$account->name)), 'buddy/delete/'.$account->uid, array(), drupal_get_destination(), NULL, FALSE, FALSE) : print l(t('Add @username to your buddylist',array('@username'=>$account->name)), 'buddy/add/'.$account->uid, array(), drupal_get_destination(), NULL, FALSE, FALSE);
}
?>

something in there is missing, please any help would be greatly appreciated.

Look forward to your reply.
Lilian

#1

criz - September 10, 2008 - 21:37

hi, take care that $account (profil owner) and $user (viewing user) are loaded correctly...

#2

criz - January 6, 2009 - 18:33
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.