0

I want to print Add/Remove friend link fro user relationship module on user profile page. I am trying this using below code but its causing white screen.

//add link
global $user;
$account = user_load(arg(1));
$actions = _user_relationships_ui_actions_between($user, $account);
if (count($actions)) {
  print theme('item_list', $actions);
}

Please help me.

0

Install Devel module and add dpm statements in a progressive fashion. For instance: After you load the account, add : dmp (arg(1)) (and no other statements following). Inspect the dpm output for correctness and go onto the next statement, ie. dpm($account(arg(1)) and so forth.

2
  • Hi, @J.Reynolds dpm($account(arg(1)) function is not printing anything.
    – D-pak
    Aug 4 '14 at 5:00
  • I assume dpm(arg(1)) worked. Next step is to add dmp after the $account = user_load statement, and then to dpm($account). I made a mistake in saying dpm($account(arg1)) as $account is a std class. You just go by your code snippet above and start with one line then dpm the variable, then onto the next line etc. Aug 5 '14 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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