Download & Extend

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

Project:Buddylist2
Version:5.x-1.x-dev
Component:Buddylist UI
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

#2

Status:active» closed (fixed)
nobody click here